This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable,
visit the help center。
7年前关闭。
在localhost/myweb上一切正常,但是当我将文件夹myweb上传到我的public_html目录时,出现错误:
[16-Sep-2012 18:32:55] PHP Warning: Unexpected character in input: '\' (ASCII=92)
state=1 in /home1/programw/public_html/myweb/index.php on line 7
[16-Sep-2012 18:32:55] PHP Parse error: syntax error, unexpected T_STRING in /home1
/programw/public_html/myweb/index.php on line 7
在我的index.php第7行中有以下代码:
$app = new Core\Bootstrap();
我知道与\斜杠有关,但我无法弄清楚该如何解决。
谁能帮我吗?我也使用.htaccess和里面的.htaccess我有以下内容:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
解决方案我只是发现\斜杠和命名空间仅在PHP 5.3中受支持,并且由于某种原因,我的主机未将其PHP更新到5.3。如果有人知道在5.2上工作的方法,我将非常感激。