Hi there @fabriziocastrob6,
It is quite possible that when you run the PHP script via cron it might use a different php.ini file.
I could suggest 2 things:
- In your crontab make sure to specify the exact path to the php binary, to find out the path run:
- If the script is in a specific directory, you could add a
cd command before the php command in cronjob, so it would look something like this:
cd /path/to/your/directory && /usr/bin/php script.php
- If this still does not work, try specifying the path to your custom php.ini file if you use one, you can do that by adding the following flag:
php -c /path/to/your/custom/php.ini
Let me know how it goes!