Install PHP under Rhel 5

Source: Internet
Author: User
Tags php software
There are several conditions that need to be met before installing the PHP software. As follows:

1, RPM-IVH zlib-devel-1.2.3-3.i386.rpm

2, Rpm-ivh libxml2-devel-2.6.26-2.1.2.8.i386.rpm

(The above two packages are in the server directory of the RHEL5.5 installation CD-ROM)

Next, we're going to install PHP.

Note that my MySQL is the RPM package installed, MySQL header file is mysql.h, it is located in the/usr/include/mysql/directory. Also, when installing MySQL, you should install three files, one server, one client, and one devel. The header file mysql.h can only be found after Devel has been installed.

#./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql=/usr/include/mysql/

#make

#make Install

#make Test

Configuring the php.ini File

Because I use this version of php-5.3.8.tar.gz, it will have two files php.ini-development,php.ini-production after decompression.

Copy the Php.ini-development file to the PHP installation directory under/usr/local/php/lib and modify the file name to PHP.ini

Configure the Apache httpd.conf file after installation

in which to join

LoadModule php5_module modules/libphp5.so//This module is automatically written to the httpd.conf file when PHP is installed.
AddType application/x-httpd-php. PHP//This need to be manually added


DirectoryIndex index.html Index.html.var index.php

As for if the PHP program is running

Put the PHP program under Htdocs under Apache.

The final reboot of Apache is complete.

  • 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.