Get white screen when trying to go back to parent folder.
photoric
Joined: 2007-04-04
Posts: 25 |
Posted: Sat, 2007-05-12 04:59 |
I recently embedded g2 into my web site (www.photorichards.com) as the default page with a lot of help from the forum. (see discussion at: http://gallery.menalto.com/node/64174). I thought it was working well at first but didn't recognize that it was because I was actually viewing the php installation of g2. (http://photorichards.com/gallery2/main.php). This works well. When I viewed the embedded installation (http://www.photorichards.com/gallery2/gallery2embedded.php), I could not go back to the parent folder or the home page from viewing an image. It would just give me a white screen. If I clicked on the logo of the web site, it would go back to the home page. This is my setup: g2 is at /home/public_html/gallery2 which is the same as http://photorichards.com/gallery2 gallery2embedded.php is at /home/public_html/gallery2/gallery2embedded.php index.php is at /home/public_html/index.php index.html has been renamed. I expect that I need to change some code somewhere, but I don't have the faintest idea where to begin. I would appreciate any help I could get. Thanks. The following is the contents of gallery2embedded.php <?php $g2_Config['embedPath'] = '/gallery2/gallery2embedded.php'; //print_r($g2_Config); // handle the G2 request foreach ($css as $item) { |
|
Posts: 352
FAQ: I get only a blank screen when trying to view my Gallery, what's wrong?
FAQ: I get a blank page / a network/webserver error, what's wrong?
Steve Lineberry
Posts: 25
Thanks for the resources, Steve. I'll get on it.
Posts: 25
I've read and reread the above sections on increasing php memory and have instituted each of these changes:
editing the .htaccess file by placing the lines: php_value memory_limit [new memory limit] and php_value memory_limit 24M caused me to be unable to get into gallery 2 at all, so I removed them.
I then placed this line: ini_set("memory_limit","32M"); into the istall/index.php and main.php files, but nothing happened. It did not correct the problem.
I put gallery 2 in debug buffered mode but could make nothing of it. I can supply the information, if it would help.
I looked in the phpinfo page (I am using version 4.4.1) and there was no "memory_limit" parameter listed, so I called my web site tech help and was told that he could not increase my php memory. He said that if I bought their $30.00/month package, I would be able to make changes, myself.
At this point I have run out of options. I still get a blank/white page when I try to go back to the parent folder after viewing an image. Are there any other suggestions anyone would have?
Thanks.
Posts: 25
I have been snooping into this further. At this point I don't think this problem is due to insufficient php memory. I think it is due to broken home page and folder links at the top of the gallery 2 page.
Here is why I say this: When I am at the home page and click on a folder BEFORE viewing an image, I notice that the url at the top of the browser is different than the url I get when I click on the folder link at the top of the page AFTER viewing an image, which is when I get a white/blank page. If I correct the latter url to match the former, then I am taken back to the folder level. It seems that the folder link is not pointing back to the folder level after viewing an image.
Also, if I click the logo of the web site from anywhere in gallery 2, I am taken back to the home page. If I click the home page link at the top of the page AFTER viewing an image, I get a white/blank page. The url in that case is different than the url after clicking the logo. If I correct it to match the other one, I am taken back to the home page.
The links are not pointing back to the levels they say they are. Could this be a matter of changing the php code to restore the links?
Posts: 32509
you're probably outputting html / newlines / anything before or after g2 wants to the set the HTTP Location header to redirect to the correct album page.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 352
Try turning on output buffering
Steve Lineberry
Posts: 25
Thanks for the help, but I'm having a hard time understanding your suggestions. From what I can gather reading about your two suggestions (valiant and Steve), the html/newlines my
program may be outputting would cause blank pages and turning on output buffering would bury the output in the buffer, thus preventing the newlines? Please clarify.
I tried turning on output buffering by making a php file entitled output buffering.php and placing it in the same directory as my gallery2embedded.php file which is located in: /home/ public_html/gallery2/ The file contains the following information:
<?php// start buffering the outputob_start();?>
Is this the correct information for the file and is the file placed in the right position?
It did not prevent the white pages from occurring when trying to migrate back to the parent
folder or the home page using the links at the top of the gallery 2 page.
Here is the url migrating forward from the home page to a certain folder in my embedded g2:
http://photorichards.com/gallery2/gallery2embedded.php/v/Amsterdam+to+Berlin----6-2-06/
Here is the url migrating to a certain image in that folder:
http://photorichards.com/gallery2/gallery2embedded.php/v/Amsterdam+to+Berlin----6-2-
06/Germany+6-2-06+DSC_0049.jpg.html
Here is the url migrating backwards from that opened image back to the parent folder. This gave me a white page:
http://photorichards.com/gallery2/gallery2embedded.php/v/Amsterdam+to+Berlin----6-2-06/?
g2_highlightId=586
If I remove all the information after 6-2-06/ then I will get back to the gallery 2 parent folder with no white page.
Does that information help clarify the problem?
I am not sure what more to do with the information you gave me. Please be basic in your
replies, since I am new at this.
I also tried uninstalling the g2 rewrite module but could only get to the "site admin" site
in the main.php installation and not in the embedded installation. The latter would give me a
white page. It made no difference. I then reinstalled it and tried to reconfigure it, but
I don't think it is reconfigured correctly, because it only says "The parser you have
selected does not support a referer check," and when testing it I only get one statement:
"Testing if the server supports PHP Path Info. (success)," instead of the other test statements
about the .htaccess files. (See http://codex.gallery2.org/Image:EmbeddedRewrite_-_Clipboard05.jpg) Would that be related to the problem?
Thanks for your help.
Posts: 352
Typically I edit my php.ini file but you can also add the
but you have to add it to the top of the gallery2embedded.php file.
I would get all of this worked out first before enabling URL rewrite. Once you have everything working as expected, then enable the url rewrite.
Steve Lineberry
Posts: 25
OK, Steve, I was unsure how to go about editing the php.ini file, so I added ob_start(); to the top of the gallery2embedded.php file, and I uninstalled URL rewrite.
Then I reinstalled URL rewrite in the embedded g2. (I figured a way to get into the admin area on my embedded g2.)
It said that "For URL Rewrite to work in an embedded environment you need to set up an extra .htaccess file to hold the mod_rewrite rules." So, I created a file called embedded.htaccess and placed it in the gallery2 folder along side of the gallery2embedded.php file and the empty .htaccess file that was already there. I gave it 666 permission.
When I tested to see if gallery 2 could write to the embedded.htaccess file, it failed. It did pass the Apache mod_rewrite test and the Gallery .htaccess file test but could not write to the extra .htaccess file it asked me to write(embedded.htaccess file).
I am having trouble finding the "Absolute path to the folder of your embedded .htaccess" I thought it should be /home/public_html/gallery2/ but that doesn't seem to pass the test. I have tried a number of combinations, but still no success.
Also, this throws me: "Please enter the Url to your environment. E.g. http://www.mySite.com/myNiceCMS/ It has typed in http://photorichards.com and I filled in the blank after that with / but that doesn't do the trick. What do they mean by "environment?"
What I find interesting is that I can hit the back arrow on my browser and it will take me back to the parent folder, and I can make the URLs of the embedded g2 match those of the unembedded g2 and get back to the parent folder, but clicking on the link for the parent folder at the top of the g2 page doesn't do it, because it sticks a lot of extra information at the end of the URL. Why does it do that and what can I edit to make it behave? Thanks again for your help?
Posts: 25
Here is the error info I get when I try to save the above configuration to URL Rewrite:
Error
An error has occurred.
Back to the Gallery
Error Detail -
Error (ERROR_UNSUPPORTED_OPERATION) : rewrite module is active
in modules/rewrite/SetupRewrite.inc at line 132 (gallerycoreapi::error)
in modules/core/SiteAdmin.inc at line 201 (setuprewriteview::loadtemplate)
in modules/core/classes/GalleryView.class at line 300 (siteadminview::loadtemplate)
in main.php at line 443 (siteadminview::doloadtemplate)
in main.php at line 96
in modules/core/classes/GalleryEmbed.class at line 179
in gallery2embedded.php at line 32 (galleryembed::handlerequest)
System Information
Gallery version 2.2.1
PHP version 4.4.1 apache
Webserver Apache
Database mysqlt 4.0.16
Toolkits SquareThumb, ImageMagick, NetPBM, Gd
Operating system FreeBSD st84.startlogic.com 4.11-STABLE FreeBSD 4.11-STABLE #0: Wed Apr i386
Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Does that help?
Posts: 25
Sorry for so many posts, but I am trying to work this out and give you info that might help. I have URL rewrite configured for 3 out of 4 successful tests now: "Apache mod_rewrite," "Gallery .htaccess file," "Embedded .htaccess file" but not for "Embedded .htaccess file is up to date." Nothing is written in the embedded.htaccess file at this time. I did figure out the path to the embedded.htaccess file. I tried an end run around item 4 by copying and pasting the contents of the stand alone .htaccess file into the embedded.htaccess file but the test didn't even show that it was run. I'm not sure how to get the program to write the rules into the embedded.htaccess file like it did into the .htaccess file. I'll keep working on it.
I also went to the maintanence section and ran the "check short style URLs for filesystem conflicts" test and there is one conflict: "Checked 167 items and found 1 conflicts
Bad path: Gallery Home Page: http://photorichards.com/gallery2/gallery2embedded.php" Is that related to the main problem of getting a white page when using the folder link in g2 to return to the parent folder? I get no conflict when I run the same test on the unembedded g2 installation.
Thanks, again.
Posts: 352
Like I said before. Let's get your g2 working fine without the url module active. So deactivate it and make sure everything works including going to the parent album.
BTW, i'm pretty sure it has to be named .htaccess and you can't just name it embedded.htaccess. You need to have this file in a different directory, most likely your root.
On one install I put the .htaccess file in the root. To get my embedded gallery2 working I got url rewrite working while not embedded. Then when i'm embedded I resetup the url rewrite. I set the path to be my root of the site and a put a / for the url. Check out http://pictures.thelineberrys.com/gallery2embedded.php
In another install which might be more appropriate for your I used the path to my gallery2 folder and used the url /gallery2/ and that seemed to be working just fine. So I just reused the normal .htaccess file and didn't create a new one. Check out http://www.eclecticthreadsclothing.com/gallery2/ForSale/
Steve Lineberry
Posts: 25
OK, thanks. I'll get on that and report back.
Carl
Posts: 25
OK, Steve. I followed your latest instructions:
1) I deactivated the url module in the main.php (unembedded) and the embedded.php g2s.
2) I eliminated the embedded.htaccess file I had created and to which the program would not write, anyway. I left the .htaccess file in the gallery 2 folder.
3) I got both the main and embedded g2s working moving forward to the images and backward returning to the parent folders and g2 home page. That took some doing, and I am still not sure how I accomplished that.
4) I then reinstalled the url module for the unembedded g2 (main.php) and got that configured.
5) I then reinstalled the url module for the embedded g2 and configured it. I got both of these g2s to test our without error.
6) After this both g2s (nonembedded and embedded) worked going forward and backward.
8) I then went to www.photorichards.com from a different computer in our house and the site seemed to work well.
However, I noticed in the url at the top of the browser that the url changes from embedded.php to main.php after I start browsing through my web site from that other computer. All the browsing after that seems to be not in the embedded g2. Is it supposed to do that or is it supposed to stay in the embedded g2? Is that opening my web site up to intrusions?
One other problem remaining is that when I run a "Check short style URLs for filesystem conflicts" in the maintanence section of the administration page of the embedded g2, I get an error: "Checked 167 items and found 1 conflicts
Bad path: Gallery Home Page: http://photorichards.com/gallery2/gallery2embedded.php" This does not happen in the unembedded g2.
I would like to correct this, because I think, if I don't, it will come back to haunt me. I can't help feeling that this has been related to some of my problems, and that my site will revert to malfunction after a while, if I don't correct this. Thanks for your help.
Posts: 352
Can you post your .htaccess file? Thanks.
Steve Lineberry
Posts: 25
Here is the .htaccess file which is located in /home/public_html/gallery2/
# BEGIN Url Rewrite section
# (Automatically generated. Do not edit this section)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /gallery2/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
RewriteRule . - [L]
RewriteCond %{THE_REQUEST} /gallery2/d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
RewriteRule . /gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L]
RewriteCond %{THE_REQUEST} /gallery2/v/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
RewriteRule . /gallery2/main.php?g2_path=%1 [QSA,L]
</IfModule>
# END Url Rewrite section
Thanks. Carl
Posts: 352
Ok, it looks like this .htaccess file was created when you were not embedded. What are your embedded url rewrite settings (path, url)?
Steve Lineberry
Posts: 25
Absolute path to the embedded.htaccess file:
/home/photoric/public_html/gallery2
URL to "environment" in embedded setup:
/ (the first part is already filled in by the program: http://photorichards.com)
Posts: 25
This embedded Gallery 2 installation seems to be real touchy. This morning it will not let me log in, but the guest side of it works well going backwards and forwards through the images. When I try to log in it gives me:
"Security Violation
The action you attempted is not permitted.
Back to the Gallery"
However, I can log in to the unembedded (main.php) g2.
About the .htaccess file: Since I configured the nonembedded g2 URL Rewrite before the embedded one, the .htaccess file was already written to and no change seemed to occur when I later installed and configured the embedded g2 URL Rewrite module.
Posts: 25
OK, here's what I tried. I was able to get into the admin page of the embedded g2 by first logging into the unembedded g2, even though it would not let me log into the embedded g2 directly.
After I was logged into both the nonembedded and embedded g2, I deactivated the URL Rewrite module in the nonembedded g2 and then tried to write the rules into the .htaccess file with the embedded URL setup by hitting the save button. It would not let me do it. It gave me this: (Hope this helps you decipher the problem)
Security Violation
The action you attempted is not permitted.
Back to the Gallery
Error Detail -
Error (ERROR_PERMISSION_DENIED)
in modules/core/classes/GalleryController.class at line 147 (gallerycoreapi::error)
in main.php at line 191 (gallerycontroller::loadcontroller)
in main.php at line 96
in modules/core/classes/GalleryEmbed.class at line 179
in gallery2embedded.php at line 32 (galleryembed::handlerequest)
System Information
Gallery version 2.2.1
PHP version 4.4.1 apache
Webserver Apache
Database mysqlt 4.0.16
Toolkits SquareThumb, ImageMagick, NetPBM, Gd
Operating system FreeBSD st84.startlogic.com 4.11-STABLE FreeBSD 4.11-STABLE #0: Wed Apr i386
Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Posts: 352
Ok, this is stepping a little outside of my realm but I'll give it a go.
First of all, is your cookie path set to /
and did you delete all of your cookies after you set it to /
??
I would also make your path be
/home/photoric/public_html/gallery2/
and set your url to be
/gallery2/
Steve Lineberry
Posts: 25
The cookie path is set to / and has been all along.
I had deleted the cookies at one time, but I did it all over again. I assume you meant delete cookies in the IE browser. I also searched for the cookies in C:/Carl J. Richards/documents and settings/cookies and deleted them manually.
I kept the path /home/photoric/public_html/gallery2/ as you suggested, which is what it has been all along.
I set the url to /gallery2/ (it had been /) Either way doesn't seem to make a difference.
The problem I face is that in the embedded g2, when I try to save the settings in setup of the url Rewrite plugin, I get a white screen, when the nonembedded g2 url Rewrite plug in is activated. When it is not activated, I get the Security Violation Error (see the error list above). When I switch to the nonembedded g2 I can save successfully, but in the setup section there is no place to enter the path or url. They are gone (they were there at one time I think). However, in the embedded g2 there is a place to enter them, but I get a white screen or a Security Violation Error when I try to save.
Yet something must be getting saved for when I test the nonembedded g2 it is successful for the apache mod_rewrite test and the Gallery .htaccess file test. When I run the test in the embedded g2 it tests successfully for three tests: the two above and the embedded .htaccess file ("Testing if Gallery can write to the embedded .htaccess file.")
I have also noticed that if I deactivate the URL Rewrite plug in in the nonembedded g2, it paralyzes the embedded g2 to the point that I get the "The action you attempted is not permitted." warning when I try to save in the embedded g2. If I log out I can't log back in under that circumstance.
If push comes to shove and we can't get the errors corrected, I suppose I could just use it as it is, since the embedded g2 does work. That is, I am able to bring up images and migrate forward and backwards. I could simply upload into the nonembedded g2. I don't know if that would be feasible in the long run, but this problem doesn't seem to be going away.
Do you have other suggestions at this point? Does the Security Violation Error Detail listed above give any clues to what I could edit in the involved files to correct the problem? I'd be happy to do whatever I need to to correct it. Thanks for your help. What next?
Posts: 352
One last thing to try
change your .htaccess file to
Steve Lineberry
Posts: 25
Well, Steve, I'm sorry to say that did not correct the problem. I can log into the embedded g2 only if the unembedded g2 is logged into first.
I can save in the unembedded g2, like before, but still get the white screen when trying to save in the embedded g2. Whether the url in the URL Rewrite setup is / or /gallery2/ makes no difference. I'm not sure it is even getting saved, when I enter it and try to save it, for I just get a white screen.
I still get the two successful tests in the unembedded g2 and the three successful ones in embedded g2. Writing to the .htaccess and embedded .htaccess files does not seem to be a problem, according to the tests.
Once I have saved in the URL Rewrite module of the unembedded g2, I can navigate through both g2s forward and backward. Even if things get screwed up with white screens starting to appear again in either one of the g2s, if I save again in the unembedded g2 URL Rewrite module, then I can navigate in both after that. That save seems to save the day. It's just that I can't seem to save in the embedded g2 or run the tests in the maintenance section of the admin page of the embedded g2 without getting white screens in the embedded g2. I think all saving can only get done in the nonembedded g2.
Surprisingly, the new .htaccess file you wrote does not seem to have affected the situation in any way I can tell.
At this point, if you have other suggestions, I am still game for following them. However, you have given it a valiant try, and if you are tired of this game, I will let you off the hook with much appreciation for your perseverence. You have provided a great service, and I have learned a lot. Please let me know. Thanks. Carl Richards
Posts: 352
Yea, I think I'm out of ideas. I've never had any of the issues that you have described. Sorry.
Steve Lineberry
Posts: 25
Thanks again, Steve.
Carl
Posts: 32509
as i said at http://gallery.menalto.com/node/64452#comment-235101, it's about outputting data before g2 has had a chance to send it's http headers.
it has nothing to do with URL rewrite or the like.
right now, you seem to have changed your config. your embedded g2 is pointing all URLs at the standalone g2... and everything's working, just not using g2 as embedded g2.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage