#35096 [Com]: using mod_rewrite with apache2 crashes

2005-11-07 Thread remko at elvandar dot org
 ID:   35096
 Comment by:   remko at elvandar dot org
 Reported By:  rob at burningsoda dot com
 Status:   Feedback
 Bug Type: Apache2 related
 Operating System: *
 PHP Version:  5CVS, 4CVS (2005-11-04) (snap)
 New Comment:

For the information/record: I used FreeBSD 5.4 and FreeBSD 6.0 
on i386 hardware.


Previous Comments:


[2005-11-07 17:18:49] jd at ods dot org

I'm having issues on i386/FreeBSD 4.11



[2005-11-07 16:50:31] sergeym at hoster dot ru

May be it's platform-depend bug?
I have errors on AMD64/FreeBSD.



[2005-11-07 16:13:50] Brian dot white at foxfire74 dot com

I am using virtual hosts with all of my PHP files in an aliased
directory.  Maybe that makes a difference as to weather or not PHP can
find the include files.

Here is my diff:
---

Compare: (<)php.ini-recommended (40595 bytes)
   with: (>)php.ini (40652 bytes)

443c443
< extension_dir = "./"
---
> extension_dir = "./extensions"
556c556
< ;extension=php_mbstring.dll
---
> extension=php_mbstring.dll
569c569
< ;extension=php_gd2.dll
---
> extension=php_gd2.dll
579c579
< ;extension=php_mcrypt.dll
---
> extension=php_mcrypt.dll
614c614
< SMTP = localhost
---
> SMTP = myserver
618c618,619
< ;sendmail_from = [EMAIL PROTECTED]
---
> sendmail_from = [EMAIL PROTECTED]



[2005-11-07 15:56:25] [EMAIL PROTECTED]

So we have same php.ini file in use now. And I still can't reproduce
using your rewrite rules and script. So what else is different?



[2005-11-07 15:54:13] rob at burningsoda dot com

[EMAIL PROTECTED]:~/web/devel/phpbug> diff /usr/local/etc/php.ini-dist
/usr/local/etc/php.ini
94c94
< output_buffering = Off
---
> output_buffering = 4096

:)



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35096

-- 
Edit this bug report at http://bugs.php.net/?id=35096&edit=1


#35096 [Com]: still trouble with mod_rewrite/apache2

2005-11-06 Thread remko at elvandar dot org
 ID:   35096
 Comment by:   remko at elvandar dot org
 Reported By:  rob at burningsoda dot com
 Status:   Feedback
 Bug Type: Apache2 related
 Operating System: *
 PHP Version:  5CVS, 4CVS (2005-11-04) (snap)
 New Comment:

I had similiar problems with apache2+mod_rewrite and php 
4.4.1. All sites that made use of mod_rewrite broke and gave 
a white page (nothing in the error log though), all other 
sites that use php but not mod_rewrite were working 
perfectly.

my .htaccess:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php


Previous Comments:


[2005-11-06 16:29:08] brian dot white at foxfire74 dot com

I have a WordPress powerered blog and get it for ANY rewrite rule.

Here is a stripped down version of my .htaccess:
---
# BEGIN WordPress

RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [S=75]
RewriteRule ^search/(.+)/?$ /blog/index.php?s=$1 [QSA,L]
RewriteRule ^category/(.+)/?$ /blog/index.php?category_name=$1 [QSA,L]
RewriteRule ^author/([^/]+)/?$ /blog/index.php?author_name=$1 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$
/blog/index.php?year=$1&monthnum=$2&day=$3 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/?$
/blog/index.php?year=$1&monthnum=$2 [QSA,L]
RewriteRule ^([0-9]{4})/?$ /blog/index.php?year=$1 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$
/blog/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA,L]


# END WordPress

Here what was requested in the browser:
--
http://.../blog/2005/10/31/happy-halloween/

Here is what shows up in the logs:
-
[Mon Oct 31 23:25:42 2005] [error] PHP Warning: 
main(./wp-blog-header.php): failed to open stream: No such file or
directory in C:\\...\\wordpress\\index.php on line 4
[Mon Oct 31 23:25:42 2005] [error] PHP Fatal error:  main(): Failed
opening required './wp-blog-header.php'
(include_path='.;c:\\php4\\pear') in C:\\...\\wordpress\\index.php on
line 4

Result:
--
The browser displays a blank page since PHP blows up.

Using:
-
PHP 4.4.1
Windows XP SP2
Apache/2.0.55 (Win32) PHP/4.4.1 
php4apache2.dll



[2005-11-06 15:52:48] [EMAIL PROTECTED]

Exactly how can we reproduce this? It works just fine for me when I
have this .htaccess file:

RewriteEngine on
RewriteRule ^(.+)/$ index.php?myarg=$1 [L]

So what else do we need?




[2005-11-06 04:01:51] rob at burningsoda dot com

doh!

PHP 5.1.0RC5-dev (cli) (built: Nov  6 2005 03:52:41)

I just tried a php5-snapshot. Same problem here. :(



[2005-11-05 09:45:15] tmelzer at tomesoft dot de

Further analyzes have shown me that the fix in 4.4.x-dev was in
sapi/apache2handler/sapi_apache2.c in function php_handler to guard
against the member 'handler' on struct request_rec of beeing NULL and
then accessing it. This was fixed in only one case where around line
518 
'if (parent_req && parent_req->handler && ...'. After I added an
r->handler && strcmp ... to the other places where the structure member
is used the crash went away but I got a 404 - file not found error. I
think this is related to the fact that I'm not sure what to do if
several of this if () statements are evalute false i.e. what to place
in the else block.



[2005-11-04 22:57:08] [EMAIL PROTECTED]

I want you to try the PHP 5 snapshot because I want to be sure this is
only happening with PHP 4. In which case we have better chance of
figuring out what fix to backport from PHP 5.

On the other hand, if this also happens with PHP 5, we really need to
know since we're about to release PHP 5.1 and it would be nice to fix
this kind of things before the release..




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35096

-- 
Edit this bug report at http://bugs.php.net/?id=35096&edit=1