PHP bit by bit drop ____php

Source: Internet
Author: User
Tags php language phpinfo

The environment for this article is linux+php+apache+mysql.


profile/Startup command

PHP's configuration file is:/etc/php.ini.

The Apache configuration file is:/etc/httpd/conf/httpd.conf

The MySQL configuration file is:/etc/my.cnf.


you need to reboot the Apache server after modifying the configuration.

The restart command is: Service httpd restart




add a suffix type that resolves to php

There is a need, that is, such as the suffix named *.php3 *.phtml file, or even *.aaa file resolution to PHP, then need to change the Apache configuration file/etc/httpd/conf/httpd.conf.


Join AddType application/x-httpd-php AAA.

In this way, a *.aaa file can also be parsed into the PHP language.

For example, there is a a.aaa file, as follows:

Source content is:

<?php
phpinfo ();
? >



PHP require contains remote files

Existing a.php and b.php two files, a.php and b.php are all placed in the same directory in one URL.

The contents of the a.php file are:

<?php
phpinfo ();
? >


The contents of the b.php file are:

<?php
require "http://www.***.com/a.php";
? >

If the Include remote file option is not turned on, the b.php will not execute properly, and b.php will not execute until the remote include file option is turned on.

and http://must add, not plus also not.

The remote include file option is configured in PHP.ini and the Allow_url_include is set to ON.





The php suffix can be added to any unknown type (*.php.dfsdfew)

This is a small problem with Apache, the *.php file followed by an arbitrary unknown type suffix, Apache will be interpreted as PHP.



PHP Debugging

The Var_dump function can print more information.

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.