问题描述:
新下载的thinkphp5.1,在第一次配置好环境期待看到欢迎界面的时候,神奇的报错了
报错信息
Parse error: syntax error, unexpected ‘class’ (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or ‘{’ or ‘$’ in F:\mygit\company\thinkphp\base.php on line 33
解决方案
emmmm,没错,是因为我版本选择的太低了,最少需要php 5.6以上的版本
问题描述
出现no input file specified的问题:通过composer安装tp5.1.35,在本地运行可以显示出默认首页,但是访问新写一个控制器方法例如:zykyw.com/index/test的时候,页面便会出现no input file specified
解决方案
因为伪静态的问题,只需要将/public/.htaccess文件内容修改如下
<IfModule mod_rewrite.c>Options +FollowSymlinks -MultiviewsRewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f#RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] //注释掉该行 RewriteRule ^(.*)$ index.php// 新增该行</IfModule>