php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35207 mod_rewrite not working properly
Submitted: 2005-11-13 03:10 UTC Modified: 2005-11-14 20:34 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: adsh at univ dot kiev dot ua Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.4.1 OS: FreeBSD 4.11
Private report: No CVE-ID: None
 [2005-11-13 03:10 UTC] adsh at univ dot kiev dot ua
Description:
------------
After I update PHP from version 4.4.0 to version 4.4.1 (FreeBSD port mod_php4-4.4.1_1,1 with Apache 2.0.55)  URL rewrite not working properly:

http://servous.se/punbb/viewtopic.php?pid=1329

Bug is not complite fixed in this topic:

http://bugs.php.net/bug.php?id=35059


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-13 03:15 UTC] adsh at univ dot kiev dot ua
Example:

Link http://adsh.ukrweb.net/blog/category/3/ - generate empty page.
 [2005-11-14 00:01 UTC] adsh at univ dot kiev dot ua
A recompile libphp4.so to version php4-STABLE-200511131945 (4.4.2-dev). No results, the same error:

URL to test: http://adsh.ukrweb.net/blog/article/15/

Errors:

[Mon Nov 14 00:51:15 2005] [error] [client 212.9.224.211] PHP Warning:  main(inc/config.php): failed to open stream: No such file or directory in /home/adsh.ukrweb.net/blog/inc/tpl_header_blog.php on line 16, referer: http://adsh.ukrweb.net/blog/
[Mon Nov 14 00:51:15 2005] [error] [client 212.9.224.211] PHP Fatal error:  main(): Failed opening required 'inc/config.php' (include_path='.:/home/test/php') in /home/adsh.ukrweb.net/blog/inc/tpl_header_blog.php on line 16, referer: http://adsh.ukrweb.net/blog/

include_path is set in php.ini for some other scrips.

With version 4.4.0 I nave no any rewrite errors.
 [2005-11-14 00:41 UTC] tony2001@php.net
The error message is quite descriptive. 
Did you try to see if the file "inc/config.php" is really there?
Did you try to use absolute paths? 
Why did you decide it happens only when mod_rewrite is On?
Try to give some more info about the issue.

 [2005-11-14 00:49 UTC] adsh at univ dot kiev dot ua
If I replace libphp4.so to version 4.4.0 all work fine!

I don't use absolute paths.

mod_rewrite is on - You can test this URL (mod_rewrite referer protection):

http://adsh.ukrweb.net/blog/upload/isa_server_2000.jpg

You can see more info in this ULR:

http://servous.se/punbb/viewtopic.php?pid=1329
 [2005-11-14 10:08 UTC] tony2001@php.net
Why did you decide it happens only when mod_rewrite is On?
Please add this line: var_dump(getcwd()); before the include(); and paste it's output here.
 [2005-11-14 18:39 UTC] adsh at univ dot kiev dot ua
1. If I disable mod_rewrite I have standart 404 error:

The requested URL /blog/article/15/ was not found on this server.

2. I add var_dump(getcwd()); at the top of index.php. Result in browser:

string(29) "/home/adsh.ukrweb.net/blog"

There are no errors in apache error log for this request.
 [2005-11-14 18:53 UTC] tony2001@php.net
>1. If I disable mod_rewrite I have standart 404 error:
Obviously you need to change the URL to the real one to execute the script.

>2. I add var_dump(getcwd()); at the top of index.php. 
This is with mod_rewrite On or Off?

Isn't the bug http://bugs.php.net/bug.php?id=35186 the same issue?
 [2005-11-14 20:14 UTC] adsh at univ dot kiev dot ua
1. I understand. Such link work fine in both cases (rewrite is On or Off):

http://adsh.ukrweb.net/blog/blog.php?id=15

2. mod_rewrite is On. There is not #3518 bug.

I recompile and test libphp4.so version 4.1.x, 4.2.x, 4.3.x, 4.4.0. Bug is only with version >= 4.4.1.
 [2005-11-14 20:34 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

This is same issue as in bug #35186

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 23:01:29 2024 UTC