Can require_once be used with symbolic links?

In the CentOS LAMP field, trying to get require_once to work inside a script in PHP5. If the file to be included is not a symbolic directory, it works fine, but if the required file is in the directory found through the symbolic link, it does not find it.

Is this a limitation of require_once and symbolic links?

EDIT - Thanks for the input, that’s it. I think this is most likely a permissive thing after reading these

+4
source share
3 answers

As far as I know, require_once can make good use of symbolic links. I use include_once with some symbolic links in the installation of WordPress MU, and it works just fine - I can’t imagine why require_once will work differently than include_once in this regard.

Do you have a chance to install open_basedir ?

+3
source

Can't you do something like the following?

if (is_link($path)) { $path = readlink($path); } require_once($path); 
+2
source

As far as I know, no. Are the permissions the same as if you are not using a sym link?

+1
source

Source: https://habr.com/ru/post/1277683/


All Articles