Build an apache + php Environment

Source: Internet
Author: User
Apr download link: apr. apache. orgdownload. cgi. configure -- prefixusrlocalapr; make; makeinstall; apr-util download link: recovery. configure -- prefixusrlocalapr-util -- with-

Http://apr.apache.org/download.cgi. /configure -- prefix =/usr/local/apr/; make install; apr-util download link: http://download.chinaunix.net/download/0001000/472.shtml. /configure -- prefix =/usr/local/apr-util/-- with-

Apr download link: http://apr.apache.org/download.cgi

./Configure -- prefix =/usr/local/apr /;

Make;
Make install;

Apr-util download link: http://download.chinaunix.net/download/0001000/472.shtml

./Configure -- prefix =/usr/local/apr-util/-- with-apr =/usr/local/apr;
Make;
Make install;
Pcre download link: http://sourceforge.net/projects/pcre/files/pcre/
./Configure -- prefix =/usr/local/pcre/
; Make;
Make install;

Apachehttp: // httpd.apache.org/

. /Configure -- prefix =/usr/local/www/apache2/-- with-apr =/usr/local/apr/-- with-apr-util =/usr/local/apr- util/-- with-pcre =/usr/local/pcre/
Make
Make install

Test apache server

Modify httpd. conf.
Change # ServerName www.example.com: 80 to ServerName 127.0.0.1: 80 (localhost: 80)

Cd/usr/local/www/apache2/
./Bin/apachectl-k start
./Bin/apachectl-k stop
./Bin/apachectl-k restart

Libxml2-2.7.4.tar.gz download link: http://download.chinaunix.net/download.php? Id = 28497 & ResourceID = 6095

./Configure -- prefix =/usr/local/

Make

Make install

Php: http://php.net/get/php-5.5.19.tar.gz/from/a/mirror
./Configure -- prefix =/usr/local/php/-- enable-mbstring -- with-apxs2 =/usr/local/www/apache2/bin/apxs
Make
Make install

Because the php Directory $ php/lib after installation does not have a php configuration file, you need to copy the php. ini-recommended directory under the decompressed directory to the php lib directory.
Sudo cp php. ini-recommended/home/guandl/webenv/php528/lib/php. ini

8. modify the configuration file httpd. conf of apache.
Add content
LoadModule php5_module modules/libphp5.so is automatically generated when you install php.
AddType application/x-httpd-php. php



Linux php environment Configuration:
Export PATH = $ PATH:/usr/local/php/bin/
Echo $ PATH
/Usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin: /home/hdfs/java-current // bin:/home/hdfs/hadoop-current/bin:/opt/app/hive-0.7.1-cdh3u5/bin: /home/dcplatform/mfs/sbin:/home/dcplatform/mfs/bin:/root/bin:/usr/local/php/bin/

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.