您好,欢迎访问一九零五行业门户网

php cli 参数

发现脚本中 /user/bin/php -qd open_dir=/
查手册,d  define,用该参数可以自行设置任何可以在 php.ini 文件中设置的配置选项的值,其语法为:
-d configuration_directive[=value] # 取值部分被省略,将会把配置选项设为 1
$ php -d max_execution_time -r '$foo = ini_get(max_execution_time); var_dump($foo);' string(1) 1
# 取值部分为空白,将会把配置选项设为
php -d max_execution_time= -r '$foo = ini_get(max_execution_time); var_dump($foo);' string(0)
# 配置选项将被设置成为任何 '=' 字符之后的值 $ php -d max_execution_time=20 -r '$foo = ini_get(max_execution_time); var_dump($foo);' string(2) 20
$ php -d max_execution_time=doesntmakesense -r '$foo = ini_get(max_execution_time); var_dump($foo);' string(15) doesntmakesense
但是,q 参数没有,网上资料也找不到,查源码:
{'q', 0, no-header}, /* for compatibility with cgi (do not generate http headers) */
不产生http headers, 由于时间关系没有实际测试。
做笔记。
其它类似信息

推荐信息