I've installed Drupal 4.7.3 and the first thing I did was to install the latest (4.7) version of Views. I then activated the views module. Refreshing the modules page in administration gives a blank screen. Deleting the module directory (of views) gives me back the modules page. Reinstallation of views breaks the site again.

Clearly this is some serious problem of views.

My setup is:
- LAMP, with:
- MySQL (version 4.1.13 / release 3.6)
- PHP5 (version 5.0.4 / release 9.13)

Maybe this problem is related to: http://drupal.org/node/77615

Comments

mo6’s picture

Forgot to mention: installation on PHP4 / MySQL 4.0 doesn't show this problem. Also I tried to raise the memory_limit of PHP from 32M to 64M to 128M to no avail.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Clearly this is some serious problem of views.

This is the 2nd time this week someone has said "Clearly..." and then proceeded to say something that is not, in fact, clear.

First, see: http://drupal.org/node/31819

If that doesn't resolve your issue, look in your php or webserver error log and look for an actual error that's provided. As far as I know, Views works fine under PHP5.

mo6’s picture

Title: Views not PHP5 compatible? Installation gives blank screen » Activation of views module gives blank screen (on PHP5 server)
Status: Closed (won't fix) » Active

Others have mentioned the error from the log file:

[client 127.0.0.1] PHP Fatal error:  %v%v() [<a href='function.require'>function.require</a>]: Failed opening required 'modules/views/modules/views_node.inc' (include_path='/usr/share/php5') in /srv/www/htdocs/viewtest/modules/views/views.module on line 18, referer: http://localhost/viewtest/?q=admin/modules"

You can read in my follow-up that raising the memory limit in PHP doesn't solve the problem.

On other setups (on several other [PHP4] servers) views works perfectly with me, on this particular setup (on this PHP5 server) views just gives a blank screen. Other (quite eloborate) Drupal installations on this server work fine.

I hope someone can give a clue about this problem. Thank you for your help.

merlinofchaos’s picture

Others have mentioned this. Are you getting that error?

merlinofchaos’s picture

Tell me if changing line 18 of views.module to this helps:

      require_once("./$file->filename");
mo6’s picture

OK, I've been debugging some things myself and found out that the following patch seems to solve the problem (in my installation [YMMV!]):

--- ../orig/views/views.module  2006-08-26 03:01:56.000000000 +0200
+++ views/views.module  2006-08-27 23:06:22.000000000 +0200
@@ -15,7 +15,8 @@ function views_init() {
     // The filename format is very specific. It must be views_MODULENAME.inc
     $module = substr_replace($file->name, '', 0, 6);
     if (module_exist($module)) {
-      require_once($file->filename);
+//      require_once($file->filename);
+      require_once('modules/'.$file->basename);
     }
   }
 }

It looks like there's a difference in the inclusion mechanism of PHP5 in comparison to PHP4.

mo6’s picture

@merlinofchaos: Yes, your change seems to work as well. Thank you for getting back.

mo6’s picture

I'd suggest using include_once instead of require_once. In the case of a missing include file the latter gives a blank Drupal while the former displays helpfull PHP errors in Drupal (but the site still works).

mo6’s picture

Status: Active » Fixed

I see your patch is already included in the latest distribution. Thank you for the quick fixing.

merlinofchaos’s picture

Theoretically, it's working from a list of files that's already there, so require_once should be the most efficient (include_once is apparently a bit slower) way of getting it in. And if it's not there, how did it show up in a file list?

mo6’s picture

Theoretically, a file can exist and appear in the list but cannot be read due to lacking permissions.

Wait, I'll test that hypothesis...

Indeed, changing permissions of a file so that the webserver cannot read them results in a blank screen. Whereas, if the file was included with "include_once" Drupal issues a warning.

mo6’s picture

Status: Fixed » Active

Just realized that there are two other places in the module where require_once is used (lin 619 and 1003). These fail in my setup too. Prefixing the include strings with "./" fixes these.

zach harkey’s picture

Hey fellas,

I was having this same problem.

Tried everything I could think of and finally resorted to the tried and true method of waiving money in the air (see: Zach's $50 white-screen-of-death challenge! (celebrity challenger: views.module)). That thread documents the entire troubleshooting sequence which revealed some nuggets that might be of interest to merlinofchaos & co.

In the end, the silver bullet (for me) was to upgrade to PHP 5.1.4. and the latest version of Views. Many details in the thread if you're interested.

-zach

merlinofchaos’s picture

Status: Active » Fixed

I believe I have fixed the bug that caused this.

mo6’s picture

I've tested the September 2, 2006 - 05:46 version of views 4.7 and the include problems seem to be fixed in php5. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)
archetwist’s picture

Status: Closed (fixed) » Active

I'm using the October 8, 2006 version. I'd upgraded to PHP 5 and then I saw that my view (which I'd created under PHP 4) was blank.

merlinofchaos’s picture

Status: Active » Closed (fixed)

Unless you're 100% sure that this is related, please

1) file a new bug
2) Provide enough detail for me to be able to actually do anything.

archetwist’s picture

e0ipso’s picture

I had the same problem under 6.13. The php log suggested it was a matter of memory of the script (lots of modules installed), increasing the memory limit to 32M solved the problem for me.