首先 tar xzvf httpd-2.2.4.tar.gz tar xzvf php-5.2.1.tar.gz tar xzvf mysql-5.0.37.tar.gz
而後進入mysql的文件夾 cd mysql-5.0.37 ./configure --with-charset=utf8 -with-extra-charset=all --prefix=/home/mysql make make install 期間可能make install 的時候要sudo,那就sudo好了。
測試一下 /home/mysql/bin/mysql 成功的話光標是這樣的: Welcome to the MySQL monitor. Commands end with ; or \g .....(這裏一堆話,而後) mysql>
接下來:
轉到apache的目錄下: cd httpd-2.2.4 ./configure --prefix=/home/httpd/ --enable-modules=most --enable-mods-shared=most --enable-so make make install
注意:這裏採用的是動態編譯,靜態的本文不涉及,以後有空了加上。
轉到php的目錄下: cd php-5.2.1 apt-get install flex apt-get install libxml2-dev ./configure --prefix=/home/php --with-mysql=/home/mysql --with-apxs2=/home/httpd/bin/apxs make make install
而後: cp php.ini-dist /home/php/lib/php.ini
修改php.ini 下面的參數是有可能須要改的,因人而易,不作也沒事 short_open_tag = Off output_buffering = On zlib.output_compression =On safe_mode = On include_path = ".:/home/php/bin:/home/php/includes:/home/php/lib/php" register_globals = On
而後修改httpd的配置文件: vim /home/httpd/conf/httpd.conf 加入PHPIniDir /home/php/lib