Chapter 1 Environment Description1.1 System DescriptionCentos 6.4 1.2 Software Descriptionhttpd-2.4.2.tar.gz http://pan.baidu.com/s/1hr2mtpE apr-util-1.4.1.tar.gz http://pan.baidu.com/s/1bol16Mjapr-1.4.6.tar.gz http://pan.baidu.com/s/1sjX1LBB pcre-8.13.tar.gzphp-5.4.3.tar.bz2 http://pan.baidu.com/s/1hr2mtpElibmcrypt-2.5.8.tar.gz http: //pan.baidu.com/s/1sjX1LBB
mhash-0.9.9.9.tar.gzChapter 2 Apache Building Instructions2.1 Install dependency packagesyum 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 -y2.2 Install aprtar -zxvf apr -1.4.2.tar.gz cd apr-1.4.2.tar.gz ./configure --prefix=/usr/local/aprmake && make install2.3 Install apr -utiltar -zxvf apr-util-1.3.10.tar.gzcd apr-util-1.3.10.tar.gz ./configure --prefix=/usr/ local/apr-util --with-apr=/usr/local/apr make && make install2.4 install pcretar -zxvf pcre-8.10.tar.gzcd pcre-8.10./configure --prefix=/usr/local/pcremake && make install2.5 Install 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 install2.6 Configuration file description/usr/local/apache/conf/httpd.confDocumentRoot "/usr/local/apache/htdocs"Modification This item can configure the project running directory. Startup file/usr/local/apache/bin/apachectlChapter 3 Php building instructions3.1 Install libmcrypttar xvf libmcrypt-2.5.8.tar.gz ./configuremake && make install3.2 Install mhashtar make && make install
3.3 Install 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/
Chapter 4 Modify configuration and test
4.1 Modify apache configuration file to support php
Modify DirectoryIndex index.html to DirectoryIndex index.html index.php
and add AddType application/x-httpd-php .php
4.2 Test php support
Create the test php page test.php and store it in the main directory of the website,
phpinfo();
?>
After restarting the apache service, visit http://ip/test.php
If you see the site, it means that the php construction is completed; The original address is:
http: //blog.csdn.net/yincg/article/details/8782364
The above introduces the detailed explanation of installing apache+php under Linux, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.