search

php does not execute

Oct 18, 2019 am 09:19 AM
php

php does not execute

php does not execute?

php may not be executed because Apache is not configured. How to configure apache to support php running:

1. In the installation directory of apache, there is an htdocs directory. Now, we In this directory, create a simple php web page file.

php does not execute

2. We "browse" the php web page file in the browser, and the content of the php file is displayed, but php is not running.

php does not execute

#3. Apache needs to be configured to call the "php language module (engine)" to execute the php code. Apache's main configuration file httpd.conf is required, and its location is: apache installation directory/conf/httpd.conf.

php does not execute

4. Find the location of "Load Module": and add this line at the last position of this series of LoadModules: "LoadModule actions_module modules/mod_actions.so ", Among the module files in the php5 language package, the php5 language module name is a fixed name, which is: php5_module. The php5 language package is actually the folder of the php language package.

php does not execute

5. At the end of the apache configuration file, write: LoadModul php5_module "H:/amp/php/php5apache2_2.dll".

php does not execute

6. Start a new line to set the file with php suffix, which will be executed by this php language module. "AddType application/x-httpd-php .php"

php does not execute

7. Restart Apache and run the php program you just wrote. It shows that Php can be run.

php does not execute

Supplement: In the apache configuration file, set all webpage files with the php suffix to be "processed" by the php language engine (that is, the previous step 2 ), there is another way to write:

php does not execute

Notes

apache software and php package cannot be missing.

After modifying the configuration file, you must restart Apache, otherwise the configuration will not take effect.

Pay attention to the versions of Apache and php

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of php does not execute. 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

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 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.