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

From: Date: Mon, 07 Nov 2005 12:52:08 +0000
Subject: #35096 [Opn]: still trouble with mod_rewrite/apache2
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87751@lists.php.net to get a copy of this message
ID: 35096 User updated by: rob at burningsoda dot com Reported By: rob at burningsoda dot com Status: Open Bug Type: Apache2 related Operating System: * PHP Version: 5CVS, 4CVS (2005-11-04) (snap) New Comment: As a further note, $_SERVER['PHP_SELF'] contains "/phpbug/index.php/" if URL-rewriting took place while $_SERVER['SCRIPT_NAME'] correctly returns "/phpbug/index.php". This happens even with output buffering disabled and leads to the conclusion, that the original bug is not in the buffering code. Beware! This fact (PHP_SELF != SCRIPT_NAME or PHP_SELF nonexistant) can lead to extremely subtle bugs. Previous Comments: ------------------------------------------------------------------------ [2005-11-07 12:35:21] rob at burningsoda dot com After rebuilding Apache2 and PHP5-dev on different machines the whole weekend about 2 million times and wondering why some showed the bug, some not, I eventually tracked it down to the following simple configuration setting (*drum roll*): *** output_buffering *** To trigger the bug, set "output_buffering = On" or (e.g.) "output_buffering = 4096", TO BYPASS THE BUG (listen up, bug plagued Joomla!/Wordpress/etc. users) SET "output_buffering = Off" in your php.ini. This bypass works for PHP 4 & 5. Cheers, rob. PS: If I extend my testcase to <?php ob_start(); echo($_GET['myarg']); ob_end_flush(); ?> with "output_buffering = Off" that still does _not_ trigger the bug. Maybe that helps. ------------------------------------------------------------------------ [2005-11-07 08:11:59] scott at whitetigerphotography dot com Having an identical problem on FreeBSD 4.11-release-p13 with the latest version from ports (PHP 4.4.1 (cli) (built: Nov 6 2005 23:03:29)) (patched with the original CVS fix for this bug but that doesn't fix it) This too happens for any rewrite rule used for PHP. I use rewrite rules for almost all of my production sites and they have all stopped working, except for one which uses a CGI script instead. Affects software like Mambo (Joomla) with SEF enabled and Gallery Examples for rewrite reproduce code (from gallery): RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^\.\?/]+)/([0-9]+)$ /view_photo.php?set_albumName=$1&index=$2 [QSA] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^\.\?/]+)/([A-Za-z_0-9\-]+)$ /view_photo.php?set_albumName=$1&id=$2 [QSA] Result: Blank pages most of the time but in the case of gallery... occasional parts of pages for some reason. No errors found in PHP or Apache logs ------------------------------------------------------------------------ [2005-11-07 07:30:34] tmelzer at tomesoft dot de On SuSE 9.1 with apache 2.0.55 and php-4.4.x-dev with shared modules in this order - cryptopp - bz2 - imap - exif - mime_magic - dba - zlib - gd - sockets - curl - iconv - xslt - mysql - interbase - session .htaccess RewriteEngine On RewriteBase /shop/ RewriteRule ^irw_(.*)\.html index.php?param=$1 ------------------------------------------------------------------------ [2005-11-06 22:41:36] free4cd at yahoo dot de Same Problem with PHP 4.4.1 and 5.1 snapshots. If rewrite is enabled you get a blank page. No error in log file or else. Problem with Joomla and vBulletin/vBSEO if rewrite engine is turned on. If rewrite is disabled all works fine. My .htaccess for Joomla: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php ------------------------------------------------------------------------ [2005-11-06 19:47:49] remko at elvandar dot org 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 ------------------------------------------------------------------------ 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

« previous php.bugs (#87751) next »