php5.6 Compiling and installing Apache

Source: Internet
Author: User

1. Download the source package
wget URL/php-5.6.30.tar.gz
2. Unzip the source package
TAR-ZXVF php-5.6.30.tar.gz
3. Create an installation directory
mkdir/usr/local/php
4, enter the extracted directory, initialize the installation environment:
./configure \
--prefix=/usr/local/php \
--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS \
--WITH-CONFIG-FILE-PATH=/USR/LOCAL/PHP/ETC \
--with-mysql=/usr/local/mysql \
--with-libxml-dir \
--WITH-GD \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir \
--with-zlib-dir \
--WITH-BZ2 \
--WITH-OPENSSL \
--with-mcrypt \
--ENABLE-SOAP \
--ENABLE-GD-NATIVE-TTF \
--enable-mbstring \
--enable-sockets \
--ENABLE-EXIF \
--disable-ipv6
Error
Configure:error:jpeglib.h not found.
[Email protected] php-5.6.30]#
Install Yum install-y libjpeg-devel
Error
Configure:error:mcrypt.h not found. Please
Reinstall Libmcrypt.
[Email protected] php-5.6.30]#
Install yum install-y epel-release libmcrypt-devel
5, compilation Yi: Make
6. Installation: Make install
/usr/local/php/bin/php-i viewing the relevant configuration
Copy the configuration file to the specified directory
/usr/local/apache2/bin/apachectl restart
The Apachectl service needs to be restarted because PHP is configured to change Apache
Copy Preparation/usr/local/src/php.../php.ini-production
To/usr/local/php/etc/php.ini
Modifying the Apache configuration file
Vi/usr/local/apache2/conf/httpd.conf
Add index.php after DirectoryIndex index.html
Description: Increase the index for PHP if a site default page is
index.php, then you have to add this index.php support.
Under AddType application/x-gzip. GZ tgz
Plus one line.
AddType application/x-httpd-php. php
Explanation: Support PHP script parsing, must add the corresponding type.
Found it:
#ServerName www.example.com:80
Modified to:
ServerName localhost:80
Check for problems with the configuration file:
/usr/local/apache2/bin/apachectl-t
/usr/local/apache2/bin/apachectl restart
The Apachectl service needs to be restarted because PHP is configured to change Apache

php5.6 Compiling and installing 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.