wget http://apache.etoak.com//httpd/httpd-2.2.21.tar.gz
tar xzvf httpd-2.2.21.tar.gz
cd httpd-2.2.21
./configure --enable-so --enable-mods-shared=most
make
make install
vi /usr/local/apache2/conf/httpd.conf #緙栬緫閰嶇疆鏂囦歡
鎵懼埌錛?ServerName www.example.com:80
淇敼涓猴細ServerName localhost:80
鎵懼埌錛欴irectoryIndex index.html
淇敼涓猴細DirectoryIndex index.html index.php
鎵懼埌錛歄ptions Indexes FollowSymLinks
淇敼涓猴細Options FollowSymLinks #涓嶆樉紺虹洰褰曠粨鏋?br />澧炲姞
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
鍦ㄦ枃浠舵渶鍓嶉潰鎻掑叆涓嬮潰鐨勮錛屼嬌鍏舵敮鎸乧hkconfig鍛戒護錛?nbsp;
#!/bin/sh
# chkconfig: 2345 85 15
# description: Apache is a World Wide Web server.
錛堟敞錛氬湪榪愯綰?/3/4/5涓姞鍏ユ湇鍔★紝鍚姩欏哄簭85錛屽仠姝㈤『搴?5錛?br />
chkconfig --add httpd
service htpd start
yum install mysql-devel
yum install libpng-devel
yum install libjpeg-devel
yum install libxml2-devel
wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download
tar xzvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install
//wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
//tar xzvf libiconv-1.14.tar.gz
//cd libiconv-1.14
//./configure
//make
//make install
wget http://museum.php.net/php5/php-5.1.6.tar.gz
tar xzvf php-5.1.6.tar.gz
cd php-5.1.6
./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd --with-xlib --with-mysqli --with-jpeg-dir=/usr/lib/jpeg --with-zlib-dir=/usr/lib/zlib
//--with-mcrypt
make
緙栬瘧鍑洪敊 ext/mysqli/mysqli_api.c:145: error: 'gptr' undeclared (first use in this function)
澶勭悊 ext/mysqli/mysqli_api.c and replace all occurrances of gptr
with char*
make install
緙栬緫 httpd.conf 鏂囦歡浠ヨ皟鐢?PHP 妯″潡銆侺oadModule 琛ㄨ揪寮忓彸杈圭殑璺緞蹇呴』鎸囧悜 緋葷粺涓殑 PHP銆備互涓婄殑 make install 鍛戒護鍙兘宸茬粡瀹屾垚浜嗚繖浜涳紝浣嗗姟蹇呰媯鏌ャ?LoadModule php5_module modules/libphp5.so
cp php.ini-dist /usr/local/php5/etc/php.ini
PHP鎵╁睍mcrypt緙栬瘧鏃舵彁紺猴細configure: error: *** libmcrypt was not found
闇瑕佸畨瑁卨ibmcrypt+mhash+mcrypt
鍏ㄩ儴緙栬瘧瀹夎錛屽畨瑁呭埌mcrypt鐨勬椂鍊欏嚭鐜頒簡闂
./config
checking for libmcrypt - version >= 2.5.0... no
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
configure: error: *** libmcrypt was not found
瑙e喅鏂規硶濡備笅錛氳繍琛?export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
鐒跺悗make 錛?make install
瀹屾垚

]]>