Lihua_ng 2021-06-15 13:03 采纳率: 80%
浏览 111
已采纳

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 02:43
    关注

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

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

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部