• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

PHP exec() function doesn't work

S

seigo

Guest
Hi,

I setuped Plesk 7.5 om Windows 2003 Server.
but PHP exec() function doesn't work.
Do you know how to solve this problem?

Thanks.
 
Functions like these are disabled when safemode is on so you may need to turn safemode off on the server or for that domain. You may want to only turn it off for that domain because these kind of functions can be a security hazard so by fixing this 'problem' you can create another one if you allow everyone on the server access to these functions.
 
I think that Plesk users haven't access to c:\windows\system32\cmd.exe. You should add to psacln group read and execute permissions to cmd.exe
 
Hi guys again,

We have just switched to Plesk again and I still have problems :) A few facts:

- fafe_mode is off
- cmd.exe is copied to Plesk's PHP folder and permissions for everyone is setted

It worked for PHP version which has been installed manually for IIS as CGI and now when we installed Pleask exec function stops working. Strange.

Thanks for any additional help!
 
beside the permission to php, permission to the file you want to run with exec and directories along its path is necessary. In addition, you need to check your program runs with the internet user, by using runas command. if exec does not work for yuo, you may also try using popen/pclose
 
I tryed to set permissions for Everyone for cmd file which I call from exec() function. In this command file I call convert.exe (Imagemagick utility) to make some changes on image file. I also set permissions for Everyone to folder where convert.exe copy result image. Those steps do not help to run the process :( It's interesting but the same stuff works well in other hosting management solution.
 
anyone got a solution?
I just upgraded to Php 5.2.5. exec was working fine until then and now it's broken. I only have ISAPI being used - is CGI needed?
Any help please???
 
I've just found that, via using FileMon, when I upgraded the version of PHP on my server it not only screwed with my Plesk CP but also the permissions!!!
That was why I couldn't use the exec command from within PHP - even with CMD.exe set with permissions it was the IWPD_1 account that required permissions.
Hope this helps point someone else in right direction ;)
 
Back
Top