Why does is_dir() return false even if it is a dir?
returns no error
$path_mysql = '/var/lib/mysql/';
if(!is_dir($path_mysql)){
echo 'error';
}
returns error
$path_mysql = '/var/lib/mysql/domain.com/';
if(!is_dir($path_mysql)){
echo 'error';
}
/var/lib/mysql/domain.com/
does exsits, but is_dir() returns false!?
I can get access to the dir through both PuTTY and WinSCP
Possibly because it cannot check whether the /var/lib/mysql/domain.com/
exists or not, because it does not have enough rights to do that (permission problems).
Check the execute (list) permission of /var/lib/mysql/
directory for the user which runs this PHP script (probably it's www-data
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With