N
next-step
Guest
Hi everyone
I need idea/approach to implement following:
php script is working under plesk's apache so it is launched under 'psaadm' user.
Goal: I need to be able to create files in domain /conf/ and domain /var/ folders.
so I need my php script runs shell commands using root access.
both commands below is not working:
exec("mkdir /var/www/vhosts/domain.com/var/newfolder");
exec("sudo -u root -p XXX mkdir /var/www/vhosts/domain.com/var/newfolder");
of course that will work if I do chmod or chown for var folder.
but what is correct approach, anybody can help me???
I need idea/approach to implement following:
php script is working under plesk's apache so it is launched under 'psaadm' user.
Goal: I need to be able to create files in domain /conf/ and domain /var/ folders.
so I need my php script runs shell commands using root access.
both commands below is not working:
exec("mkdir /var/www/vhosts/domain.com/var/newfolder");
exec("sudo -u root -p XXX mkdir /var/www/vhosts/domain.com/var/newfolder");
of course that will work if I do chmod or chown for var folder.
but what is correct approach, anybody can help me???