简体   繁体   English

什么会导致Apache服务somepage.php / friendly-url在PHP升级后产生404

[英]What would cause Apache serving somepage.php/friendly-url yield 404 after PHP upgrade

My hoster has recently upgraded PHP to 5.3.8 and now all my installations that use a URL pattern like somefile.php/friendly-url yield a 404 ErrorDocument (where somefile.php is an actual existing PHP file which is supposed to handle the rest of the path). 我的主机最近已将PHP升级到5.3.8,现在我使用像somefile.php/friendly-url这样的URL模式的所有安装都会产生404 ErrorDocument(其中somefile.php是一个实际存在的PHP文件,应该处理其余的的路径)。 How do I best go about fixing this? 我如何才能最好地解决这个问题? What is the directive that tells Apache to serve said URL even if only the somefile.php part is valid but not the whole location does not really point to an existing file? 什么是告诉Apache服务所述URL的指令,即使只有somefile.php部分有效但不是整个位置并不真正指向现有文件?

BTW: No URL rewriting is involved… Also, the 404 is clearly generated by Apache, not any scripts. BTW:不涉及URL重写...此外,404显然是由Apache生成的,而不是任何脚本。

Try to add an .htaccess file to your public directory containing this line: 尝试将.htaccess文件添加到包含以下行的公共目录:

AcceptPathInfo On

From the PHP Manual : PHP手册

Apache 2 users may use AcceptPathInfo On inside httpd.conf to define PATH_INFO . Apache 2用户可以在httpd.conf中使用AcceptPathInfo On来定义PATH_INFO

Also have a look at the Apache2 documentation . 另请参阅Apache2文档

You probably had mod_rewrite configured differently before the upgrade... a similar thing happened to a sever I was working on about 2 months ago. 你可能在升级之前配置了不同的mod_rewrite ...类似的事情发生在我2个月前工作的服务器上。 Check out mod_rewrite and see if this is what you need. 检查mod_rewrite ,看看这是否是你需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM