Aphiso Posted August 3, 2017 Report Posted August 3, 2017 I'm having a problem when trying to run the cron. I'm using Plesk Onyx. Here is the command I'm running: Quote php /var/www/vhosts/aphiso.io/httpdocs/abase/index.php cron I've tried this as well with the same results. /usr/bin/php /var/www/vhosts/aphiso.io/httpdocs/abase/index.php cron Here is the full error it's kicking back when trying to run the cron: Quote Task "/usr/bin/php /var/www/vhosts/aphiso.io/httpdocs/abase/index.php cron" completed with error in 0 seconds, output: PHP Parse error: syntax error, unexpected '[' in /var/www/vhosts/aphiso.io/httpdocs/abase/config/services.php on line 3 And here is the content of the config/service.php file: <?php return [ 'Blesta\\Core\\ServiceProviders\\MinphpBridge', 'Blesta\\Core\\ServiceProviders\\Pricing' ]; No idea what the problem is here. If someone can point me in the right direction I'd really really appreciate it. When I run the cron manually through the Blesta interface it seems to be running perfectly fine. Quote
0 Paul Posted August 3, 2017 Report Posted August 3, 2017 18 minutes ago, Aphiso said: I'm having a problem when trying to run the cron. I'm using Plesk Onyx. Here is the command I'm running: Here is the full error it's kicking back when trying to run the cron: And here is the content of the config/service.php file: <?php return [ 'Blesta\\Core\\ServiceProviders\\MinphpBridge', 'Blesta\\Core\\ServiceProviders\\Pricing' ]; No idea what the problem is here. If someone can point me in the right direction I'd really really appreciate it. When I run the cron manually through the Blesta interface it seems to be running perfectly fine. What version of PHP are you running? Blesta has a minimum requirement of PHP 5.4. Is it possible your CLI version of PHP is different than the version for your web server? Aphiso 1 Quote
0 Aphiso Posted August 3, 2017 Author Report Posted August 3, 2017 5.6.31 I've also tried running the scheduled task in plesk with the fetch url setting point to 'http://aphiso.io/abase/cron/?cron_key=J9BrFo4r' This is saying it's successful. However, when I go to the automation in my admin panel it doesn't seem that the cron has actually run. How would I check my CLI PHP version? Quote
0 Aphiso Posted August 3, 2017 Author Report Posted August 3, 2017 Just ran php -i and it's showing version 5.3.3. How do I update this? Quote
0 Paul Posted August 3, 2017 Report Posted August 3, 2017 10 minutes ago, Aphiso said: Just ran php -i and it's showing version 5.3.3. How do I update this? Do you have multi-PHP? If you have multiple versions of PHP, perhaps a newer PHP version is accessible at a different path? Then you can update your cron to use the path to the right version of PHP. Aphiso 1 Quote
0 Aphiso Posted August 3, 2017 Author Report Posted August 3, 2017 10 minutes ago, Aphiso said: Just ran php -i and it's showing version 5.3.3. How do I update this? I have a general idea on how to do it. But, I really don't want to break anything. Can you help point me in the right direction of properly upgrading the php version? Quote yum install yum-plugin-replace yum replace --enablerepo=webtatic-testing php-common --replace-with=php56w-common Thats the method I'm thinking of. Not sure how safe it is though. I'm running CentOS 6. Quote
0 Aphiso Posted August 3, 2017 Author Report Posted August 3, 2017 Just now, Paul said: Do you have multi-PHP? If you have multiple versions of PHP, perhaps a newer PHP version is accessible at a different path? Then you can update your cron to use the path to the right version of PHP. Yes, I actually have 5.3 disabled in multi-php. But I have 5.6.31 and 7.0 and 7.1 enabled. Not sure how to get the cron to run a different PHP version though. Nor, do I know how to find the path. I'm brand new to Plesk and just started running it about a week ago. Guess I'll do some Googling on this. Quote
0 Aphiso Posted August 3, 2017 Author Report Posted August 3, 2017 I am not finding anything very helpful on changing my PHP version. This is getting frustrating. @Paul what would be the correct command to use to point the cron to run a different php version? Can you give me an example so I have something to work with? Quote
0 Paul Posted August 3, 2017 Report Posted August 3, 2017 You would just change your cron job and edit the path to PHP. The standard path on most systems is /usr/bin/php. When a server has multi-PHP, the paths can vary. I'd suggest opening a ticket with Plesk or your server provider if you aren't sure what the path to PHP 7 or PHP 5.6 is. If you're web server is running PHP 7, then you'll want to use the CLI version of PHP 7 also so that it matches your ioncube files. Aphiso 1 Quote
0 Aphiso Posted August 3, 2017 Author Report Posted August 3, 2017 Just now, Paul said: You would just change your cron job and edit the path to PHP. The standard path on most systems is /usr/bin/php. When a server has multi-PHP, the paths can vary. I'd suggest opening a ticket with Plesk or your server provider if you aren't sure what the path to PHP 7 or PHP 5.6 is. If you're web server is running PHP 7, then you'll want to use the CLI version of PHP 7 also so that it matches your ioncube files. Okay, I'm running 5.6.31 on my sites right now. Is there a command I can use in the CLI that would show the paths to my PHP versions? Quote
0 Paul Posted August 3, 2017 Report Posted August 3, 2017 This guide may be helpful for determining the path. https://docs.plesk.com/en-US/onyx/administrator-guide/web-hosting/php-management/running-php-scripts-from-the-command-line.76345/ Quote
2 Paul Posted August 3, 2017 Report Posted August 3, 2017 So maybe /opt/plesk/php/5.6/bin/php Blesta Addons and Aphiso 2 Quote
1 Aphiso Posted August 3, 2017 Author Report Posted August 3, 2017 20 minutes ago, Paul said: So maybe /opt/plesk/php/5.6/bin/php That fixed it! Thank you so much! Blesta Addons and Paul 2 Quote
0 Paul Posted August 3, 2017 Report Posted August 3, 2017 26 minutes ago, Aphiso said: That fixed it! Thank you so much! Great, glad that did it! Thanks for the update! Quote
Question
Aphiso
I'm having a problem when trying to run the cron. I'm using Plesk Onyx. Here is the command I'm running:
Here is the full error it's kicking back when trying to run the cron:
And here is the content of the config/service.php file:
No idea what the problem is here. If someone can point me in the right direction I'd really really appreciate it. When I run the cron manually through the Blesta interface it seems to be running perfectly fine.
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.