One-time integration of apache + php !! (Original) for beginners

Source: Internet
Author: User
One-time integration of apache + php !! (Original) for beginners-Linux Enterprise Application-Linux server application information, the following is a detailed description. One-time integration of apache + php !! (Original) for beginners
Experience: Everything starts from the basics. If you can successfully configure apache + php, it is not difficult to configure (apache + mysql + php) on this basis ~~. In the configuration process, the most important thing is to learn how to configure, especially how to check whether the configuration and compilation are correct! Be patient during the configuration process and check whether the configuration is successful after each compilation step. Although this is troublesome, make sure that the configuration is successful once! As long as each step is detected, the configuration is successful!

Software Package:
Httpd-2.0.55.tar.gz
Php-4.4.4.tar.gz
Install apache first
1. tar-zxvf httpd-2.0.55.tar.gz
2. cd httpd-2.0.55
3../configure -- prefix =/usr/local/apche2 -- enable-modules = so -- enable-so
4. make
5. make install
Understanding: -- prefix =/usr/local/apche2 (specify the directory for installing apache)
-- Enable-modules is used to specify the type of function extension modules allowed by the system. Here, it is specified as the so type.
-- Enabel-so is used to specify that DSO (Dynamic Share Object Dynamic sharing Object) is allowed)
Important: httpd? L command to check whether the mod_so.c module is loaded. If not, it proves that DSO has not been compiled correctly!



Install php again
1. tar-zxvf php-4.4.4.tar.gz
2. cd php-4.4.4
(Note: For Beginners, use./configure ?? Help to understand the usage of apx2 and compile it again !)
The usage is as follows:
-- With-apxs2 [= FILE] EXPERIMENTAL: Build shared Apache 2.0 module. FILE is the optional pathname to the Apache apxs tool; ults to apxs

3 .. /configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache2/bin/apxs (install php to/usr/local/php In dso Mode)

If the following code is displayed, it indicates that the operation is almost successful.
+ -------------------------------------------------------------------- +
│ License: │
│ This software is subject to the PHP License, available in this │
│ Distribution in the file LICENSE. By continuing this installation │
│ Process, you are bound by the terms of this license agreement. │
│ If you do not agree with the terms of this license, you must abort │
│ The installation process at this point. │
+ -------------------------------------------------------------------- +

Thank you for using PHP.
4. make
5. make install
Important: Check whether the installed and compiled php has been integrated with apache as follows!
1. Find libphp4.so in usr/local/apache2/modules or find LoadModule php4_module modules/libphp4.so in vi http. conf. If no, it indicates that php compilation has been successful!

(2) Integration of php and apache
1. Set the PHP configuration file php. ini
Cp php4.4.4/php. ini. dist/usr/local/php/lib/php. ini
Note: There is a php. ini file in the compressed package. Copy it to/usr/local/lib/php. ini.
Open the file and change register_globals to register_globals = On.
2. Set the apache configuration file
Vi/usr/local/apache2/conf/httpd. conf find DirectoryIndex as follows: DirectoryIndex index.html index.htm index.html. var index. php (Note that there should be spaces)
Find
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
Add:
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps



Important:
Test php: Create a new file index. php under/usr/local/apache2/htdocs.
Add
Start apache, open the browser, and enter
Http: // 192.168.188.188/index. php (your host IP address)
You can see information about php to prove that php is successfully installed !!


Heven)
2006.12.7
Related Article

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.