【问题标题】:PHP Slim framework : No input file specified?PHP Slim 框架:没有指定输入文件?
【发布时间】:2018-05-31 01:32:30
【问题描述】:

这是我的目录结构

/path/www.mysite.com/ public_html/ 接口/ v1/ 索引.php .htaccess .htaccess 规则: 重写引擎开启 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d 重写规则 ^(.*)$ index.php/$1 [L]

问题:
当我浏览此网址时:http://technobuff.in/api/v1/hello 这不起作用。它显示'未指定输入文件。' 但如果我使用这个:http://technobuff.in/api/v1/index.php/hello 这工作正常。

我正在使用 Slim 框架进行 API 开发。在 localhost 中,这运行良好。请帮忙解释一下。

【问题讨论】:

  • 快速浏览.. 注意到你有不同的.htaccess for slim framework
  • @BagusTesa 谢谢它对我有用。
  • 很高兴你把它整理出来。

标签: php .htaccess url-redirection slim


【解决方案1】:

感谢Bagus Tesa

只需点击此链接即可。 .HTACCESS for Slim Framework

将 .HTACCESS 文件的内容替换为以下内容

重写引擎开启 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [QSA,L]

【讨论】:

    猜你喜欢
    • 2020-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-18
    • 2017-12-12
    • 2011-09-01
    • 2018-02-12
    相关资源
    最近更新 更多