Lihua_ng 2021-06-15 21:03 采纳率: 80%
浏览 107
已采纳

Apache2.4 开启Pathinfo 失败

我在谷歌中尝试了所有方法,但都失败了。

httpd.conf中的设置

<Directory "${SRVROOT}/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    AcceptPathInfo On
    Require all granted
</Directory>

LoadModule dir_module modules/mod_dir.so


也设置了

php.ini中

cgi.fix_pathinfo=1

也设置了

phpinfo中

在tp6的public目录下的.htaccess中

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

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

都失败了。

在tp6中我无法访问

http://localhost:63342/homework1/public/index.php/index/showflower


我只能访问

http://localhost:63342/homework1/public/index.php?s=/index/showflower

请问有办法能正常打开pathinfo模式吗?或者把tp6的pathinfo访问模式关闭

 

access.log文件部分信息

127.0.0.1 - - [16/Jun/2021:12:10:47 +0800] "GET /test/public/static/picture/9010066_m.jpg HTTP/1.1" 200 18347
127.0.0.1 - - [16/Jun/2021:12:10:47 +0800] "GET /test/public/static/picture/9010702_m.jpg HTTP/1.1" 200 13395
127.0.0.1 - - [16/Jun/2021:12:10:47 +0800] "GET /test/public/static/picture/9010668_m.jpg HTTP/1.1" 200 22411
127.0.0.1 - - [16/Jun/2021:12:10:47 +0800] "GET /test/public/static/picture/9040002_m.jpg HTTP/1.1" 200 19491
127.0.0.1 - - [16/Jun/2021:12:10:47 +0800] "GET /test/public/static/picture/201152623373880165.jpg HTTP/1.1" 200 18224

error.log

[Wed Jun 16 12:09:28.792475 2021] [core:error] [pid 16716:tid 1924] (20024)The given path is misformatted or contained invalid characters: [client 127.0.0.1:18099] AH00127: Cannot map GET /homeworkInApache/public/index.php/index/.../public/static/image/ttel.jpg HTTP/1.1 to file, referer: http://billow.com/homeworkInApache/public/index.php/index/index.html
[Wed Jun 16 12:09:32.747007 2021] [core:alert] [pid 16716:tid 1948] [client 127.0.0.1:9899] D:/Program/wamp/apache/htdocs/homeworkInApache/app/.htaccess: Invalid command 'deny', perhaps misspelled or defined by a module not included in the server configuration
[Wed Jun 16 12:09:37.405597 2021] [core:error] [pid 16716:tid 1948] (20024)The given path is misformatted or contained invalid characters: [client 127.0.0.1:9899] AH00127: Cannot map GET /homeworkInApache/public/.../public/static/image/ttel.jpg HTTP/1.1 to file, referer: http://billow.com/homeworkInApache/public/index.php
[Wed Jun 16 12:09:40.868257 2021] [core:error] [pid 16716:tid 1948] (20024)The given path is misformatted or contained invalid characters: [client 127.0.0.1:9899] AH00127: Cannot map GET /homeworkInApache/public/index.php/index/.../public/static/image/ttel.jpg HTTP/1.1 to file, referer: http://billow.com/homeworkInApache/public/index.php/index/index.html
[Wed Jun 16 12:10:44.652662 2021] [core:alert] [pid 16716:tid 1924] [client 127.0.0.1:1024] D:/Program/wamp/apache/htdocs/test/app/.htaccess: Invalid command 'deny', perhaps misspelled or defined by a module not included in the server configuration
[Wed Jun 16 12:10:47.449908 2021] [core:error] [pid 16716:tid 1948] (20024)The given path is misformatted or contained invalid characters: [client 127.0.0.1:14208] AH00127: Cannot map GET /test/public/.../public/static/image/ttel.jpg HTTP/1.1 to file, referer: http://billow.com/test/public/index.php
[Wed Jun 16 12:10:49.268983 2021] [core:error] [pid 16716:tid 1952] (20024)The given path is misformatted or contained invalid characters: [client 127.0.0.1:1032] AH00127: Cannot map GET /test/public/index.php/index/.../public/static/image/ttel.jpg HTTP/1.1 to file, referer: http://billow.com/test/public/index.php/index/index.html

我的wamp根目录是没有log信息的,因为我是php,apache分开安装的,不是集成环境,这些log信息是在apache中的logs文件中找到的,其中没有phplog的信息,php的文件夹中好像也没找到log信息

  • 写回答

8条回答 默认 最新

  • 家铭didphp 2021-06-16 10:43
    关注

    是创建了一个控制器  index,里面有个方法 showflower ?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(7条)

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler