快问.
如果我从命令行运行一个PHP脚本(通过一个cron作业,"php ./somwthing-sync.php"),我仍然受限于php max_execution_time和memory_limit?
谢谢
弥敦道
gho*_*g74 10
如果你看一下这个文档,它说
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.
Run Code Online (Sandbox Code Playgroud)
0表示无限制.(如果我没错的话).至于memory_limit,PHP命令行将获取php.ini中定义的值.通过编写"吃"内存并在php.ini中将memory_limit设置为-1的代码,您可以轻松地测试和查找