Home > Backend Development > PHP Tutorial > Detailed explanation of installing apache+php under linux

Detailed explanation of installing apache+php under linux

WBOY
Release: 2016-07-29 09:03:11
Original
959 people have browsed it
Chapter 1 Environment Description
1.1 System Description
Centos 6.4
1.2 Software Description
httpd-2.4.2.tar.gz http://pan.baidu.com/s/1hr2mtpE
apr-util-1.4.1.tar.gz http://pan.baidu.com/s/1bol16Mj
apr-1.4.6.tar.gz http://pan.baidu.com/s/1sjX1LBB
pcre-8.13.tar.gz
php-5.4.3.tar.bz2 http://pan.baidu.com/s/1hr2mtpE

libmcrypt-2.5.8.tar.gz http: //pan.baidu.com/s/1sjX1LBB

mhash-0.9.9.9.tar.gz
Chapter 2 Apache Building Instructions
2.1 Install dependency 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 Install 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 Install 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 install pcre
tar -zxvf pcre-8.10.tar.gz
cd pcre-8.10
./configure --prefix=/usr/local/pcre
make && make install
2.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 install
2.6 Configuration file description
/usr/local/apache/conf/httpd.conf
DocumentRoot "/usr/local/apache/htdocs"
Modification This item can configure the project running directory.
Startup file
/usr/local/apache/bin/apachectl
Chapter 3 Php building instructions
3.1 Install libmcrypt
tar xvf libmcrypt-2.5.8.tar.gz
./configure
make && make install
3.2 Install mhash
tar
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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template