Blank Pages again! When will it end?

Blank Pages again! When will it end?

by Ant DG -
Number of replies: 12
Hallo,
as I said in an older post <http://moodle.org/mod/forum/discuss.php?d=118723> I had to change webserver to solve this problem: I had some blank pages and wasn't able to find a solution.

In the new server Moodle 1.9.2 and 1.9.4 ran smoothly up today. Now we have exactly the same blank pages as it happened on the previous server:

under Users > Accounts :
http://www.domain.com/moodle/admin/user.php
http://www.domain.com/moodle/admin/user/user_bulk.php
http://www.domain.com/moodle/user/editadvanced.php?id=-1
http://www.domain.com/moodle/admin/uploaduser.php
http://www.domain.com/moodle/admin/uploadpicture.php

under Grades :
http://www.domain.com/moodle/grade/edit/outcome/index.php
http://www.domain.com/moodle/grade/edit/letter/edit.php

We just add another one:
http://www.domain.com/moodle/mod/forum/post.php?forum=1
...that it is accessed when trying to add a new post in a forum.

I've read *everything* about this issue and I checked all I've read:

- server is LAMP, with Plesk and safe_mode is OFF;
- the Moodle config.php file seems to be fine;
- display_errors is ON and no errors are displayed;
- the webserver error_log reports errors of no meaning (missed a favicon.ico file);

The only thing I can't tell if is relevant or not is the open_basedir. The PHPINFO file says:


Local value
Master value
open_basedir
/var/www/vhosts/domain.com/httpdocs:/var/www/vhosts/domain.com/httpdocs/tmp no value
include_path
.:/var/www/vhosts/assopragma.it/httpdocs .:.:


I don't remember if the settings were already those, but I'm on a shared hosting and the provider says they didn't touch Apache or PHP. They just upgraded Plesk.

Can I finally know how to set up Moodle to be as much server-indipendent as possible?

Thanks in advance
Average of ratings: -
In reply to Ant DG

Re: Blank Pages again! When will it end?

by Ant DG -
Ok, I can add some relevant informations.

When I click the first link under Users > Accounts, now I get the error:


