Install php in rhel5

Source: Internet
Author: User
Tags php software
Before installing php software in rhel5, there are several conditions to be met. 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 under the Server directory of the RHEL5.5 installation CD)

Next, we will install PHP.

Note: my mysql is installed in the RPM package, and the mysql header file is mysql. h, which is located in the/usr/include/mysql/directory. Another point is that three files, server, client, and devel, should be installed during mysql installation. The header file mysql. h can be found only after devel is installed.

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

# Make

# Make install

# Make test

Configure the php. ini file

For my php-5.3.8.tar.gz version, two files, php. ini-development and php. ini-production, will be decompressed.

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

Configure the httpd. conf file of apache after installation

Add

LoadModule php5_module modules/libphp5.so // This module is automatically written to the httpd. conf file when installing php.
AddType Application/x-httpd-php. php // you need to manually add


DirectoryIndex index.html. var index. php

If you run a php program

Put the php program under htdocs under apache.

Restart apache.

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.