The solution for php not being parsed by apache: first create a new php web page file in the htdocs directory; then set the main configuration file of apache [httpd.conf], and add relevant code to the loading module; finally add a new line Just set the file with php suffix.
Solution for php not being parsed by apache:
1. In the installation directory of apache, there is a htdocs directory, now, we create a simple php web page file in this directory.
#2. "Browse" the php web page file in the browser. As a result, the content of the php file is displayed, and php is not running.
#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.
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, php5 language package.
5. At the end of the apache configuration file, write: LoadModul php5_module "H:/amp/php/php5apache2_2.dll".
#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".
##Related learning recommendations:php programming (video), apache tutorial
The above is the detailed content of What to do if php is not parsed by apache. For more information, please follow other related articles on the PHP Chinese website!