I almost gave it away, but it was easy to install it. I am not wasting my efforts for a few nights. It would be a troubleshooting task if I installed it all new... After solving the problem, I am relieved... Lamp is now complete. (The simplest one is mysql5.1, and the most tricky one is the Apache configuration file conflict in centos. There are two httpd. conf files that have been misleading for a long time and clarified the problem)
Install PHP 5.1.6
Install PHP 5.1.6
-----------------Download the software package php-5.1.6.tar.gz at www.php.net --------------------
# Tar zvxf php-5.1.6.tar.gz
# Cd php-5.1.6
#./Configure -- prefix =/usr/local/PHP/
-- With-mysqld =/usr/local/MySQL/
-- With-apxs2 =/usr/local/Apache/bin/apxs
(Some people like: php-5.2.5/configure -- with-apxs2 =/opt/www/bin/apxs -- With-mysql =/opt/mysql5)
(Some people like :. /configure ''-- prefix =/usr/local/PhP5'' -- With-mysql =/export/home/DB/MySQL ''-- With-mysqli =/export/home/ DB/MySQL/bin/mysql_config ''-- with-apxs2 =/export/home/WebAdmin/servers/apache2/bin/apxs'' -- With-Gd =/usr/local/src/ src/gd-2.0.33 ''-- With-JPEG-Dir =/usr/local/src/JPEG'' -- With-zlib ''-- With-PNG'' -- With-FreeType-Dir =/usr/local/src/FreeType ''-- With-config-file-Path =/usr/local/PhP5/etc'' -- enable-Gd-native-ttf'' -- With-ttf'' -- enable-memory-limit ''-- enable-Zend-multibyte'' -- disable-ipv6 ''-- disable-path-Info-check'' -- With-iconv ''-- With-pear'' -- disable-debug'' -- With-mail ''-- enable-mbregex'' -- enable-mbstring = all ')
# Make
# Make install
# Cp PHP. ini-Dist/usr/local/PHP/lib/PHP. ini
5. Configure the httpd. conf file of the Apache service
* Add loadmodule php5_module module/libphp5.so to loadmodule.
* Add index. php at directoryindex
* Add in addtype Application
Addtype application/X-httpd-PHP. php. phtml
Addtype applicatoin/X-httpd-PHP-source. PHPs
Note:
1: note that there are two httpd. conf files on centos. Be sure not to mistake the object. You will know which one is used when apachectl is restarted.
2: When libphp5.so is called, some machines will find/module/libphp5.so in/etc/httpd/. By default, the Module Directory is not found. You have two options: copy the file directory containing libphp5.so in the Apache directory, and modify the libphp5.so path in the loadmodule In the httpd. conf file.