I keep getting permission denied when using mkdir() in my PHP script.
mkdir: cannot create directory : Permission denied:
$mount = shell_exec( "mkdir -p {$mntdir}/{$hostname} 2>&1");
I try to write to folder
/home/user/mnt
When I type below in the command line it does work, so which permissions am I missing?
php -r "shell_exec('mkdir -p /home/user/mnt/test');"
RHEL7/ PHP Version 5.4.16
Any help would be much appreciated!