tp5.1出现no input file specified的问题

tp5.1出现no input file specified的问题

昨天在通过composer安装tp5.1的时候,在本地运行可以显示出index/index 默认首页,但是在路由新增一个以后发现只要在地址栏输入这个路由的路径例如:www.tp5.com/new 页面便会出现no input file specified
一开始是以为php.ini下的open_ssl配置问题.改了之后发现没有好转.
后来发现是因为伪静态的问题,只需要将/public/.htaccess修改为以下

<IfModule mod_rewrite.c>
  Options +FollowSymlinks -Multiviews
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    RewriteRule ^(.*)$ index.php
</IfModule>

就可以了 需要注意的是第四行的 # 是一个注释标签.

猜你喜欢

转载自blog.csdn.net/qingmu_hehui/article/details/82863968
今日推荐