tags:

views:

932

answers:

2

Quick question.

If I run a php script from the command-line (through a cron job, "php ./somwthing-sync.php"), am I still bounded to the php max_execution_time and memory_limit?

Thanks

Nathan

+2  A: 

I'm guessing you still are, as the page is still executed and takes up memory.

According to ghostdog, the time limit is removed, but my guess is the memory limit is till in place.

Chacha102
+4  A: 

if you look at the doc , its says

      max_execution_time  integer

This sets the maximum time in seconds a script is allowed to run before it is 
terminated by the parser. This helps prevent poorly written scripts from 
tying up the server. The default setting is 30. 
When running PHP from the command line the default setting is 0.

A 0 means unlimited. (If i am not wrong). As for memory_limit, the PHP command line will take the value that is defined in php.ini. This you can easily test and find out by writing code that "eats" memory and setting memory_limit to -1 in php.ini

ghostdog74