Warning: require_once(HTML/QuickForm.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/domain.com/httpdocs/moodle/lib/formslib.php on line 24

Fatal error: require_once() [function.require]: Failed opening required 'HTML/QuickForm.php' (include_path='.:/var/www/vhosts/domain.com/httpdocs') in /var/www/vhosts/domain.com/httpdocs/moodle/lib/formslib.php on line 24


I finally realised that, even with the display_errors ON in PHP, I had to activate the dubbing mode.

Now... What does that error mean? timido

Thanks
In reply to Ant DG

Re: Blank Pages again! When will it end?

by Jai Gupta -
Go to Site Administration > Server > PHP info (PHP info from other places will not do)

Find include_path, here you should see moodle/lib/pear

If you are not seeing it then that is a problem causing Fatal error.

Ask you host if they have disabled "ini_set" function, see MDL-9732

Basically we need to add moodle/lib/pear in include_path of PHP. This can be also be done by htaccess and php.ini, see what your host supports.
Average of ratings: Useful (1)
In reply to Jai Gupta

Re: Blank Pages again! When will it end?

by Ant DG -
Jai,
thank you for your reply.

That seems to be the problem, I found this PHP setting:

include_path = .:/var/www/vhosts/domain.com/httpdocs

as a local value, master is .:.: (no quotes... don't know if that means anything).

I try adding a new path, using a htaccess file which I already know it usually works with my host provider.

I tried each one of the followings:

php_value include_path "/var/www/vhosts/domain.com/httpdocs/moodle/lib/pear"
php_value include_path ".:/var/www/vhosts/domain.com/httpdocs:/moodle/lib/pear"
php_value include_path ".:/var/www/vhosts/domain.com/httpdocs:/var/www/vhosts/domain.com/httpdocs/moodle/lib/pear"

None of these seem to work and the include_path I see in the PHP Info page (inside Moodle) is always the same. What am I doing wrong?
Thanks again
In reply to Ant DG

Re: Blank Pages again! When will it end?

by Ant DG -
I add some more informations: my hosting provider says they didn't disable the ini_set functionality and by the way I wrote this little script to test it:

<?php
if(ini_set('error_reporting', 'ALL') === false)
{
// Perform failure handling logic
echo "ini_set is disabled";
}
?>

which results in no output, thus the if condition is not verified.

So I'm on a shared hosting too, as seen in the bug MDL-9732 , but I should have ini_set on.
Anyway I couldn't set a different include_path using an htaccess file or a php.ini file in the webroot /httpdocs/.

Can I do anything more?
It is becoming urgent: one of these sites has been in production since long.

Thank you
In reply to Ant DG

Re: Blank Pages again! When will it end?

by Jai Gupta -
You may ask your host to add /var/www/vhosts/domain.com/httpdocs/moodle/lib/pear in PHP's include_path

A quick but very dirty way would be to copy all files and folder from /var/www/vhosts/domain.com/httpdocs/moodle/lib/pear to /var/www/vhosts/domain.com/httpdocs. It should work as /var/www/vhosts/domain.com/httpdocs is in your PHP's include_path.
In reply to Jai Gupta

Re: Blank Pages again! When will it end?

by Ant DG -
Yes, I've asked that... They say they can't because that implies restarting Apache, even for other customers (shared hosting). triste

I'd leave the dirty solution as the extreme last one!

Thank you Jai.

But just one more question: why I can't set the include_path with a htaccess file? I used htaccess for a lot of things on the same server.
In reply to Ant DG

Re: Blank Pages again! When will it end?

by Jai Gupta -
Your host replied in a bit silly way. They don't have to restart apache for it.

You have already tried

php_value include_path ".:/var/www/vhosts/domain.com/httpdocs:/var/www/vhosts/domain.com/httpdocs/moodle/lib/pear"

It should have worked fine provided your host have not used

AllowOverride None

I am surprised, if ini_set is not disabled then Moodle should have updated include_path by itself.

You can ask your host why changing include_path value in .htaccess is not reflecting.
In reply to Jai Gupta

Re: Blank Pages again! When will it end?

by Ant DG -
Jai,
first of all, thank you for your help.

My hosting provider replies quite often whitout helping! triste

I just can tell you i've tried all these:

1. added that line in an htaccess file... They say "AllowOverride None" has not been set, but it doesn't effect anything. Adding "AllowOverride All" or "AllowOverride Options" by myself in that htaccess file results in a 500 error.

2. tried ini_set function, but... you can see by yourself here . This also seems to have no effect, the last line should contain the output from:
ini_set('include_path', ini_get('include_path').':/var/www/vhosts/domain.com/httpdocs/moodle/lib/pear');

3. tried a local php.ini file with this line:
include_path = ".:/var/www/vhosts/domain.com/httpdocs:/var/www/vhosts/domain.com/httpdocs/moodle/lib/pear"
This only would work if I change the way PHP is executed in Plesk: from "Apache Module" to "CGI Application"... Unfortunately we have other apps like Joomla for which we'd prefer PHP to be executed as Apache Module.

The very strange is that all worked since the Plesk update, some days ago!
I don't know what to try anymore triste
In reply to Ant DG

Re: Blank Pages again! When will it end?

by Jai Gupta -
AllowOverride can not be used in .htaccess.

So, as per you test ini_set is not working normally. This makes me understand why Moodle is not able to set path by itself.

As of what I know about Plesk, it does not update just itself, it also updates all components it supports which includes Apache and PHP. Normally a Plesk update should not result into this kind of behavior.

I see you have upgraded to Plesk 9.2, was this a major upgrade (from V8) or it was just a minor update from V9.x?

Can you attach complete output from phpinfo page?
In reply to Jai Gupta

Re: Blank Pages again! When will it end?

by Ant DG -
Yes, I found there are some problems when using Moodle on Plesk, particularly on a shared hosting environment.
I saw that it requires to edit a conf.vhost file adding some Apache directives to override include_path and (also?) open_basedir. One of these posts here.
Now I asked my host if they can set a conf.vhost file.

I confirm, we had a major upgrade: host upgraded Plesk from 8.6 to 9.2, in one shot I think.
This is the phpinfo for one domain: here

By the way, now I'm running another "affected" Moodle in-production site without any problems since I set PHP to run as CGI for the domain (it seems to use the PEAR lib under /usr/share/pear).
Is it secure enough?
Do you think can I safely upgrade now this Moodle site from 1.9.2 to 1.9.4?

Thanks again, Jai.
In reply to Ant DG

Re: Blank Pages again! When will it end?

by Ant DG -
SOLVED!

The problem stays with Plesk: it seems it overrides or simply ignores some PHP settings on a shared hosting. Nor a .htaccess file neither a php.ini can help: Plesk requires that open_basedir and include_path to be updated via a "vhost.conf" file, under a folder path/to/vhost/dominio.com/conf/vhost.conf.

I guess my host used some directives like these:

<Directory /var/www/vhosts/dominio.com/httpsdocs/>
php_admin_value open_basedir "/var/www/vhosts/dominio.com/httpdocs:/tmp:/var/www/vhosts/dominio.com/httpdocs/moodle/lib/pear"
php_admin_value inlcude_path "/var/www/vhosts/dominio.com/httpdocs:/tmp:/var/www/vhosts/dominio.com/httpdocs/moodle/lib/pear"
</Directory>

This finally solved the issue for each domain running Moodle versions above 1.7.
Thank again for you help, Jai.
Average of ratings: Useful (1)
In reply to Ant DG

Re: Blank Pages again! When will it end?

by Jai Gupta -
Antonio, thank you for letting us know your findings.