Ce sujet a été marqué résolu par Arantor, le 1er Août 2013 à 06:03
« SMorg
open_basedir and Load Balancing Page Errors

Anthony`

  • Messages: 53
open_basedir and Load Balancing Page Errors
« le 7 Novembre 2012 à 22:31 »
Trying to view the page shows a blank page.

I investigated and found the cause on line 471 in ManageServer.php,
Code: [Sélectionner]
$settings['load_average'] = @file_get_contents('/proc/loadavg');

When I remove the supression operator, I get the following errors,
Citation
Warning: file_get_contents() [function.file-get-contents]: open_basedir restriction in effect. File(/proc/loadavg) is not within the allowed path(s): (/home/...:usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /.../wedge/Sources/ManageServer.php on line 471

Warning: file_get_contents(/proc/loadavg) [function.file-get-contents]: failed to open stream: Operation not permitted in /.../wedge/Sources/ManageServer.php on line 471

Arantor

  • As powerful as possible, as complex as necessary.
  • Messages: 14 278
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Anthony`

  • Messages: 53

Arantor

  • As powerful as possible, as complex as necessary.
  • Messages: 14 278

Nao

  • Dadman with a boy
  • Messages: 16 082
Re: open_basedir and Load Balancing Page Errors
« Réponse #4, le 7 Novembre 2012 à 23:36 »
It's more of a server security issue. I remember having the problem at an earlier host. The current one supports this but the only difference is I can see the load average, that's all... If it's not supported -- it doesn't show anything.

Not a biggie IMHO.

Arantor

  • As powerful as possible, as complex as necessary.
  • Messages: 14 278

Nao

  • Dadman with a boy
  • Messages: 16 082

Anthony`

  • Messages: 53
Re: open_basedir and Load Balancing Page Errors
« Réponse #7, le 8 Novembre 2012 à 04:16 »
I went back into the code and the cause of the blank page seems to be the backtick operator executing the shell command here:
Code: [Sélectionner]
elseif (($settings['load_average'] = @`uptime`) !== null && preg_match('~load averages?: (\d+\.\d+), (\d+\.\d+), (\d+\.\d+)~i', $settings['load_average'], $matches) !== 0)

I suspect it's somewhat like my experience in an earlier bug report with exec(?) hanging on me and producing a blank page as well.

Again, removing the supression operator and I get the following error:
Citation
Warning: shell_exec() has been disabled for security reasons in /.../wedge/Sources/ManageServer.php on line 474

Nao

  • Dadman with a boy
  • Messages: 16 082
Re: open_basedir and Load Balancing Page Errors
« Réponse #8, le 8 Novembre 2012 à 08:48 »
So, I've replaced this internally with @shell_exec('uptime')... Can you do the same and tell me if it works this time..?
(There's also another occurrence in Load.php, BTW. Done too.)

Arantor

  • As powerful as possible, as complex as necessary.
  • Messages: 14 278

Anthony`

  • Messages: 53
Re: open_basedir and Load Balancing Page Errors
« Réponse #10, le 8 Novembre 2012 à 22:18 »
Citation de Nao le 8 Novembre 2012 à 08:48
So, I've replaced this internally with @shell_exec('uptime')... Can you do the same and tell me if it works this time..?
(There's also another occurrence in Load.php, BTW. Done too.)
Still get a blank page and when I take off supression:
Citation
Warning: shell_exec() has been disabled for security reasons in /.../wedge/Sources/ManageServer.php on line 474
Citation de Arantor le 8 Novembre 2012 à 16:14
I don't get why it's white-screening instead of just giving you an actual error, though.
Well, I can see why it wouldn't output the error because it's supressed of course but I don't know why it would just hang PHP like this... Do all shell commands do this? -_-


Arantor

  • As powerful as possible, as complex as necessary.
  • Messages: 14 278