-->

PHP: allow_url_include

2020-07-05 07:35发布

问题:

Quick...possibly stupid question.

When allow_url_include is set to off, does that prohibit other computers from remotely including the files on my site, or does it say that I'm not allowed to remotely include files from other sites?

回答1:

Settings in your php.ini only affect your PHP installation



回答2:

Setting allow_url_include to off in your configuration means that your PHP code on your server will not be able to include remote files.

But it doesn't change anything for other servers, which might request files from your server, like anyone can from the web -- note, though, that if some PHP file is requested, it'll be interpreted, and its output (not its content ! ) will be sent.



回答3:

As said in the php manual: http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-include is for including remote files, only if you let your directory to reach the source, others can include your php files.

Then is the second suggestion



回答4:

It's always impossible to include PHP code from properly installed server, no matter of this configuration setting.

At the same time no PHP configuration setting can forbid HTTP clients from requesting resources from your HTTP server.



标签: php security