• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

PHP scripts not running even as root

mrk

New Pleskian
Hi guys I tried to setup a cronjob to run a php script.
something simple like this:

php /var/www/vhosts/onlinehome-server.info/mydomain.co.uk/script.php

didn't worked. So I used the terminal as root and I noticed that php is not running script not even as root.

not even commands like php -v works.
I don't get any error back.

any help?

plesk version 12.0

thanks
 
Yes at first I just click on scheduled tasks. Then I realise I can go to server --> scheduled tasks and there I can choose the user. Issue solved wasn't related to the cronjob. Time was different on virtuozzo plesk and my CRM.
 
I'm doing it this way:

- First change the shell for cronjobs:

/usr/local/psa/bin/server_pref -u -crontab-secure-shell "/bin/sh"

- Then setup the cronjob in the panel, respecting the php-settings of the customer (customer panel view)

%php_binary% -c %path_to_customer_php.ini% %path_to_php_file%

E.g. (using php 5.5 provided by plesk)

/opt/plesk/php/5.5/bin/php -c /var/www/vhosts/system/example.com/etc/php.ini /var/www/vhosts/example.com/httpdocs/cron.php

Please keep in mind that if you change the php-version for that customer you have to alter the settings for the cronjob to use the right php version.
 
thanks Oliver
I'm doing it this way:

- First change the shell for cronjobs:

/usr/local/psa/bin/server_pref -u -crontab-secure-shell "/bin/sh"

- Then setup the cronjob in the panel, respecting the php-settings of the customer (customer panel view)

%php_binary% -c %path_to_customer_php.ini% %path_to_php_file%

E.g. (using php 5.5 provided by plesk)

/opt/plesk/php/5.5/bin/php -c /var/www/vhosts/system/example.com/etc/php.ini /var/www/vhosts/example.com/httpdocs/cron.php

Please keep in mind that if you change the php-version for that customer you have to alter the settings for the cronjob to use the right php version.
 
Back
Top