Bug #67393 [Opn->Fbk]: Internal server error with DIRECTORY_SEPARATOR

From: Date: Wed, 02 Jul 2014 08:07:06 +0000
Subject: Bug #67393 [Opn->Fbk]: Internal server error with DIRECTORY_SEPARATOR
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186414@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67393&edit=1

 ID:                 67393
 Updated by:         tyrael@php.net
 Reported by:        sherif dot onion at gmail dot com
 Summary:            Internal server error with DIRECTORY_SEPARATOR
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   Debian Linux
 PHP Version:        5.6.0beta4
 Block user comment: N
 Private report:     N

 New Comment:

could you check that you have any relevant info in your apache/php error logs?
I can't really think anything which could cause an issue like this.
And given that the problem seems to happen with suexec/suphp, I start to think that maybe the
problem is lies with them.

btw. the original author of suphp EOLed the project for a while now, so https://lists.marsching.com/pipermail/suphp/2013-May/002554.html
and it seems that debian testing not provides the suphp packages: https://packages.debian.org/search?keywords=libapache2-mod-suphp
could you tell me what debian version where you using when reproducing the bug?


Previous Comments:
------------------------------------------------------------------------
[2014-06-07 18:55:10] sherif dot onion at gmail dot com

Should have said - this occurs under apache web-server (not cli):

apache2 version 2.4.9-1
architecture amd64

I have replicated on another Debian Testing system (that one is running PHP 5.5.12+dfsg), however
after some fiddling new information has come to light: 
I was using ISP config to manage the hosting and that was creating the apache vhost configs with
suexec/suphp.
If I simply create a 'vanilla' virtualhost without suexec and include the code in a file
(i.e. test.php) and navigate to that URL it works, if I use a site created with ISPConfig I get 500
- Internal Server Error.
I should stress at this point that EVERYTHING else works fine on the ISPCOnfig generated site (I
have been using the same site set up for over 3 years).

The difference between the site that errors and the one that does not is this (in the apache
virtualhost config for the site):


    # suexec enabled
    <IfModule mod_suexec.c>
     SuexecUserGroup web1 client1
    </IfModule>
    # Clear PHP settings of this website
    <FilesMatch "\.ph(p3?|tml)$">
        SetHandler None
    </FilesMatch>
    # suphp enabled
    <Directory /var/www/test>
                <IfModule mod_suphp.c>
        suPHP_Engine on
        # suPHP_UserGroup web1 client1
        suPHP_ConfigPath /var/www/conf/web1
        AddHandler x-httpd-suphp .php .php3 .php4 .php5
        suPHP_AddHandler x-httpd-suphp
                </IfModule>
    </Directory>


I am not an expert on suexec - so not sure if there is something a bit flakey in the config - but
the same config is running everything else fine (I mean a codebase with 1000's of files) the
issue is only with the few lines of code (actually part of a 3rd party product elfinder).

As a workaround - I have patched the elfinder code from 
'separator'       => DIRECTORY_SEPARATOR
to
'separator'       => '/'
which stopped the errors.

Hope that helps....

------------------------------------------------------------------------
[2014-06-07 14:45:16] tyrael@php.net

I can't reproduce the issue, does it also happen when including the test script from cli, or
only through the fastcgi/fpm sapi? (albeit I have no idea how could this be affected by the SAPI).

------------------------------------------------------------------------
[2014-06-06 14:52:05] sherif dot onion at gmail dot com

Description:
------------
A class that has DIRECTORY_SEPARATOR listed in a declared array causes internal server error.

Actually version 5.6.0beta3 (no option in drop down for this - but cannot find similar issue
reported/fixed, so assume still present in 5.6.0beta4.



Test script:
---------------
<?php
class e {
        protected $options = array(
                'separator'       => DIRECTORY_SEPARATOR
        );
}




Actual result:
--------------
The sample code will always produce an internal server error for me:
(Just including the file with this code in is enough).

Here's what the log looks like: 
[Fri Jun 06 15:30:54.040993 2014] [fcgid:warn] [pid 19647] (104)Connection reset by peer: [client
x.x.x.x] mod_fcgid: error reading data from FastCGI server
[Fri Jun 06 15:30:54.041048 2014] [core:error] [pid 19647] [client x.x.x.x] End of script output
before headers: test2.php


------------------------------------------------------------------------



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


Thread (6 messages)

« previous php.bugs (#186414) next »