laravel 指令“allow_call_time_pass_reference”警告
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12946835/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Directive 'allow_call_time_pass_reference' warning
提问by redwall_hp
I recently started working on a Laravel project in my local development environment (MAMP, with PHP 5.4.3) and have been somewhat annoyed by an odd occurrence that doesn't seem to be documented.
我最近开始在我的本地开发环境(MAMP,使用 PHP 5.4.3)中处理 Laravel 项目,并且对似乎没有记录的奇怪事件感到有些恼火。
Once in awhile, when I attempt to load a page, I get an unhandled exception screen instead, with the message "Directive 'allow_call_time_pass_reference' is no longer available in PHP." (The location listed is "Unknown on line 0.") If I reload the page once or twice, it works as expected. But the problem comes back shortly after. It's been doing it since I first ran Laravel, even before I added any of my own controllers or models.
有时,当我尝试加载页面时,我会看到一个未处理的异常屏幕,并显示消息“指令 'allow_call_time_pass_reference' 在 PHP 中不再可用。” (列出的位置是“第 0 行未知。”)如果我重新加载页面一次或两次,它会按预期工作。但不久之后问题又来了。自从我第一次运行 Laravel 以来,它就一直在这样做,甚至在我添加任何自己的控制器或模型之前。
I've tried commenting out allow_call_time_pass_reference in the PHP config, as well as explicitly setting it to be off (restarting the server after making changes, of course) but the intermittent warning continues to appear. It wouldn't be a big deal for production, I assume, since the setting to display errors would be off, but it's kind of annoying when working on the project locally.
我已经尝试在 PHP 配置中注释掉 allow_call_time_pass_reference,并明确将其设置为关闭(当然,在进行更改后重新启动服务器),但间歇性警告继续出现。我认为这对生产来说没什么大不了的,因为显示错误的设置会关闭,但是在本地处理项目时有点烦人。
Any ideas as to what could be causing this?
关于可能导致这种情况的任何想法?
回答by William Cahill-Manley
According to PHP 5.4 Backward Incompatible Changes, Call time pass by references have been removed. Now because the error your getting says Directive and line 0 I'm lead to believe its an issue with your php.ini file, I'm sure if you open it up and comment out the line that says allow_call_time_pass_reference
the error will go away. Hope that helps!
根据PHP 5.4 Backward Incompatible Changes,已删除通过引用传递调用时间。现在因为你得到的错误是指令和第 0 行,我相信它是你的 php.ini 文件的问题,我确定你是否打开它并注释掉说allow_call_time_pass_reference
错误会消失的行。希望有帮助!
P.s. if your not sure where your php.ini file is you can find it by loading a page which calls phpinfo()
and then searching for .ini
Ps 如果你不确定你的 php.ini 文件在哪里,你可以通过加载一个调用phpinfo()
然后搜索的页面来找到它.ini