Linux under the installation of Apache, PHP installation process ____linux

Source: Internet
Author: User
The installation of Apache under Linux
1, into the work directory: Cd/usr/local/work
(If not the new, command: mkdir/usr/local/work)

2, in the work directory download Apache from the website and decompression:
wget http://dev.xiaonei.com/apache-mirror/httpd/httpd-2.0.63.tar.gz
Decompression: Tar zxvf httpd-2.0.63.tar.gz

3, into the httpd-2.0.63 directory: CD httpd-2.0.63

4, the establishment of makefile, and the Apache installation to the/usr/local/apache2 directory:
./CONFIGURE-PREFIX=/USR/LOCAL/APACHE2-ENABLE-MODULE=SO (There is a point before/configure.) Of

5. Start compiling: Make

6, start to install Apache to the work directory:
Make install

7, this Apache installation work is completed, you can start the system each time through the following command to start or restart the Apache service:
/usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl restart

8, open the browser, in the Address bar type "http://localhost" appears "It works!" or Apache icon of the beautiful interface, indicating the success of Apache installation.




PHP installation////


1. Get installation files: http://www.php.net/downloads.php http://cn2.php.net/distributions/php-5.5.4.tar.gz
wget http://cn2.php.net/distributions/php-5.5.4.tar.gz


Get the support files needed to install PHP: http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz
wget http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz


2. Install LIBXML2


Tar zxvf libxml2-2.9.1.tar.gz
CD libxml2-2.9.1.
./configure--PREFIX=/USR/LOCAL/LIBXML2
Make
Make install




If the installation is successful, the bin, include, Lib, man, and share five directories will be generated under the/usr/local/libxml2/directory. When you install the PHP5 source package configuration Later, you specify where to install LIBXML2 library files by adding the "--with-libxml-dir=/usr/local/libxml2" option to the Configure command.






3. Install PHP5




#tar ZVXF php-5.5.4.tar.gz
#cd php-5.5.4
#./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-libxml-dir=/usr/local/ Libxml2
#make
#make Install


4. Reconfigure apache2 let him support PHP


Configure HTTPD.CONF to have Apache support PHP:
# vi/usr/local/apache2/conf/httpd.conf


Find AddType application/x-gzip gz. tgz to add the following content below


AddType application/x-httpd-php. PHP (. Preceded by a space)


AddType application/x-httpd-php-source. Phps (. Preceded by a space)


Then cpopy the PHP configuration file
CP Php-5.5.4/php.ini.dist/usr/local/php/lib/php.ini


(If there is no php.ini.dist, rename any one of the php.ini-development php.ini-production to Php.ini.dist.) )


Modify php.ini file Add register_globals = On


Restart Apache
Service Apache Restart


5. Test whether PHP is installed successfully


Write a PHP test page info.php and put it into the apache2/htdocs.


<?php


Phpinfo ();


?>;


Enter in Browser: server address/info.php


If you can display PHP information correctly, the apche+mysql+php installation is successful.






Error compiling Apache today://////////////////////////////////


#./configure--prefix ... When you check the editing environment:


Checking for APR ... no
Configure:error:APR not found. Please read the documentation


Solution:


1. Download the required packages:


wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
wget Http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
2. Compile and install:


Yum Remove apr-util-devel Apr apr-util-mysql apr-docs apr-devel apr-util Apr-util-docs
The specific steps are as follows:


A: Solve Apr not found problem >>>>>>


[Root@xt test]# tar-zxf apr-1.4.5.tar.gz
[Root@xt test]# CD apr-1.4.5
[Root@xt apr-1.4.5]#./configure--prefix=/usr/local/apr
[Root@xt apr-1.4.5]# make && make install

B: Solve apr-util not found problem >>>>


[Root@xt test]# tar-zxf apr-util-1.3.12.tar.gz
[Root@xt test]# CD apr-util-1.3.12
[Root@xt apr-util-1.3.12]#./configure--prefix=/usr/local/apr-util-with-apr=/usr/local/apr/bin/apr-1-config
[Root@xt apr-util-1.3.12]# make && make install


C: Solve pcre problem >>>>>>>>>


[ROOT@XT Test] #unzip-o pcre-8.10.zip
[ROOT@XT Test] #cd pcre-8.10
[Root@xt pcre-8.10]#./configure--prefix=/usr/local/pcre
[Root@xt pcre-8.10] #make && make install
4. When you finally compile Apache, add:


--WITH-APR=/USR/LOCAL/APR--with-apr-util=/usr/local/apr-util/--with-pcre=/usr/local/pcre

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.