Install apache and php in linux

Source: Internet
Author: User
Tags openldap
: This article describes how to install apache + php in linux. if you are interested in the PHP Tutorial, refer to it. Chapter 2 environment description
1.1 System description
Centos 1, 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 construction instructions
2.1 install dependency packages
Yum install make openldap-devel ntp vim-enhanced 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 pam-devel openldap-devel e2fsprogs-devel krb5-devel (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"
Modify this item to configure the project running directory.
Start file
/Usr/local/apache/bin/apachectl
Chapter 2 Php construction instructions
3.1 install libmcrypt
Tar xvf libmcrypt-2.5.8.tar.gz
./Configure
Make & make install
3.2 install mhash
Tar xvf mhash-0.9.9.9.tar.gz
Cd mhash-0.9.9.9
./Configure
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 message 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 the apache configuration file to support php
Change DirectoryIndex index.html to DirectoryIndex index.html index. php.
Add AddType application/x-httpd-php. php
4.2 Test php support
Create a test. php page and store it in the home directory of the website,
Phpinfo ();
?>
After the apache service is restarted, access http: // ip/test. php

If you see the site, php is set up;

Original address: http://blog.csdn.net/yincg/article/details/8782364

The above describes how to install apache + php in linux, including related content. I hope my friends who are interested in the PHP Tutorial can help me.

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.