Linux Web server Build-php article

Source: Internet
Author: User
Tags install php install openssl

After installing PHP, you can parse some dynamic pages, this article uses the source scheme to install PHP, the installation version is 5.3.10.


PHP is installed on top of Apache and MySQL, and readers can refer to the installation articles for Apache and MySQL.


Check the Lib library required for PHP installation

Rpm-qa zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel

Installing LIB Libraries

Yum Groupinstall "x software Development"

Yum-y Install zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel

Installing the Libiconv Library

wget http://ftp.gnu.org/pub/pub/gnu/libiconv/libiconv-1.14.tar.gz

Also need to install OpenSSL and openssl-devel yum install libxslt-devel*-y

./configure--prefix=/usr/local/libiconv/libiconv

Make&&make Install

./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs \

--with-mysql=/usr/local/mysql \

--WITH-XMLRPC \

--WITH-OPENSSL \

--with-zlib \

--with-freetype-dir \

--WITH-GD \

--with-jpeg-dir \

--with-png-dir \

--with-iconv=/usr/local/libiconv \

--enable-short-tags \

--enable-sockets \

--enable-zend-multibyte \

--ENABLE-SOAP \

--enable-mbstring \

--enable-static \

--ENABLE-GD-NATIVE-TTF \

--with-xsl \

--ENABLE-FTP \

--with-libxml-dir

Mak&&make Install

Add a few more parameters for Nagios's PHP environment

--enable-sigchild \

--ENABLE-PCNTL \

--enable-bcmath

I am in the implementation of the configuration process, there are some errors, but also found on the Baidu solution, the actual system is different, there may be a different situation.

Php.ini* is a PHP configuration file

Copy the production version's configuration file to the PHP installation directory

CP Php.ini-production/usr/local/php/lib/php.ini

Configure Apache to support PHP

Modify Apache config file httpd.conf add two lines

AddType application/x-compress. Z

AddType application/x-gzip. gz. tgz

AddType application/x-httpd-php. php. php3

AddType Application/x-httpd-php-source. Phps

[[email protected] conf]# grep php httpd.conf

LoadModule Php5_module modules/libphp5.so

PHP module in front of the PHP configuration using the DSO method, the PHP module written to the Apache configuration

Add index.php to the default site home page location


In the Apache master configuration file


</IfModule>


# ' Main ' server configuration

#

..... skipping ...

DirectoryIndex index.php index.html

</IfModule>

After the installation of PHP can be in the default site directory to write a PHP file, and then restart the Apache service, through the browser to access.


Linux Web server Build-php article

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.