带有php SimpleImage的意外T_字符串
我一直在本地使用PHP5.5,它工作正常,但我刚刚上传到运行PHP5.4的服务器上,SimpleImage支持该服务器,我得到:带有php SimpleImage的意外T_字符串,php,Php,我一直在本地使用PHP5.5,它工作正常,但我刚刚上传到运行PHP5.4的服务器上,SimpleImage支持该服务器,我得到: PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 PHP Parse error: syntax error, unexpected T_STRING 对于这一行: $img = new abeautifulsite\SimpleImage($url); 完整代码: incl
PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1
PHP Parse error: syntax error, unexpected T_STRING
对于这一行:
$img = new abeautifulsite\SimpleImage($url);
完整代码:
include 'images/simple.php';
try {
$img = new abeautifulsite\SimpleImage($url);
$img->auto_orient()->contrast(-10)->colorize('#ff6600', .05)->brightness(5);
$img->save($new);
} catch (Exception $e) {
echo '<div id="fail">'.$e->getMessage().'</div>';
exit();
}
这是一个名称空间问题。您确定要运行5.4吗?我在服务器上更改为5.3,然后又返回到5.4,这就解决了问题。谢谢