82. Configure Apache and PHP

Source: Internet
Author: User

Combined with Apache and Php5apache versions

httpd-2.4.29

Version of PHP

php-5.6.30

The configuration file directory for Ps:apache is:/usr/local/apache2.4/conf/httpd.conf

One: Modify the Apache configuration file
 <Directory />    AllowOverride none    Require all denied</Directory>修改为:<Directory />    AllowOverride none    Require all granted</Directory>PS:允许所有请求,否则我们访问时回报403错误。找到下面这行:AddType application/x-gzip .gz .tgz在这行下面添加以一行:AddType application/x-httpd-php .php找到这一段:<IfModule dir_module>    DirectoryIndex index.html</IfModule>修改为:<IfModule dir_module>    DirectoryIndex index.html index.php</IfModule>保存并退出。
Second, the test lamp is successful

1, test httpd configuration file is correct

[Email protected]/]#/usr/local/apache2.4/bin/apachectl-t
Syntax OK
The correct display is "Syntax OK", otherwise continue checking to modify the httpd configuration file.
Start httpd:

[[email protected]/]#/usr/local/apache2/bin/apachectl start
[Email protected]/]# NETSTAT-LNP | grep httpd
TCP6 0 0::: $:::* LISTEN 5553/httpd

82. Configure Apache and PHP

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.