$50 to the first person to rescue me from my living hell.
Consider the following conundrum:
- 2 identical working Drupal websites
- Each residing on a different dedicated Linux / Apache 2.0
- Both websites have identical clean installations of Drupal 4.7.3 (default modules, default blue marine theme, etc.)
- Both websites are setup to use the exact same physical MySQL 4.1.19 database (which resides on a 3rd dedicated, db-only server)
- Both have memory_limit set to 50MB
The problem arises when I try to enable the views.module (v 1.142 2006/08/04 16:00:46)
One site works fine, the other site gives me a white screen of death (no error messages, not in server logs or anything). It happens on and off from the second I hit submit on the modules page. The white screen is site-wide — no URI's work. Physically removing the 'views' directory from /modules/, fixes it immediately.
Researching drupal.org for the last 2 days has revealed the following short list of confirmed causes of similar behavior, followed by my steps to address each:
-
Not enough Memory
I admit this smells like a memory issue, except that both sites have the memory_limit set to 50MB (which should be more than enough, although I've experimented upwards of 128MB with no improvement), and one site works fine. -
Cache corruption
I have repeatedly emptied the cache to no avail. -
Database corruption
Both sites are using the exact same - brand new - database, and one works fine.
The biggest difference between the two environments is the fact that the working site uses PHP 4 and the non-working site uses PHP 5, which leads me to believe it's one of the many PHP config settings, I just don't know which one. But I have a crisp $50... (paypal payment) for the first person who does :D
* Note: Both websites, and their complete info.php files are temporarily available for side-by-side comparison HERE.
Comments
Are you using the cache? If
Are you using the cache? If so don't... Does it work now?
Pobster
No, not using cache.
No, not using cache.
-zach
--
harkey design
: z
Another PHP5 site having problems
You're not the only one reporting this problem. This issue http://drupal.org/node/77615 mentions that it "worked before my ISP upgraded to PHP 5"
Onward....
------------------------------
Adding Understanding
--
PHP Error logging
Can you turn PHP Error Logging on and see if a message is being logged.... Or, once you remove the /views directory and the site starts to work again do you see errors in the drupal error log?
I just put views on a PHP 5 laptop (OS X) and it seems to work fine.... which speaks against some sort of blanket PHP 5 challenge.
------------------------------
Adding Understanding
--
I have PHP error logging on
I have PHP error logging on and set to report all errors, yet for some reason, nothing shows up in the logs, nothing at all. It is the strangest thing. Even once I remove views from the module directory, nothing shows up in the server logs, or the drupal admin logs.
That's what puzzles me most. I can't get any errors to print.
I have the following set in my .htacces file:
-zach
--
harkey design
: z
error_log
You should use php_flag to set boolean values instead of php_value.
(http://us2.php.net/configuration.changes)
I'd also use 'php_flag log_errors on' instead of 'php_flag log_errors 1'
You might also add an error_log directive with the file name of where to save the error log.
In looking at the PHP info it is reporting that both server-wide and for the local directory log_errors is set to OFF but likely because of the php_flag being needed.
------------------------------
Adding Understanding
--
Ok, thanks. My .htaccess
Ok, thanks. My .htaccess file now reads:
But still no errors actually display in the log.
-zach
--
harkey design
: z
re: your php5 problem
I'm not much of a wiz and I don't even use PHP5, but I think it has to do with your PHP5 config not parsing the drupal.ini module. All I know is that it's supposed to appear in the *additional .ini files parsed* section and it's not there (while it is under your php4 install and in other php5 installs that i was able to check).
efolia
Hmmmm.... That definitely
Hmmmm.... That definitely sounds fishy. What could be preventing the drupal.ini from being parsed? Is there a way to test this by manually forcing it some way?
(off to learn about additional .ini files)
-zach
--
harkey design
: z
When I remove views from the
When I remove views from the modules directory, the white screen disappears and the site returns to working order, even though the drupal.ini file is still not showing up in the *additional .ini files parsed* section.
Though, I'm not sure exactly what, if anything, this implies.
-zach
--
harkey design
: z
php error reporting
Definitely try getting PHP error reporting turned on. I had a similar problem with a module causing a blank white screen unless I deleted the whole thing... then I tried installing it on my own machine and guess what! There was a PHP parse error in the module. My admin had php error reporting off, presumably for security reasons.
what might be going on
difference between php4 and php5 and/or respective php configs
-> leads to parse error or similar error that supercedes the display of content
-> leads to blank white screen if errors are suppressed
-> leads to strange mystery problem (rather than known one)
If there is an error message and you can get that error message, you're a lot closer to finding the exact problem.
I just can't seem to get
I just can't seem to get any errors to appear.
Like I was telling Josh B above, I have the following set in my .htacces file:
I even went into common.inc and manually changed the
error_handler()functionfrom...
(E_ALL ^ E_NOTICE)to...
(E_ALL)as recommended for testing in this handbook page.
Am I doing something wrong, Is there something additional I should be doing?
-zach
--
harkey design
: z
Hmm, that looks right...
Hmm, that looks right... (although I should mention that notices wouldn't stop anything else from being displayed).
The only thing I can think of is that the root configuration--in httpd.conf or php.ini or whichever--is disallowing you from enabling error reporting (not sure why it would be configured that way and foggy about how it could be). Presumably since you're using Drupal .htaccess files are already allowed to override stuff.
You could try a good old
phpinfo();in the directory to see whether the error reporting is actually being set as you are specifying. Of course, it's always possible phpinfo has been disallowed for security reasons. In that case, here's a simple test I might try: make a test.php file with some really invalid code in the same directory that has your .htaccess.Visit the file directly in your browser and see if you get a parse error. If you don't, then error messages are still being suppressed for some reason. If you do, then it seems there is no error message and the problem is something else (drupal php isn't getting executed at all, or is and is just returning an empty string instead of the page source, or whatever other problem).
Another thought, you could try setting the error reporting level from within said PHP script in case .htaccess isn't being interpreted properly. See:
http://us3.php.net/manual/en/function.error-reporting.php
The phpinfo files for both
The phpinfo files for both versions can be compared HERE .
-zach
--
harkey design
: z
Right, sorry. Missed that
Right, sorry. Missed that the first time through. :) PHP does in fact believe error reporting is on from the phpinfo. And I do see the notices right up top on both Drupal sites! So it looks like that's working fine.
Did you try generating an error with junk code in a non-drupal file? If it were me, that would set my mind to rest that the problem did not lie in a PHP error.
re: your problem
disable the views_theme_wizard.module (suffix the filename with an underscore character) and/or you could try re-enabling the cache. Looks like all your errors are cache-related.
efolia
I did what you said and
I did what you said and renamed views_theme_wizard.module to _views_theme_wizard.module. The site worked again, until I went to the modules page and clicked submit then it went right back to the white screen. I keep emptying the cache over and over again.
-zach
--
harkey design
: z
Ok, on a whim, I completely
Ok, on a whim, I completely removed the drupal .htaccess file and immediately got my first error message in a long time. (It's a strange feeling to actually feel joy when you see an error message).
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 23040 bytes) in /home/httpd/vhosts/dynatech.harkey.org/httpdocs/modules/views/views.module on line 1280
So I replaced it with a new .htaccess file that only had the following rule:
White screen again, and nothing will bring it back aside from removing views directory altogether.
-zach
--
harkey design
: z
i'm pretty sure it has to do
i'm pretty sure it has to do with some variable caching problem. That's why you should disable the views_theme_wizard.module ... actually more like removing it (or like this: views_theme_wizard.module_ ) ... the way you did it, the drupal module handler still recognized it as a module (the name is irrelevant) and it goes through the code. The caching parameter of the menu function is the cause your errors (the $items variable is not properly initialized). The only difference is that you wont have access to the theme wizard (until you debug it somehow). Otherwise views will still work: theme wizard is a minor add-on for all I know, unless you're doing a lot of theming for lists.
There's a new version in HEAD for that specific module (1.3), but the only difference is it prevents a problem when there's no views available where there should be some.
efolia
efolia, I see now that you
efolia, I see now that you were saying to SUFfix the underscore, I had just prefixed it. I ended up removing it altogether, then immediately emptied the cache, but still no dice.
When I remove the whole views directory, the site comes back, if I put it back(even with the views_theme_wizard.module completely removed), blank screen.
So how can it be the the_wizard?
(btw I really appreciate all the troubleshooting help, especially efolia and xjm, who are neck-in-neck for the prize)
-zach
--
harkey design
: z
Because the
Because the views_theme_wizard kept returning you errors on functions that used the cache. Here's the reasoning.
This code was returning an undefined variable (namely, $items):
...because it's somehow assuming that the $may_cache is set to TRUE. The code should actually read like:
(although apprently this is not a problem per se, since undefined variables take a NULL value, which is fine for hook_menu to return). Well that was the logic behind my reasoning: that by removing the theme_...module you'd somehow circumvent the problem (even though the *undefined variable* notice is not a problem normally.) Still, the $items array was left undefined, meaning that $may_cache is a parameter that is set to FALSE -- which in turn means that Drupal *thinks* the module is already set in admin and that it is cached (which in your case is an error, most likely triggered by the state of your database).
Everything points to a caching problem by Drupal. Even though views.module implements hook_menu -- function views_menu($may_cache) -- the function that implements it does initialize $items explicitely. Still, if the $may_cache is set to false, then the function will bypass building the navigation menu. This will create a problem as the menu block ends up with no content -- and God knows what this does to Drupal. In any case, I'd try the following steps:
remove the views module completely
run update.php on the database (from the administer/module: it's a link in the text, just in case you didn't know) : that will clear the Drupal cache
exit Drupal, put the views module back in the module folder, re-start Drupal and enable views and its related modules
run update.php again but this time for the views module only (and the related ones such as ui and rss and theme) -- choose the module name to update in the *select version* option.
finally, set the access rights accordingly
I guess the cache problem is due to the fact that you are using a database that's filled already. As to why this error comes up as critical under PHP5 but not under PHP4, I have no idea. lol
Hope this helps
efolia
efolia, I followed your
efolia,
I followed your instructions exactly but it didn't work.
So just to make certain no cache issues could bite me in the ass, I even re-installed Drupal from scratch and created an entirely new database and loaded the default MySQL 4.1 Then I uploaded a fresh version of the views module (without the views_theme_wizard) into the new modules directory.
The only action I performed on this new site was to try to activate the views module but when I hit Submit, I got the white screen :(
This has to rule out the views_theme_wizard.module (at least as being the only cause), doesn't it?
Here is what the server tech at my host said:
I tailed the main error log at /var/log/httpd/error_log as he suggested and sure enough, the moment I hit Submit on the modules page, the following errors appeared
Of course, I have no idea what, if anything, this implies. Does it provide any new clues?
-zach
--
harkey design
: z
Mmmmm... segmentation faults
Mmmmm... segmentation faults are usually due to an apache configuration problem or some bug in a php module (more often than not, db related). Or it could be anything in the middle. Unless you're willing to dwelve into the intricacies of configuration, dependencies and management, you're going to have to solve that problem some other way. This is probably mySQL related. Did you try installing the mySQL db locally?
If this does not work and this was me, at this point I'd consider switching servers, if only for testing purposes. I'm sure someone will lend you some space on their server for a day. Beside, good servers go for 7$ a month nowadays (I use bluehost) -- so for that 50$ ...
Cheers,
efolia
As you suggested, I tried
As you suggested, I tried installing the MySQL db locally, same result. After that didn't work, I tried using yet another remote db server (that was already hosting many Drupal sites + views module) and I got the same error.
As far as switching servers for testing purposes, I've got the same exact test site working fine on a different server with Apache/2.0.51 (Fedora) PHP v 4.3.10.
See what happened is I tried to add the Views functionality to an extremely busy site (a site that I had just spent a long time moving to its own dedicated, performance tweaked box with separate db server etc.), and it immediately crashed the site. So I set up the basic test site to try to hunt down the problem without messing up the live site. Once I got everything ironed out, the plan was to re-enable the Views module on the main site.
It was a real pain to move the busy site in the first place, so the idea of moving it to yet another server in the hopes that I will avoid some elusive bug without knowing where the bug even lies, makes me feel ill.
For the moment, since I'm bleeding money on this job, I'm going to have to give up on Views altogether in favor of a ridiculous mountain of page snippets et al : ( — but I'm fairly certain that whatever this is is going to continue to surface in the future, so I'm really just moving deck chairs around on the Titanic.
What puzzles me is that there seems to be plenty of people using Drupal 4.7.3 with Views module on Apache 2.0 with PHP 5 without these catastrophes.
I was beginning to think that I might be able to switching back to PHP4 on this same server, but after reading Zane Dog's post (below) and the thread he references: Segmentation Fault with 4.7 I'm hardly optimistic and even more uncertain where the actual source of this problem lies.
Have I at least ruled out MySQL now that I've tested several combinations of local and remote databases on MySQL 4.1.16 and MySQL 4.1.19 with the exact same result?
Next, should I be looking at my Apache 2.0 configuration (httpd-2.0.54-10.3), or my PHP 5 configuration, libraries, etc. , or my OS (Fedora Core 2), or even my hardware, does the fact that it is an x_64 system affect things? Or is it just as likely to be any combination therein?
-zach
--
harkey design
: z
look at this
look at this:
http://fr.php.net/ChangeLog-5.php
the first line of the change log is at least intriguing...
You're right, it probably is related to x_64. If this was me, I'd try switching to the latest build of PHP5 before spending too much time tracking an elusive bug (specially since I'm no wiz when it comes to apache and system configuration).
cheers,
efolia
Going to try upgrading to
Going to try upgrading to latest PHP 5.1.6
-zach
--
harkey design
: z
good luck with this. check
good luck with this.
check the new version of views first though. look at my other post at the bottom of this page.
efolia
WOOOOOT!!!
Upgraded PHP to 5.1.4 based entirely on efolia's recon, and now EVERYTHING WORKS!!!!!!
God what a brutal experience.
Efolia, that was some tenacious troubleshooting my friend. My hat is off to you. You are the clear winner of "Zach's white-screen-of-death challenge". Just tell me where to send your $50 prize.
Thanks everyone, for all the help.
P.S. Before I upgraded PHP, I did install the new version of Views, but the site still crashed. I guess, it's possible that the fix was a combination of the new version of Views and the PHP upgrade, but at this point I'm not inclined to care.
-zach
--
harkey design
: z
Did you try adding
Did you try adding print_r("") in _menu_sort as prescribed in 63181? I would be interested to know whether it helps or not.
Zane, I tried adding the
Zane, I tried adding the print_r("") in menu.inc then emptied the cache, etc.
No dice.
-zach
--
harkey design
: z
Dang
Well, I would suggest trying to pin down where (in php code) the crash occurs.
I did this by using debug print statements, such as
print_r("entering node_load<br/>"); flush();
To see what was being called before the crash. I also used
var_dump(debug_backtrace()); flush();
To examine the call stack, to give a guess as to where to put the next print statement.
It was quite tedious but I eventually narrowed it down to _menu_sort, added the voodoo there.
I haven't had a crash since doing that.
Now, really the proper way to proceed would be to debug the php interpreter itself, but I'm not quite there yet.
that answers a couple questions
So you know for sure that it's not a PHP parsing or memory issue then, since you do get a memory error that then goes away. And since it's the same db server, that leaves only the caching issues as efolia is suggesting.
As an aside, maybe I should offer $50 in the title of my threads to get more attention. ;-) Only problem being that I don't have $50.
50$
Maybe we should do it like this: whoever gets the 50$ applies it to his or her most pressing thread, and so on. Maybe we should even put together a Drupal-driven website to track it down. tag-a-thread dot com. ;-) If only we could get the paypal people to waive the fees... LOL
efolia
"Segmentation fault"
The "Segmentation fault" log entry is significant. It probably means that the php interpreter itself has a bug. It seems very much like this problem, even though that was with PHP4. I was pondering switching to PHP5 to avoid it...
See in particular my two postings in that thread about voodoo programming workarounds.
a long shot
But I got Apache child process death, no errors, when I tried naming a theme and a module the same (style and functionality were being developed for one client). Took me ages to solve.
So on the off-chance ... you didn't name a theme 'views' did you?
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Aside from the views module,
Aside from the views module, the entire installation is completely default. In fact, the only administrative task performed, aside from actually registering the original admin user, was the attempt to enable the views module.
-zach
--
harkey design
: z
new version of Views
The new version of Views may just be what you're looking for... who knows.
http://drupal.org/node/77615
efolia
Merlin
Zach,
did you try emailing merlin or submitting an issue? He gets a lot of issues but if he sees one that puzzles him he'll stay on it.
sounds like your problem
http://drupal.org/node/80994
hey Zack, I'm going to claim your $50 if my solution works! Merlin just committed a new version of views to solve php5 problems. My solution is -- install the newest version.
We already have a winner
The prize has already been awarded to efolia (see here). He should be lighting cigars with money as we speak.
Sorry mariun, so close. Just a few days too late. However, you are right about the PHP update. Updating to PHP 5.1.4 and the newest version of the views module (as per efolias' earlier recommendation in this thread), solved the problems I was having.
You're right that this thread would probably be of interest to merlinofchaos, but I'm not going to file a bug report since it is fixed, right?
Again, thanks to all the challengers. Stay tuned for my next challenge.
-zach
--
harkey design
: z