Is this possible to change Linux server date using php code?
Is there any way to give necessary permissions to Apache to do this?
What is the procedure to give root permissions to Apache?
date
Is this possible to change Linux server date using php code?
Is there any way to give necessary permissions to Apache to do this?
What is the procedure to give root permissions to Apache?
Best Answer
You can do that with sudo, without giving "root" permissions to apache.
Which in English translates roughly to:
Using sudo, (or doing the equivalent in any RBAC model) allows you to expose only the privileges you need to, to specific users, to accomplish your goals.
Then in PHP, just pass the sudo in along with the command:
Also, if that's not working for you, check your
/etc/sudoers
file forrequiretty
:You'll need to comment that out, for sudo to work with apache.