I created a blank application and trying to run it as cron job I am getting an connection error
“The database connection was not found”
If I access the same app from my browser is working as design.
Any idea why is not finding the connection from the server via a cron job?
Thanks for your quick Response.
I am using WGET but the response from the server is “The database connection was not found”
I am seeing this on the file saved by cron job on the root dir
Hi Ppmm, im not sure you can use Scriptcase for cronjobs. I tried this in the past and ended up writing the php scripts for the cron jobs myself. If you have found a solution via Scriptcase, I would be happy to follow you.
Its possible to use scriptcase for cron jobs but you have to go in to the generated code and it can get messy. I replied to a similar question on the forums before with a detailed explanation on how to edit the generate scriptcase file but that was for scriptcase 9.0. So there might be new things that need to be changed.
I would highly recommend using a custom php file and just writing your own code in there.
In my case we did not want the frontend user to be able to call the page for obvious security reasons where if you use wget I am pretty sure if the user knows the URL they can just call the URL directly and the php code on the page will run so this is what I did to resolve the problem:
To fix this i had to redeploy the full project using a zip file, I was deploying with FTP directly to the server and the problem persist, now that I learned this all my project is working fine with no errors
The cron job is working with wget directly to the url of the app with no problems