Bug #607

If a client changes advanced PHP settings, then the website gives a blank page

Added by Apostol Raykov 11 months ago. Updated 8 months ago.

Status:Closed Start date:06/28/2011
Priority:Urgent Due date:
Assignee:Mustafa Ramadhan % Done:

100%

Category:- Spent time: 1.00 hour
Target version:6.1.7 Estimated time:1.00 hour
Affected version:6.1.6 Operating System:
Resolution:Resolved Architecture:
Reproduceable:

Description

Two of my clients reported that when they change advanced PHP settings, their websites don't open after that. They see a blank page instead. If I as admin change anything in their PHP settings, the websites are up and running again.
They also can't change memory limit, upload filesize, etc., which might not be a bug, but it used to be there.

Associated revisions

Revision 7ddcc740
Added by René Nieuwburg 11 months ago

Issue #607 admin only exclusion causes faulty php.ini

Revision ec9857b5
Added by René Nieuwburg 11 months ago

merge r532 bug #607

Revision 42dca593
Added by Mustafa Ramadhan 9 months ago

Issue #547, #565, #578, #583, #593, #599, #607, #609, #623, #638, #577, #612, #563, #566, #567, #575, #589, #590, #597, #598 - (sorry, difficult to description one-by-one) (final)

Revision b0bf3716
Added by Danny Terweij 9 months ago

Rollback r563-r569 (breaks trunk and branch (if merge to branch)). Commits replaced new code (6.2.0) with old code (6.1.x). Back at r562. Issues #645 #646 #612 #632 #583 #638 #547 #565 #578 #583 #593 #599 #607 #609 #623 #638 #577 #612 #563 #566 #567 #575 #589 #590 #597 #598

Revision 5b1010af
Added by Mustafa Ramadhan 8 months ago

Issue #50, #547, #578, #582, #583, #593, #607, #609, #638, #650, #652, #657, #89, #577, #612, #538, #650, #559 - many issues related to the same file(s) (directly to branches/6.1.x after merge url svn trunk to branches/6.1.x local copy)

Revision 52dd52fb
Added by Mustafa Ramadhan 7 months ago

#646, #645, #632, #598, #597, #590, #589, #575, #571, #567, #566, #563, #559, #538, #612, #577, #625, #570, #680, #674, #657, #652, #650, #638, #637, #630, #623, #609, #607, #599, #596, #593, #583, #582, #581, #547, #499, #50, #671 - all codes to branch (ready for 6.1.7beta2)

History

Updated by Mustafa Ramadhan 11 months ago

All setting for 'Advanced PHP Config' was save in .htaccess in domain root directory in '<Ifmodule mod_php4.c></Ifmodule>' and '<Ifmodule mod_php5.c></Ifmodule>'.

Updated by Apostol Raykov 11 months ago

I use suPHP on the server and the settings in .htaccess are irrelevant. Something else is wrong.

Updated by Mustafa Ramadhan 11 months ago

Related to #435 and #590.

Updated by William Leonard 11 months ago

Can you give specific examples of the settings that break it? Also can you create a new user and replicate this issue?

Updated by William Leonard 11 months ago

  • Priority changed from Normal to Urgent
  • Target version set to 6.1.7

Actually I was able to see the problem as well. It looks like when the user submits it, the values aren't parsed correctly. It does set the setting the user sets, but anything else that the user was not able to set is bad. Here is a diff:
Notice all the bad settings are settings that the user is not allowed to change anymore

diff php.ini php.bad
1083c1083
< upload_max_filesize = 2M
---
> upload_max_filesize = __lx__upload_max_filesize
1085c1085
< output_buffering = on
---
> output_buffering = off
1088c1088
< post_max_size = 8M
---
> post_max_size = __lx__post_max_size_flag
1092,1095c1092,1095
< max_execution_time = 30
< max_input_time = 60
< memory_limit = 32M
< post_max_size = 8M
---
> max_execution_time = __lx__max_execution_time_flag
> max_input_time = __lx__max_input_time_flag
> memory_limit = __lx__memory_limit_flag
> post_max_size = __lx__post_max_size_flag
1104c1104
< disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
---
> disable_functions = __lx__disable_functions

Updated by Mustafa Ramadhan 11 months ago

Look inside /usr/local/lxlabs/kloxo/httpdocs/htmllib/lib/pserver/phpinilib.php

function getExtraList()
{
    global $login;
    $list[] = 'sendmail_from';
    $list[] = 'enable_dl_flag' ;
    $list[] = 'output_buffering_flag' ;
    $list[] = 'register_long_arrays_flag' ;
    $list[] = 'allow_url_fopen_flag'; 
    $list[] = 'allow_url_include_flag'; 
    $list[] = 'register_argc_argv_flag' ;
    $list[] = 'magic_quotes_gpc_flag' ;
    $list[] = 'mysql_allow_persistent_flag' ;
    if ($login->isAdmin()) {
        $list[] = 'disable_functions';
        $list[] = 'max_execution_time_flag';
        $list[] = 'max_input_time_flag';
        $list[] = 'memory_limit_flag';
        $list[] = 'post_max_size_flag';
        $list[] = "upload_max_filesize";
    }
    $list[] = 'file_uploads_flag' ;
    $list[] = 'magic_quotes_runtime_flag' ;
    $list[] = 'magic_quotes_sybase_flag' ;
    $list[] = 'cgi_force_redirect_flag' ;
    $list[] = 'safe_mode_flag' ;
    //$list[] = 'session_autostart_flag' ;
    $list[] = 'session_save_path_flag' ;

    return $list;
}

Parameters like 'disable_functions' only could edited by admin. No effect if edited by client.

Updated by René Nieuwburg 11 months ago

Yes, that is my mistake. I should have taken measures what to do with the unsubmitted parameters the non-admin users. The idea was a bit too simplistic. For now the work around is to change this:

if ($login->isAdmin()) {
$list[] = 'disable_functions';
$list[] = 'max_execution_time_flag';
$list[] = 'max_input_time_flag';
$list[] = 'memory_limit_flag';
$list[] = 'post_max_size_flag';
$list[] = "upload_max_filesize";
}

into

$list[] = 'disable_functions';
$list[] = 'max_execution_time_flag';
$list[] = 'max_input_time_flag';
$list[] = 'memory_limit_flag';
$list[] = 'post_max_size_flag';
$list[] = "upload_max_filesize";

I guess that everybody agrees that the domain account user should not be able to change the limits I excluded for them, right?

Updated by René Nieuwburg 11 months ago

Because this is pretty urgent, you can apply a patch to this file. Since attachments still don't work here for me (I am apparently the only one suffering this) you will need to use this link to get the patch straight from SVN.

Updated by René Nieuwburg 11 months ago

  • % Done changed from 0 to 100
  • Estimated time set to 1.00
  • Resolution set to Resolved

r532 and r533

Updated by René Nieuwburg 11 months ago

  • Status changed from New to Closed

Updated by Danny Terweij 9 months ago

  • Status changed from Closed to Reopened
  • % Done changed from 100 to 0

See r570

Updated by Mustafa Ramadhan 9 months ago

  • Assignee set to Mustafa Ramadhan
  • % Done changed from 0 to 100

Still the same when rollback (r570).

Updated by Danny Terweij 8 months ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF