• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

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