I am using PHP's realpath()
function, and want to know why I get the following output:
bool(false)
string(48) "/var/www/vhosts/website.co.uk/httpdocs"
bool(false)
string(48) "/var/www/vhosts/website.co.uk/httpdocs"
when running this script:
<?php
error_reporting(-1);
header('content-type: text/plain');
var_dump(realpath('/var/www/vhosts/website.co.uk/application'));
var_dump(realpath('/var/www/vhosts/website.co.uk/httpdocs'));
var_dump(realpath(dirname(__FILE__) . '/../application'));
var_dump(realpath(dirname(__FILE__) . '/../httpdocs'));
exit;
with these file permissions:
drwxr-x--- 5 username psaserv 4096 Jul 16 08:22 application
drwxr-x--- 10 username psaserv 4096 Jul 16 13:34 httpdocs
Note:
- This is a Plesk system
- Script runs as
apache
user apache
user is part of thepsaserv
group