Configure apache to support php to Include self in the apache main configuration file httpd. conf

Source: Internet
Author: User
In the apache main configuration file confhttp. conf Add the following encoded: workspace_phpapache-php.conf # file path can be arbitrary under the D: workspace_php file to create a apache-php.conf file its specific content is # PHP-Modulesetup # LoadFileD: xamppphpphp5ts. dllLoadModulephp5_m

In the apache main configuration file/conf/http. conf add Include D: \ workspace_php \ apache-php.conf # file path can be arbitrary in D: \ workspace_php file to create a apache-php.conf file its specific content is # PHP-Module setup # LoadFile D:/xampp/php/php5ts. dllLoadModule php5_m

In the apache main configuration file/conf/http. conf

Add at the bottom

Include "D: \ workspace_php \ apache-php.conf"

# The file path can be any

Create under the D: \ workspace_php File

Apache-php.conf files

Its specific content is

## PHP-Module setup#LoadFile "D:/xampp/php/php5ts.dll"LoadModule php5_module "D:/xampp/php/php5apache2_2.dll"
 
      SetHandler application/x-httpd-php
 
 
      SetHandler application/x-httpd-php-source
 ## PHP-CGI setup##
 
  #    SetHandler application/x-httpd-php-cgi#
 #
 
  #    Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"#
 
 
      PHPINIDir "D:/xampp/php"
 
 
      AddType text/html .php .phps
 ScriptAlias /php-cgi/ "D:/xampp/php/"
 
      AllowOverride None    Options None    Require all denied    
  
             Require all granted    
  
 
     
  
           SetHandler cgi-script    
      
  
           SetHandler None    
  
 

Modify the directory where php is located based on your own situation.

You may have noticed that I am using php under xampp.

This article also draws on the xampp configuration idea, that is, in the apache main configuration file, use the Include command to add custom configuration files,

Minimize the modification to the main configuration file to make the configuration process more modular.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.