Hello,
sorry for the maybe dumb question but I'm new to centos 6.
I had a linux vps and an app that uses simple php command:
exec('/etc/init.d/httpd reload');
It worked fine on the vps but now moved to centos 6 and it wont work.
I-ve checked and selinux is disabled, so I'm clueless.
I;ve added
apache ALL=(ALL:ALL) NOPASSWD: ALL
to /etc/sudoers
I know the above may seem something horrible to most of you but I really want apache user to be able to reload httpd.
Any help greatly appreciated.
reload apache from a php script
Re: reload apache from a php script
I just was able to fix this.
Actually php exec('whoami') was working but the httpd command was not. So after allowing apache to run commands with visudo and then ##Defaults requiretty (commenting out this line) and creating a sh script that only reload 'graceful' httpd it worked finally.
thanks anyway,
Actually php exec('whoami') was working but the httpd command was not. So after allowing apache to run commands with visudo and then ##Defaults requiretty (commenting out this line) and creating a sh script that only reload 'graceful' httpd it worked finally.
thanks anyway,