Apache and PHP combined test

Source: Internet
Author: User

the combination of Apache and php :

[Email protected] ~]# vim/usr/local/apache2/conf/httpd.conf

Usr/local/apache2/conf/httpd.conf is the Apache configuration file

Locate AddType application/x-gzip. gz. tgz Add the following:

AddType application/x-httpd-php. php

Found it:

<ifmodule dir_module>

DirectoryIndex index.html

</IfModule>

Modified to:

<ifmodule dir_module>

DirectoryIndex index.html index.htm index.php

</IfModule>

Found it:

#ServerName www.example.com:80

Modified to:

ServerName localhost:80

:Wq

Detects if Apache configuration file is correct and displays correctly Syntax OK

[Email protected] ~]#/usr/local/apache2/bin/apachectl-t

Syntax OK

Launch Apache

[[email protected] ~]#/usr/local/apache2/bin/apachectl start

To see if Apache starts:

[Email protected] ~]# NETSTAT-LNP |grep httpd

TCP 0 0::: +:::* LISTEN 11660/httpd

The above indicates that Apache has been started.

Test whether PHP can parse properly:

[Email protected] ~]# vim/usr/local/apache2/htdocs/1.php

<?php

echo "PHP parsing normal ";

?>

:Wq

[Email protected] ~]# Curl localhost/1.php

PHP parsing normal [[email protected] ~]#

Enter IPin the browserand cannot display it works.

Need to close selinux,iptables-f Clear the fence rules.


Apache and PHP combined test

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.