15

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
  • 1
    This option is deprecated as of PHP 7.4, and it is likely to be removed in the near future. Commented Mar 6, 2021 at 12:20

4 Answers 4

11

Settings in your php.ini only affect your PHP installation

Sign up to request clarification or add additional context in comments.

Comments

6

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

1 Comment

^^ AGREED ^^ add one more
5

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.

2 Comments

So, let's say my file is a.php and code is echo $file; Does that mean that if a file b.php on a remote server includes a.php they cannot set $file before calling my file? I would assume this to be correct if only the output if returned.
if register_globals is not enabled (it should not be), then, no, the remote server cannot inject a value into $file.
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.