unexpected T_RETURN, expecting T_FUNCTION when installing apc
I am trying to install apc with command
yum i开发者_如何学编程nstall 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 ?
In usr/local/lib/php/Archive/Tar.php
, there is some code like this:
class someClass{
function something(){
}
return $x;
}
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 error
If 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.
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 ...
精彩评论