I'm trying to run a CRON job that accesses my database and does some file transfer. Adapting it from another CRON job that just had a file transfer, I put the command:
php -qn -d memory_limit=128M
in front of my CRON file. I remember that I added the memory_limit because I was transferring files but could not remember for the life of me why I had the -qn -d. Copying the same command to another CRON job that needs to access a database using the Zend_Db_Adapter_Pdo_Mysql, I got the error:
"The PDO extension is required for this adapter but the extension is not loaded error "
And, it was only when I used the command
php -q
that the error went away. 2 questions, then:
1) What is the difference between "-qn -d memory_limit=128M" and "php -q" with respect to a CRON job?
2) Why do I have the PDO issue when I use the former command and not the latter?
-Eric
The -n
flag means "don't use any php.ini files", so it's not loading any extensions (causing the PDO error). The -d
flag allows you to set PHP configuration variables, so in your example you're overriding the default memory limit.