Install apache and php_PHP in linux

Source: Internet
Author: User
Install apache and php in linux. 1. on the following page, download the source code package www of forLinux from apache (the most popular WEB server platform on Unix. apache (the highest stream of Unix platform 1. apache (the most popular WEB server platform on Unix)
Download the source code package of apache (the most popular WEB server platform on Unix) for Linux on the following page.
Http://www.apache (the most popular WEB server platform for Unix). org/dist/httpd /;
Save to the/home/xx Directory. xx is a self-built folder. I created a wj folder.

Command list:
Cd/home/wj
Tar-zxvf httpd-2.0.54.tar.gz
Mv httpd-2.0.54 apache (the most popular WEB server platform for Unix)
Cd apache (the most popular WEB server platform on Unix)
./Configure -- prefix =/usr/local/apache (the most popular WEB server platform on Unix) 2 -- enable-module = so
Make
Make install
Install apache (the most popular WEB server platform on the Unix platform) to/usr/local/apache (the most popular WEB server platform on the Unix platform) and configure apache (the most popular WEB server platform on the Unix platform) to support dso.
2. php (as the mainstream development language)
Download the source code package of php (as the mainstream development language) for Linux on the following page
Http://www.php (as the mainstream development language). net/downloads. php (as the mainstream development language );
Save to/home/wj Directory
Command list:
Cd/home/wj
Tar-zxvf PHP (the current development language runtime -5.0.4.tar.gz)
Mv php (as the mainstream development language)-5.0.4 php (as the mainstream development language)
Cd php (as the mainstream development language)
. /Configure -- prefix =/usr/local/php (as the current mainstream development language) 5 -- with-apxs2 =/usr/local/apache (the most popular WEB server platform for Unix) 2/bin/apxs -- with-config-file-path =/usr/local/lib -- enable-track-vars -- with-xml (standardization is getting closer and closer) -- with-MySQL (the best combination with PHP)
Make
Make install
Among them, apache (the most popular WEB server platform on Unix) and MySQL (the best combination with PHP) are changed based on the directory name you have installed, my options are =/usr/local/apache (the most popular WEB server platform on Unix) 2/bin/apxs and MySQL (the best combination with PHP)
Cp php (as the mainstream development language). ini-dist/usr/local/lib/php (as the mainstream development language). ini
Install php in dso mode (as the mainstream development language) to/usr/local/php (as the mainstream development language) set the configuration file directory to/usr/local/lib to enable MySQL (the best combination with PHP), and xml (the standardization is getting closer and closer ).
3. configuration
Vi/usr/local/apache (the most popular WEB server platform on the Unix platform)/conf/httpd. conf
Configure apache (the most popular WEB server platform on Unix) as follows:
# Change the ServerAdmin mailto: linux@linuxidc.com line to your mailbox address

# DocumentRoot "/home/httpd/html/" is the main directory of the html file.
# Same as above
# Options FollowSymLinks MultiViews for security reasons, remove "Indexes"
#
# DirectoryIndex default. php (as the mainstream development language) default. phtml default. php (as the mainstream development language) 3 default.html default.htm
#
# Set the default file name order for apache (the most popular WEB server platform on Unix)
# AddType application/x-httpd-php (as the mainstream development language ). php (as the mainstream development language ). phtml. php (as the mainstream development language) 3. inc
# AddType application/x-httpd-php (as the mainstream development language)-source. php (as the mainstream development language) s
# Set the file suffix of php (as the mainstream development language)
Save disk and exit
Vi/usr/local/lib/php (as the mainstream development language). ini
# Register-golbals = On
Save disk and exit
4. start the service
/Usr/local/apache (the most popular WEB server platform on the Unix platform)/bin/apache (the most popular WEB server platform on the Unix platform) ctl start
  
5. test
Then write a php (as the current mainstream development language) test page info. php (as the current mainstream development language): The content is as follows:
<〈? Php (as the mainstream development language)
Php (as the mainstream development language) info ();
?>
Normally, you should be able to see the php (as the current mainstream development language) information. Congratulations! Apche + MySQL (the best combination with PHP) + php (as the mainstream development language) is successfully installed.
6. apache (the most popular WEB server platform on Unix) is automatically started --
The following uses self-starting apache (the most popular WEB server platform on the Unix platform) as an example;
Self-starting script:
/Usr/local/apache (the most popular WEB server platform on the Unix platform)/bin/apache (the most popular WEB server platform on the Unix platform) ctl start
The file is located under/etc/rc. d/init. d and named apache (the most popular WEB server platform on Unix) d. it must be executable.
# Chmod + x/etc/rc. d/init. d/apache (the most popular WEB server platform on the Unix platform) d // Set the properties of the file to executable
# Ln-s/etc/rc. d/init. d/apache (the most popular WEB server platform on the Unix platform) d/etc/rc3.d/S90apache (the most popular WEB server platform on the Unix platform) // establish soft connections and shortcuts
# Ln-s/etc/rc. d/init. d/apache (the most popular WEB server platform on Unix) d/etc/rc0.d/K20apache (the most popular WEB server platform on Unix)

Http://www.bkjia.com/PHPjc/508555.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/508555.htmlTechArticle1.apache (the most popular WEB server platform for Unix) download apache on the following page (the most popular WEB server platform for Unix) for Linux source package http://www.apache (Unix platform the most flow...

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.