Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of parsing php by apache

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the method of apache parsing php, I hope you will learn a lot after reading this article, let's discuss it together!

Detailed configuration of Apache server supports parsing of PHP files

[description]

1. In this example, the Apache version is httpd-2.4.20-x64-vc14 and the installation path is E:\ Apache24

2. The PHP version is php-5.5.34-Win32-VC11-x64, and the installation path is E:\ php-5.5.34

[download]

Log in to http://php.NET/downloads.php to download PHP, because I want to integrate it with Apache, so I download the Thread Safe version here

[installation]

1. Extract the downloaded file. In this example, I unzipped the package to the root directory of disk E.

[configuration]

1. Open the E:\ Apache24\ conf\ httpd.conf file with a text editor, locate # LoadModule vhost_alias_module modules/mod_vhost_alias.so, and add the following configuration on the next line:

# load php LoadModule php5_module "E:/php-5.5.34/php5apache2_4.dll" in module # indicate the location of the php configuration file php.ini PHPIniDir "E:/php-5.5.34"

two。 Locate AddType application/x-gzip .gz .tgz and add the following configuration on its next line:

# define the file types that can execute php, that is, .php and .html files can execute the PHP program AddType Application/x-httpd-php .php .html

3. Rename E:\ php-5.5.34\ php.ini-development to E:\ php-5.5.34\ php.ini, and open the php.ini file with a text editor to the line extension_dir = ". /", remove the comment and replace it with extension_dir = "E:/php-5.5.34/ext"

Extension_dir = "E:/php-5.5.34/ext"

4. Restart the Apache server

[test]

1. Write the test.php file and save the file to the Apache server's website path, the contents of the file are as follows:

When you open http://localhost/test.php in a browser, when the following page appears, Apache already supports the parsing of PHP files.

After reading this article, I believe you have a certain understanding of the method of apache parsing php, want to know more about it, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report