Blog
PHP and Plesk "Access Denied" Error With Exec()
I've finally come to the end of days of torture trying to get my PHP executable to work on a Plesk-based VPS. Every call to exec would produce "Access Dendied" errors to be dumped, while the permissions seemed perfectly ok (effective permissions showed no sign of trouble). Ultimately - and this is a plesk-specific solution, although parts are relevant to any Windows Server-based PHP environment - the problem was that the C:\ drive's permissions had the "psacln" user group set to "Deny" for "Special Permissions", which was overriding any permissions set elsewhere. This was not indicated when trying to show "effective permissions" so it was hard to track down. Here is the checklist I have developed for making sure everything will go well:
1. Make sure that the Plesk IIS user as permission on the executable and its parent directory. Unlike normal IIS settings, plesk makes a new user for each internal "domain". The template is: IUSR_. Make sure that this user has "execute" permissions on the file and its parent directory. Adding IUSR_ will not work for Plesk-based systems.
2. Make sure to check the directories all the way up your directory tree to see if their permissions are overriding your permissions lower down. This is what got me. Right click "C:\" drive (or whatever your root drive is) and click Security and make sure that there are no "Deny" settings (under "Advanced") for your plesk IUSR or any of its groups ("psacln" was the main one on mine).
3. Make sure to check under "Start > Administrative Tools > Local Security Policy > Local Policies > User Rights Assignment" that the IUSR or its group is in the "Log on as batch job"policy.
After doing all these things - and hours upon hours of pain - I have finally managed to get this working. Thanks to Zack / Nog on the "exec" comments for the suggestion to check permissions on the root drive (but makes sure to check for your user's groups as well).
Link to this article |
Make a Comment
Tags:
PHP, Plesk, Errors






