Home >Backend Development >PHP Tutorial >Apache - Integrate PHP
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/48208813
The operation of integrating PHP with Apache is very simple. You only need to modify the corresponding configuration file. Let's integrate it together.
First go to http://www.apache.org to download the apache server, and go to http://www.php.net/ to download php
After the download is completed, install apache (I will not introduce how to install it here) Apache), decompress the downloaded php (php does not need to be installed, just configure it after decompression), put the php and apache installation directories together. The details are as follows:
Open the httpd.conf file in the apache installation directory and add the following code template
LoadModule php5_module ~php安装路径/php5apache2_2.dll PHPIniDir "~php模块安装路径" AddType application/x-httpd-php .php .phtmlwhere ~php installation path represents PHP Specific installation directory
So the code I configured in apache’s httpd.conf is as follows:
#载入PHP处理模块 LoadModule php5_module D:/Program Files (x86)/Apache Software Foundation/php-5.6.13/php5apache2_4.dll #指定PHP的ini文件,该文件是对PHP的一些配置 PHPIniDir "D:/Program Files (x86)/Apache Software Foundation/php-5.6.13" #当有一个资源是*.php的时候就由php处理 AddType application/x-httpd-php .php .phtmlis as shown below:
Modify the php.ini-development file in the php installation directory to the php.ini file
Open the php file and find the one shown below Code
Modify the code snippet in the above picture to the code snippet as shown below:
Create a new test.php file and write the following code in the file:
<?php phpinfo(); ?>Enter http://localhost/test.php in the browser and the test is successful
Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above has introduced Apache - integrating PHP, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.