Run cron jobs in subdomain?

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

I have a CPanel server. I have a main site still in SS3 and an SS4 copy of the site. That is still being developed/tested. The SS4 site is a subdomain, as in http://ss4.mySS3domain.co.nz

I am trying to run 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 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 going
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?

turned out it was a problem with different versions of PHP

this cron command worked

/opt/cpanel/ea-php72/root/usr/bin/php vendor/silverstripe/framework/cli-script.php /dev/tasks/PCWLoadRecords > public_html/com4/pcwresults.html