search

How apache parses php

Oct 29, 2019 pm 02:30 PM
apache

How apache parses php

Detailed explanation of configuring the Apache server to support PHP file parsing

[Description] (Recommended learning: apache Use )

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, the installation path is E:\php-5.5.34

[Download]

Log in to http://php.NET/ downloads.php Download PHP. Since I want to integrate it with Apache, I downloaded the Thread Safe version here;

[Installation]

1. Unzip and download file, in this example I will decompress the compressed package to the root directory of drive E;

[Configuration]

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

# 以 module 方式加载 php 
LoadModule php5_module "E:/php-5.5.34/php5apache2_4.dll"
# 指明 php 配置文件 php.ini 的位置 
PHPIniDir "E:/php-5.5.34"

2. Find AddType application/x-gzip .gz .tgz and add on the next line Configure as follows:

# 定义能够执行 php 的文件类型,即.php和.html的文件能执行PHP程序 
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 php.ini with a text editor file, go to the extension_dir = "./" line, 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 website path of the Apache server. The file content is as follows:

<?php 
  phpinfo(); 
?>

Open http://localhost/test.php in the browser. When the following page appears, it means that Apache has supported the parsing of PHP files;

How apache parses php

The above is the detailed content of How apache parses php. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Apache in Action: Web Servers and Web ApplicationsApache in Action: Web Servers and Web ApplicationsApr 28, 2025 am 12:21 AM

The main functions of ApacheHTTPServer include modular design, virtual host configuration and performance optimization. 1. Modular design implements functions by loading different modules, such as SSL encryption and URL rewriting. 2. Virtual host configuration allows multiple websites to be run on one server. 3. Performance optimization improves performance by adjusting parameters such as ServerLimit and KeepAlive.

Apache's Adaptability: Surviving the Evolving WebApache's Adaptability: Surviving the Evolving WebApr 27, 2025 am 12:01 AM

Apache maintains adaptability and vitality through modular design, compatibility with new technologies, and performance optimization. 1. Modular design allows custom functions such as mod_rewrite for URL rewriting. 2. Compatible with cloud computing and containerization technologies, such as running in Docker. 3. Introduce new modules such as mod_http2 to support the HTTP/2 protocol. 4. Performance optimization is performed through configuration file adjustment and cache activation.

Apache's Features: Why It Remains a Popular ChoiceApache's Features: Why It Remains a Popular ChoiceApr 26, 2025 am 12:16 AM

The reason ApacheHTTPServer remains popular is its modular architecture, virtual hosting support, and high performance and reliability. 1) The modular architecture allows for extended functions through modules, such as mod_rewrite and mod_ssl. 2) The virtual hosting function supports hosting multiple websites on one server. 3) The multi-process model ensures high performance and stability in different environments.

Using Apache: Building and Hosting WebsitesUsing Apache: Building and Hosting WebsitesApr 25, 2025 am 12:07 AM

Apache is an open source web server software that is widely used in website hosting. Installation steps: 1. Install using the command line on Ubuntu; 2. The configuration file is located in /etc/apache2/apache2.conf or /etc/httpd/conf/httpd.conf. Through module extensions, Apache supports static and dynamic content hosting, optimizes performance and security.

Apache: Is It Still Used? A Look at Web Server TrendsApache: Is It Still Used? A Look at Web Server TrendsApr 24, 2025 am 12:17 AM

Apache is still widely used, but its market share has dropped from more than 50% in 2010 to less than 30% in 2023. Its advantage lies in its stability and reliability, which is suitable for enterprise-level applications that require these characteristics; its disadvantage is that multi-process models consume a lot of resources under high concurrency, and Nginx performs better in high concurrency processing.

Apache Web Server: Core Functionality ExplainedApache Web Server: Core Functionality ExplainedApr 23, 2025 am 12:12 AM

The core features of ApacheWebServer include modular design, virtual host configuration, security settings and performance optimization. 1) Modular design enables flexible extensions by loading different modules, such as mod_rewrite for URL rewriting. 2) Virtual host configuration allows multiple websites to be run on one server. 3) Security settings provide SSL/TLS encryption and access control. 4) Performance optimization involves enabling KeepAlive, adjusting MPM configuration, and enabling cache.

Apache's Continuing Importance: Reasons for Its LongevityApache's Continuing Importance: Reasons for Its LongevityApr 22, 2025 am 12:08 AM

Reasons for Apache's continued importance include its diversity, flexibility, strong community support, widespread use and high reliability in enterprise-level applications, and continuous innovation in emerging technologies. Specifically, 1) The Apache project covers multiple fields from web servers to big data processing, providing rich solutions; 2) The global community of the Apache Software Foundation (ASF) provides continuous support and development momentum for the project; 3) Apache shows high stability and scalability in enterprise-level applications such as finance and telecommunications; 4) Apache continues to innovate in emerging technologies such as cloud computing and big data, such as breakthroughs from ApacheFlink and ApacheArrow.

Beyond the Hype: Assessing Apache's Current RoleBeyond the Hype: Assessing Apache's Current RoleApr 21, 2025 am 12:14 AM

Apache remains important in today's technology ecosystem. 1) In the fields of web services and big data processing, ApacheHTTPServer, Kafka and Hadoop are still the first choice. 2) In the future, we need to pay attention to cloud nativeization, performance optimization and ecosystem simplification to maintain competitiveness.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!