Install PhP5 + apache2.2 + mysql5.1 on centos5

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.