laravel 错误 - 指令“register_globals”在 PHP 5.3 和更高版本中在第 0 行的 Unknown 中已弃用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14846892/
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
ERROR - Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
提问by Josh Rakim
Im occasionally getting this error, sometimes it pops up sometimes it doesnt: ERROR - Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
我偶尔会收到此错误,有时会弹出有时不会:错误 - 指令“register_globals”在 PHP 5.3 中已弃用,并且在第 0 行的未知中更高
There was no php.ini file so i created one and turn register globals off, but that didn't work. I added "php_flag register_globals 0" to the htaccess file, but that didn't work either…
没有 php.ini 文件,所以我创建了一个并关闭全局寄存器,但这不起作用。我在 htaccess 文件中添加了“php_flag register_globals 0”,但这也不起作用……
Im using the laravel framework.
我使用 Laravel 框架。
Here is the link to the website, if you scroll through about 5 or so pages the error will occur
这是网站的链接,如果您滚动大约 5 个左右的页面,则会发生错误
I have no more ideas. Any help would be greatly appreciated! Thanks.
我没有更多的想法。任何帮助将不胜感激!谢谢。
回答by Laurence
From the PHP documentation:
来自 PHP 文档:
This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
So you either need to downgrade your PHP version to <=5.2 - or you need to remove any code that is using register globals.
因此,您要么需要将 PHP 版本降级到 <=5.2 - 要么需要删除任何使用全局寄存器的代码。
There was no php.ini file so i created one and turn register globals off
没有 php.ini 文件,所以我创建了一个并关闭注册全局变量
There is always a php.ini file. I'm guessing your are on a hosted solution somewhere, so you cannot see the ini file. You need to talk to your server administrator and get them to change it.
总是有一个 php.ini 文件。我猜你在某个地方的托管解决方案上,所以你看不到 ini 文件。您需要与您的服务器管理员交谈并让他们更改它。