意外的 T_RETURN,安装 apc 时需要 T_FUNCTION
我正在尝试使用命令
yum install apc 安装
apc ,它给我以下错误
解析错误:语法错误,意外的 T_RETURN,在 /usr/local/lib/php/Archive/Tar.php 第 251 行中期待 T_FUNCTION
可能是什么原因?
I am trying to install apc with command
yum install apc
it's giving me following error
Parse error: syntax error, unexpected T_RETURN, expecting T_FUNCTION in /usr/local/lib/php/Archive/Tar.php on line 251
what could be the reason ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 usr/local/lib/php/Archive/Tar.php 中,有一些类似这样的代码:
第 251 行左右。
return
语句位于函数外部,并且因为除了类中函数之外的函数声明之外不能有任何命令,因此会导致错误如果这是 APC 错误,您需要联系发行商,因为他们可能提供错误的源代码副本给更多的人。
如果这是您的代码,您可能需要修复它。
In
usr/local/lib/php/Archive/Tar.php
, there is some code like this:around line 251. A
return
statement is outside of a function, and because there cannot be any commands besides function declarations outside of a function that is in a class, it is causing an errorIf this is a APC error, you will want to contact the distributor, as they might be providing a bad copy of source code to more people that you.
If this is your code, you might want to fix it.
对于某个软件来说,这是一个 PHP 错误。如果没有 PHP 代码,就很难解决这个问题。请联系您所使用的 Linux 发行版的软件包维护者并要求他们解决问题,因为 StackOverflow 可能不是解决问题的最佳场所...
That's a PHP error, for a piece of software. Without the PHP code it would be difficult to solve the problem. Contact the package maintainer for the distro of Linux you are using and ask them to solve the problem, because StackOverflow probably isn't the best place for it ...