• 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

Sudoing several Plesk command line utilities from PHP fails

ESKIS

New Pleskian
Hi,

I'm 'sudoing' Plesk command line utilities (those in /usr/local/psa/bin/) like 'customer' or 'site' from PHP, via the exec() function.

Ex : "sudo /usr/local/psa/bin/site --create ecz-1.toto.com -webspace-name ecz-clt-001.toto.com -www false -www-root toto.com -php true -notify false"

Of course, I've customized the sudoers to avoid password prompting. Testing on the command line is OK.

Running such a command from PHP works fine.

But if within the same script I fire a second exec() of the same kind (for exemple to add anoter domain), the PHP script seems to be interrupted when the second Plesk command returns.

Note that the Plesk commands executes, because the second domain is created, but tracing shows that PHP stops somewhere in the exec().

Any idea of what is happening ?

Thanks,
 
Back
Top