apache+php Environmental Integration

Source: Internet
Author: User

First, PHP configuration:
First enter the PHP extracted directory, find the Php.ini-development configuration file, and rename it to PHP.ini, the file is the current system PHP configuration file. Open the PHP.ini configuration file and configure it according to the prompts below.
Find the following:
; On Windows:
; Extension_dir = "ext"
Revision changed to
; On Windows:
Extension_dir = "E:/program Files (x86)/php/ext"
Note that the semicolon in front of the extension_dir needs to be removed, and the value is modified to the Ext folder path under the PHP folder, which is used to update the PHP extension path folder and all the extensions are in that folder.
Next, we need to let PHP support MySQL database, and open extensions such as Curl,gd2,xml,pdo, find the following content, the semicolon (;) before it removed.
Extension=php_curl.dll
Extension=php_gd2.dll
Extension=php_mbstring.dll
Extension=php_mysql.dll
Extension=php_mysqli.dll
Extension=php_pdo_mysql.dll
Extension=php_pdo_odbc.dll
Extension=php_xmlrpc.dll
We all know that PHP supports the session function, by default, the PHP session is saved in the file system, then we need to save the folder for the session settings.
Find the following:
; Session.save_path = "/tmp"
Revision changed to
Session.save_path = "E:/program Files (x86)/php/custom/session"
Remove the semicolon, and reset any path, to ensure that the folder exists, in order to manage the convenience, it is recommended that you set up the PHP installation path, to prevent accidentally deleted.
After completing the session setup, we also need to configure a folder path, that is, the PHP temporary file path, learning PHP students know that when uploading files through PHP, the file is first in a temporary folder.
Find the following:
; Upload_tmp_dir =
Revision changed to
Upload_tmp_dir = "E:\Program Files (x86) \php\custom\upload"
Finally, PHP will need to force the time zone after the 5.3 release, otherwise the error cannot run when running Phpinfo () and some programs.
Find the following:
;d Ata.timezone =
Revision changed to
Date.timezone = Asia/shanghai

Second, configure Apache support PHP
in the Apache configuration directory E:\Program files (x86) \apache software foundation\apache2.2\conf, locate the http.conf configuration file. Add the following on the <ifmodule!mpm_netware_module> line.
LoadModule Php5_module "E:/program files (x86)/php/php5apache2_2.dll"
Phpinidir "E:/program Files (x86)/php"
AddType application/x-httpd-php. php. html. htm
The first line of the configuration specifies the module path for PHP and Apache, which is typically located in the PHP root directory. The second line specifies the path to PHP in Win7, and the third line adds the file type, where the first and second lines need to be modified according to the PHP installation path.
Next, we need to specify the root directory of the Web server for Apache, the default, Apache root directory is the Htdocs folder under the Apache directory, in order to facilitate development, we set it in the E-disk Htdocs directory. First set up the Htdocs directory under the E-disk, and of course you can change it to any Web root you want to name, and then find the following in the configuration file.
DocumentRoot "E:/program Files (x86)/apache software Foundation/apache2.2/htdocs"
<directory "E:/Program Files (x86)/apache software Foundation/apache2.2/htdocs "
modified to
DocumentRoot" E:/htdocs "
<directory" E :/htdocs;
Finally, to modify the initial file type of the root directory, Apache defaults to using index.html as the initial file of the directory, in order for Apache to first look for PHP files, we make some changes.
Find the following
DirectoryIndex index.html
modified to
DirectoryIndex index.php index.html

Apache+php Environment Consolidation

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.