Linux apache+php setup Configuration record
Chapter 1th Environmental Description
1.1 System Description
CentOS 6.4
1.2 Software Description
Httpd-2.4.2.tar.gz
Apr-util-1.4.1.tar.gz
Apr-1.4.6.tar.gz
Pcre-8.13.tar.gz
php-5.4.3.tar.bz2
Libmcrypt-2.5.8.tar.gz
Mhash-0.9.9.9.tar.gz
2nd Apache Construction Instructions
2.1 Installing dependent Packages
Yum install make openldap-devel ntp vim-enhanced gcc gcc-c++ gcc-g77 Flex Bison autoconf bzip2-devel ncurses-devel OpenSSL -devel libtool* zlib-devel libxml2-devel libjpeg-devel libpng-devel libtiff-devel fontconfig-devel freetype-devel Libxpm-devel gettext-devel curl-devel Curl pam-devel openldap-devel e2fsprogs-devel krb5-devel libidn libidn-devel-y
2.2 Installing APR
TAR-ZXVF apr-1.4.2.tar.gz
CD apr-1.4.2.tar.gz
./configure--PREFIX=/USR/LOCAL/APR
Make && make install
2.3 Installing Apr-util
TAR-ZXVF apr-util-1.3.10.tar.gz
CD apr-util-1.3.10.tar.gz
./configure \
--prefix=/usr/local/apr-util \
--with-apr=/usr/local/apr
Make && make install
2.4 Installing Pcre
TAR-ZXVF pcre-8.10.tar.gz
CD pcre-8.10
./configure--prefix=/usr/local/pcre
Make && make install
2.5 Installing Apache
./configure \
--prefix=/usr/local/apache \
--with-apr-util=/usr/local/apr-util/\
--with-pcre=/usr/local/pcre/\
--with-apr=/usr/local/apr/
Make && make install
2.6 Description of the configuration file
/usr/local/apache/conf/httpd.conf
DocumentRoot "/usr/local/apache/htdocs"
Modify this section to configure the project run directory.
Startup file
/usr/local/apache/bin/apachectl
Error: Httpd:could not open configuration File/usr/local/apache2/conf/httpd.conf:no such file or directory
--------------------------------------
Pending Verification ~ ~ ~
3rd. PHP Construction Instructions
3.1 Installing Libmcrypt
Tar xvf libmcrypt-2.5.8.tar.gz
./configure
Make && make install
3.2 Installing Mhash
Tar xvf mhash-0.9.9.9.tar.gz
CD mhash-0.9.9.9
./configure
Make && make install
3.3 Installing PHP
./configure--prefix=/usr/local/php \
--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS \
--with-config-file-path=/usr/local/php/etc
Make && make install
CP Php.ini-production/usr/local/php/etc/php.ini
3.4 Error Prompt Modification instructions
Configure:error:Cannot Find LDAP Libraries In/usr/lib
Ln-s/usr/lib64/libldap*/usr/lib/
Configure:error:libjpeg. (A|SO) not found.
Ln-s/usr/lib64/libjpeg.so/usr/lib/libjpeg.so
Configure:error:libpng. (A|SO) not found.
Ln-s/usr/lib64/libpng.so/usr/lib/
4th. Modify the configuration and test
4.1 Modifying Apache configuration file support PHP
Modify DirectoryIndex index.html to DirectoryIndex index.html index.php
and add AddType application/x-httpd-php. php
4.2 Testing PHP Support
Create a Test PHP page test.php, and store it in the website home directory,
<?php
Phpinfo ();
?>
After restarting the Apache service, visit http://ip/test.php
See the site, the PHP setup is complete;
Linux apache+php setup Configuration record