[OS X] Fatal error in Step 2 of installation
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
I'm attempting to install the Gallery2 beta on the system summarized below. Each time I try to execute "Step 2" in the installation, I get the following message "Fatal error: Cannot redeclare class galleryutilities in /Library/WebServer/Documents/gallery2/modules/core/classes/GalleryUtilities.class on line 50" And that's as far as I get. It's entirely repeatable. Any suggestions on what to change or look for? Thanks// Chris Freeborn ---- |
|
mindless
![]()
Joined: 2004-01-04
Posts: 8601 |
![]() |
hm, haven't seen this before. and retry.. what values do you see? |
|
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
I made the changes you suggested and this was the result printed: /Library/WebServer/Documents/gallery2/ Fatal error: Cannot redeclare class galleryutilities in /Library/WebServer/Documents/gallery2/modules/core/classes/GalleryUtilities.class on line 50 When I removed the two print statements the same error fatal error repeats. Any other suggestions to debug? //Chris Freeborn |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
That is odd. But ok, we can figure this out. From mindless test it looks your __FILE__ directive works. Try removing his lines and then editing modules/core/classes/GalleryUtilities.class and adding this to the top of the file right below the <?php line: printf("<pre>GalleryUtilities: %s</pre>", print_r(debug_backtrace(), 1)); That's a little macro I use to dump out the current location. We should see two stack traces, get printed out. Capture those and post 'em here and we'll have a chance of figuring out what's going wrong. |
|
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
I added the line and the following appears at the top of the first page of the installation: GalleryUtilities: Array ( [0] => Array ( [file] => /Library/Webserver/Documents/gallery2/install/index.php [line] => 44 [function] => require_once ) ) Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Library/Webserver/Documents/gallery2/modules/core/classes/GalleryUtilities.class:2) in /Library/Webserver/Documents/gallery2/install/index.php on line 74 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Library/Webserver/Documents/gallery2/modules/core/classes/GalleryUtilities.class:2) in /Library/Webserver/Documents/gallery2/install/index.php on line 74 And then when I get to the step after "Authentication" I see the following: GalleryUtilities: Array ( [0] => Array ( [file] => /Library/Webserver/Documents/gallery2/install/index.php [line] => 44 [function] => require_once ) ) Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Library/Webserver/Documents/gallery2/modules/core/classes/GalleryUtilities.class:2) in /Library/Webserver/Documents/gallery2/install/index.php on line 74 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Library/Webserver/Documents/gallery2/modules/core/classes/GalleryUtilities.class:2) in /Library/Webserver/Documents/gallery2/install/index.php on line 74 GalleryUtilities: Array ( [0] => Array ( [file] => /Library/WebServer/Documents/gallery2/install/steps/SystemChecksStep.class [line] => 237 [function] => require_once ) [1] => Array ( [file] => /Library/WebServer/Documents/gallery2/install/steps/SystemChecksStep.class [line] => 198 [function] => CheckManifest [class] => SystemChecksStep [type] => -> ) [2] => Array ( [file] => /Library/Webserver/Documents/gallery2/install/index.php [line] => 168 [function] => loadTemplateData [class] => SystemChecksStep [type] => -> ) ) Fatal error: Cannot redeclare class galleryutilities in /Library/WebServer/Documents/gallery2/modules/core/classes/GalleryUtilities.class on line 51 Hopefully this helps! //Chris Freeborn |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Ok, that is interesting. We are including the same file from two different places, but we use something called "require_once" which is supposed to guarantee that it doesn't load the same file twice. Apparently that is failing, which might be a bug in PHP. Let's see if we can figure out why. in install/steps/SystemChecksStep.class on line 237 change: require_once($base . 'modules/core/classes/GalleryUtilities.class'); to: printf("[SystemChecksStep] %s", $base . 'modules/core/classes/GalleryUtilities.class'); require_once($base . 'modules/core/classes/GalleryUtilities.class'); Then on line 44 of index.php, change: require_once(dirname(dirname(__FILE__)) . "/modules/core/classes/GalleryUtilities.class"); to: printf("index.php %s", dirname(dirname(__FILE__)) . "/modules/core/classes/GalleryUtilities.class"); require_once(dirname(dirname(__FILE__)) . "/modules/core/classes/GalleryUtilities.class"); You can comment out or delete the lines you added before. This will generate some additional output when you try the installer. Post that here and we'll see if we can figure out what's going on. My guess thus far is that this is a bug in PHP5, which has some known issues especially on less commonly used server platforms (like the Mac). If you don't want to go through the pain of dealing with unstable software, you might downgrade to PHP 4.3.10. But then again, you're installing G2 Beta so my guess is that you're willing to try bleeding edge stuff |
|
mindless
![]()
Joined: 2004-01-04
Posts: 8601 |
![]() |
bharat, we can also remove that require_once since GalleryUtilities now gets included in index.php |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Duh! Good idea. I've removed that. So this should make this problem go away for cbfreeborn, but I bet he'll have other similar ones. |
|
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
I made the changes suggested and here's the result at Step 2: index.php /Library/Webserver/Documents/gallery2/modules/core/classes/GalleryUtilities.class Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Library/Webserver/Documents/gallery2/install/index.php:45) in /Library/Webserver/Documents/gallery2/install/index.php on line 76 Appreciate your patience and help! //Chris Freeborn |
|
mindless
![]()
Joined: 2004-01-04
Posts: 8601 |
![]() |
this is what i posted in my first reply.. not clear you ever tried it: mindless wrote:
Then remove the two lines you added and also remove the "require_once" line just below them and retry.. this may work. also remove any debug output you added in index.php |
|
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
I forgot to delete the lines as you suggested. When I did delete them, I was able to successfully get through Step 2 and all the way to Step 7. At this point I get the following fatal error message: Fatal error: Cannot redeclare class galleryutilities in /Library/WebServer/Documents/gallery2/modules/core/classes/GalleryUtilities.class on line 51 Progress!! Thanks// Chris Freeborn |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
I think this has something to do with filename case insensitivity on the Mac. I think that even if you get through the installer there are going to be more issues that we'll need to resolve. I've been unable to reproduce this problem on my Mac, though. Would it be possible for me to ssh to your box and check it out directly? Thanks. |
|
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
Well, at the moment I'm in development mode and all of my systems -- including the Mac OS X are behind a router/NAT and not directly exposed. Perhaps you could send me a pm and give me some insight as to options for enabling ssh access. Appreciate your ongoing help. //Chris Freeborn |
|
alindeman
![]()
Joined: 2002-10-06
Posts: 8194 |
![]() |
bharat: joan has experienced this problem too. You may want to talk to her, as she can probably either (1) help resolve it or (2) give you access to poke around. |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Yup, I had this problem. It's a strange bug in php/os x. If you want to see it in action, create files called j.php <?php echo __FILE__."<br>"; include "jj.php"; ?> and jj.php <?php echo __FILE__."<br>"; ?> Then view j.php in your browser. What I saw was this: /Users/jem/Sites/g2/j.php /Users/jem/Sites/G2/jj.php The fix for me was to rename the gallery directory from g2 to G2 and use that in the browser. So try renaming your directory to GALLERY to see if that fixes it. joan - first posting in 10 months!! |
|
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
I changed the name of the gallery2 directory to GALLERY2 and the g2data directory to G2DATA and reran the installation. It failed again at Step 7 with the same fatal error: Fatal error: Cannot redeclare class galleryutilities in /Library/WebServer/Documents/GALLERY2/modules/core/classes/GalleryUtilities.class on line 51 Is the suspected upper/lower case (in)sensitivity causing a problem at an even lower level? //Chris Freeborn |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
This is weird. I tried to pin it down to a small test file, but I couldn't reproduce the problem. Then I thought I'd reproduce it by doing the install again. Despite my doing "everything the same as the first time", the installation went through fine. I've tried a couple more times, and I can't reproduce it. But anyway, are you typing GALLERY2 in the browser? joan - 2nd posting in 10 months! |
|
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
I went back and made sure I used upper-case in the browser access (both Safari and Firefox) and ran into the same fatal error at Step 7. BTW, after this fatal error occurs at Step 7, I get the following error message if I try to access Gallery2 again from the browser: ------------ Error (ERROR_STORAGE_FAILURE) : * in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1136 (MySqlDatabaseStorage::error) ------------------------- I have to go in and delete config.php in order to be able to restart the installation. This scenario might be something that should be accounted for more gracefully in the production version. Thanks// Chris |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
There's no way that we're going to be able to gracefully handle this; as far as I can tell something is seriously wrong with PHP and if PHP is lying to us we can't really cope. I can't reproduce this on my Mac so I can't really debug it. It sounds like Joan can no longer reproduce it either. I need to reproduce it to fix it, I think. Chris, do you have a local sysadmin you can talk to who can help you configure your NAT properly so that we can get external access? Or can somebody here walk him through the process? thanks. |
|
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
I'm the sysadmin (as well as chief cook and bottle washer etc etc) so you can walk me personally through what needs to be done. Thanks for your patience// Chris |
|
Gurami
Joined: 2005-03-14
Posts: 1 |
![]() |
I can reproduce both of the problems mentioned on this thread on my mac: Webserver: Apache 1.3.33 I run into the __FILE__ directive complaint, as well as the error at step 7 mentioned above. I've done a little hacking about and it appears that the problem with the file directive involves the following: inside of SystemCheckStep.class, the magic constant __FILE__ returns a relative path (which looks sth like "./steps/SystemCheckStep.class"), which most certainly makes SystemCheckStep::CheckFileDirective() barf. Curious thing is though, that at a higher level, such as /install/index.php, __FILE__ returns a fully qualified path. I'm stumped. This code works just fine on my OpenBSD box. So, when I just brute force it to pass step 2, i get all the way to step 7, and I hit this problem, but for me it says: Any Ideas? |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Gurami, any chance that I can ssh to your box and inspect this directly? I can't reproduce it on my Mac and it's really hard to figure out how to resolve it if I can't seet it first hand and try tinkering with the code. My guess from what I've heard is that there's not much that G2 is going to be able to do about this. We depend heavily on the __FILE__ directive and it's gotta work properly. If it's busted then we're dead in the water (which is why we check for it as soon as we can and tell you). However, I will be happy to log onto your box and try to isolate it into a small script that we can use to file a bug on bugs.php.net and get them to fix it! But I need access... |
|
cbfreeborn
Joined: 2005-03-10
Posts: 10 |
![]() |
Bharat - Has there been any further troubleshooting or testing re this problem? I'm willing to offer you access to my system if we can work out the logistics. Thanks// Chris Freeborn |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
Sadly, I'm baffled. Gurami gave me access to his box where he was having the problem, and when I tried to install -- I had no problems! So I still can't reproduce this |
|
littlejo
Joined: 2005-03-23
Posts: 1 |
![]() |
I am experiencing the same issue that is being discussed here. If you would like, I can offer another test envionment... |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
littlejo, I'd love to test it out in your environment. Please send me your ssh details via private message and I'll try it out. Thanks. |
|
chadmriden
Joined: 2005-09-22
Posts: 4 |
![]() |
I have the same problem with Gallery 2.0 as I click on "Continue to step 3" - Fatal error: Cannot redeclare class galleryutilities in /Volumes/binky/WebServer/Documents/tools/gallery2/modules/core/classes/GalleryUtilities.class on line 50 OS X Server 10.3.9 |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
chadmriden, please PM (write to author) bharat. he may not have that much time (right now), but if you can give him SSH access such that he can debug your issue, maybe he can find the time, since it seems to be an important issue. |
|
bcbrock
Joined: 2005-09-25
Posts: 2 |
![]() |
Has a solution been found for this thread yet? I tried to install G2 today and got the same error message during step 3. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
there are a couple of issues in this thread. do you mean "cannot redeclare" or the __FILE__ issue? |
|
bcbrock
Joined: 2005-09-25
Posts: 2 |
![]() |
Sorry... mine is the 'cannot redeclare' weird issue. If needed, I can set up a user on my OSX Box for ssh access. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
please read my last answer for chadmriden, the same applies to you. |
|
chadmriden
Joined: 2005-09-22
Posts: 4 |
![]() |
I can't get a test account with ssh access to that box, but I'm working on setting up a mirror that we can put test accounts on.. |
|
masi
Joined: 2005-05-02
Posts: 6 |
![]() |
I've the same problem. I'm running Mac OS X 10.4.3 with Apache/1.3.33 (Darwin) PHP/4.3.11 |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
from #gallery (irc) Quote:
20:23 masi Hi, i got the __FILE__ directive error on OS X. on the forums valiant says my php is bugged and g2 won't work. though it works from my home directories public directory... |
|
airboy808
Joined: 2006-07-28
Posts: 4 |
![]() |
any updates on to get this to work? |
|
chadmriden
Joined: 2005-09-22
Posts: 4 |
![]() |
I upgraded php to 5.1.x & it worked just fine. That broke some of the functionality of the default os x server version of SquirrelMail, but if you upgrade that to the latest-greatest, it works ok too. |
|
airboy808
Joined: 2006-07-28
Posts: 4 |
![]() |
we got php 5.1.4 installed but still get: Fatal error: Cannot redeclare class galleryutilities in /Library/WebServer/Documents/gallery/modules/core/classes/GalleryUtilities.class on line 50 I have not tried all the code mods from above. Is that what you did chadmriden? thanks |
|
chadmriden
Joined: 2005-09-22
Posts: 4 |
![]() |
I didn't modify Gallery at all. Now that I think of it, I may have upgraded to server 10.4.x before re-attempting the Gallery2 install.. so if you're on 10.3.x there might be more fundamental issues. |
|