Test PHP parsing

Source: Internet
Author: User

Apache with PHP


The Apache master configuration file is:/usr/local/apache2/conf/httpd.conf


Vim/usr/local/apache2/conf/httpd.conf

Found it:


AddType application/x-gzip. gz. tgz

Under this line, add the following:


AddType application/x-httpd-php. php

Found it:


<ifmodule dir_module>

DirectoryIndex index.html

</IfModule>

Change the line to read:


<ifmodule dir_module>

DirectoryIndex index.html index.htm index.php

</IfModule>

Found it:


#ServerName www.example.com:80

Modified to:


ServerName localhost:80

Test if lamp is successful


Verify that the configuration file is correct before starting Apache:


/usr/local/apache2/bin/apachectl-t

If there is an error, please continue to modify httpd.conf, if it is correct is displayed as "Syntax OK", the command to start Apache:


/usr/local/apache2/bin/apachectl start

To see if it starts:


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

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

If this line is displayed, it is started. You can also use the Curl command to simply test:


[[email protected] ~]# curl localhost

This is only true if it is displayed.


Test if PHP is parsed correctly:


vim/usr/local/apache2/htdocs/1.php

Write:


<?php

echo "PHP parsing normal";

?>

After saving, continue testing:


Curl localhost/1.php

See if you can see the following information:


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

PHP parsing normal [[email protected] ~]#

Only shown as Amin is correct.


You may not be able to access the Web service when you first use it for your browser, because of the firewall. Please run the following command:


[Email protected] ~]# iptables-f

This allows the system to clear the default firewall rules and release port 80.


This article is from the "Wings of Light" blog, please be sure to keep this source http://vanjle.blog.51cto.com/9794584/1871531

Test PHP parsing

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.