• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

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