Plesk command working in manual script, not in cronjob

Posted by dsaunier on Server Fault See other posts from Server Fault or by dsaunier
Published on 2010-05-05T14:24:01Z Indexed on 2010/05/05 14:29 UTC
Read the original article Hit count: 159

Filed under:
|
|
|

Hi,

In order to install a hosting plan, I use Plesk's commands in SSH as specified in their official guide. When typed directly in SSH (Putty), it works perfectly. The line is as follows with obviously values hard coded when in CLI:

/usr/local/psa/bin/domain --create '.$url.' -owner mynamehere -ip '.IP_SERVER_PLESK.' -status enabled -hosting true -hst_type phys -login '.$ftp_user.' -passwd '.$ftp_pw.' -www false -php true -php_safe_mode false -hard_quota 100M

I then put that request in a php script that does other things after hosting is installed. Now for the weird part: when calling that script from CLI it also works fine, I do a ./myscript.php and it installs the hosting, then sends emails etc. However after I create a cronjob to have that same script called regularly, then the Plesk command fails. The cronjob is started in Plesk as

*/15 * * * * /usr/bin/php /home/scripts/myscript.php

and it works fine for everything BUT the Plesk hosting install, that returns

"Unable to read Control Panel configuration file" and therefore does not install the domain hosting. Still this is the same script that I call manually ! On that server are the PHP used to call a cronjob and the one used in CLI different ? What do I miss, help greatly appreciated !

Regards.

© Server Fault or respective owner

Related posts about plesk

Related posts about php