Reputation: 31
I have a CPanel account. I have a main site still in SS3 and an SS4 copy of the site. The SS4 is still being developed/tested. The SS4 site is a subdomain, as in https://ss4.mySS3domain.co.nz
I am trying to run Silverstripe tasks as cron jobs.
The first, for SS3, goes php public_html/framework/cli-script.php dev/tasks/ReadCSV > public_html/results.html
where “results.html” is just a log file. It works.
My problem is that I’d like to run something similar for SS4.
php public_html/com4/vendor/silverstripe/framework/cli-script.php dev/tasks/PCWLoadRecords > public_html/com4/pcwresults.html
When I run the task in the browser, it works.
When I run it as a cron job, I get a 500 error in the log file.
When I run it manually in Terminal, I get an empty output.
I’ve also tried going into the subdomain (via Terminal) and, at the document root for the SS4 site typing vendor/silverstripe/framework/sake dev/tasks/PCWLoadRecords > afile.txt
but I still get an empty output file.
I suspect cli-script.php doesn’t know which tasks to look at (SS3 or SS4) but I really have no idea.
I’ve set SS_BASE_URL to “https://mysub.mydomain.co.nz”
Anything else I can do?
Upvotes: 0
Views: 113
Reputation: 31
Found the answer: there were differing versions of PHP
this works.
/opt/cpanel/ea-php72/root/usr/bin/php vendor/silverstripe/framework/cli-script.php /dev/tasks/PCWLoadRecords > public_html/com4/pcwresults.html
Upvotes: 1