Jump to content

Include symbolic link results in error


webinfo123

Recommended Posts

I upgraded PHP today and noticed some new behaviour.

 

In the past I used include($_SERVER['DOCUMENT_ROOT'] ."/../phplib/config.inc.php"); to include some files. This worked fine, even if the $_SERVER['DOCUMENT_ROOT'] was a symlink. This way I could create different subdomains each in it's own directory. I could include the same config-file for each subdomain. I upgraded from php 5.2.11 to 5.3.2 and suddenly this is not working anymore.

 

When $_SERVER['DOCUMENT_ROOT'] is a symbolic link, the error "Unable to access /home/homedir/site_v3.0/subdomain/../phplib/functions.inc.php in ..." appears. The file "/home/homedir/site_v3.0/subdomain/../phplib/functions.inc.php" does exists and is accessible from the command line. When subdomain is not a symbolic link, there is no php error.

 

I searched the net, but I cannot find a solution to include a file over a symbolic link. Is there a solution is missed?

Link to comment
https://forums.phpfreaks.com/topic/197927-include-symbolic-link-results-in-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.