I have installed the Google Maps module (v.0.5.1) and after configuring with the necessary Google Maps API key I am getting the following errors ...
Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(..) is not within the allowed path(s): ... in ... modules/map/ShowMap.inc on line 820
Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(..) is not within the allowed path(s): ... in ... modules/map/ShowMap.inc on line 838
Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(..) is not within the allowed path(s): ... in modules/map/ShowMap.inc on line 855
I have contacted the webhost who basically said that it's a shared hosting and thus the problem is in the Google code <argh>. Surely this can be made to work in this type of scenario? I can't imagine everyone with a shared hosting not being able to use this!
Here is the other pertinent info:
Gallery version = 2.1.2 core 1.1.0.2
PHP version = 5.2.1 apache2handler
Webserver = Apache/2.0.54 (Debian GNU/Linux)
Database = mysql 4.1.11-Debian_4sarge7, lock.system=flock
Toolkits = Exif, Getid3, Thumbnail, Gd
Acceleration = none, none
Operating system = Linux
Default theme = greypop
Thanks for any assistance that anyone can provide -
Allan
Posts: 508
Can you try the svn version (svn co http://gmap-module.svn.sourceforge.net/svnroot/gmap-module/Gallery2.1/modules/map) and see if the problem still persists? (Note, even though it says Gallery2.1 it's compatible with Gallery 2.2)
Posts: 40
I am assuming you mean the SVN version of ShowMap.inc?
What permissions does this module require? That was another suggestion eventually offered by the hosting company.
Allan
Posts: 40
Uploaded and tested ...
Now the same error message ... but in modules/core/classes/GalleryPlatform.class on line 188.
Posts: 508
Well, I meant the entire svn version. It's risky to use a single file from svn without updating the others. However, it sounds like that won't solve your problem. Your hosting company seems to be particularly restrictive. Can you get your phpinfo() and post the value of open_basedir? Then I can compare it to what we're trying to check with is_dir and see if there's a workaround.
Posts: 40
From phpinfo() ... open_basedir ...
/var/www/domains/rhubarbdiaries.com/:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/www/myfilemanager:/var/www/myinstaller:/usr/local/lib/php
Posts: 508
Well, assuming your gallery is installed in /var/www/domains/rhubarbdiaries.com/gallery/ then I'm not sure what the problem is. It could be that the map module is using parent directory indicators (i.e., ../..) in the path, and php is puking on that. I'll see if that's what's causing it and try an alternate method.
Posts: 40
Yes, you're right, it is installed in /gallery/.
I do know that in the past I've had to alter paths in the config of some modules in Joomla ... from relative to absolute ... so perhaps that is having something to do with it?
<fingers crossed>
Posts: 508
Well, I forgot that I changed it to absolute paths a while ago. From my preliminary testing, I can't see what's going wrong. Can you turn on buffered debugging (go to config.php and change $gallery->setDebug(false) to $gallery->setDebug('buffered') )? Then load up the map view again and do a search on that web page for is_dir (there should be 3, clustered together) and let me know what path(s) it's failing on. Don't forget to turn debug off again when you're done.
Posts: 40
There were a bunch of is_dir statements, but the three that were clustered together are the following:
is_dir(/var/www/domains/rhubarbdiaries.com/docs/gallery/modules/core/classes/helpers/../../../../modules/map/images/markers/smallpushpins) is_dir(/var/www/domains/rhubarbdiaries.com/docs/gallery/modules/core/classes/helpers/../../../../modules/map/images/markers/smallpushpins) is_dir(/var/www/domains/rhubarbdiaries.com/docs/gallery/modules/core/classes/helpers/../../../../modules/map/images/markers/smallpushpins) getParameter path for imagemagick plugin file_exists(/var/www/domains/rhubarbdiaries.com/docs/gallery/g2data/cache/module/imagemagick/0/0/0.inc)
Hope this helps!
Allan
Posts: 508
It seems that the Gallery Core API changed the function to get the plugin base directory. In Gallery 2.1.2, which you're using, it uses the .. separators, which appears to be causing the problem. I put in a fix in SVN if you want to try it.
Posts: 40
What file(s) should I be using from SVN? Apparently I didn't completely understand this last time around
Thanks for all your help, SF!
Posts: 508
Well, the best thing to do would be to checkout the entire svn version. Use this command (assuming you have the subversion command-line client installed), run from the gallery/modules directory:
But if you got it to work by just downloading ShowMap.inc, you could just try the new version (it's the only file I changed).
Posts: 40
Uploaded and tested ...
I still get the same error message ... in modules/core/classes/GalleryPlatform.class on line 188.
I had cleared the template cache and the database cache ... and the browser cache as well.
This error shows up in the header region of the page. I can see the map (and some coordinates of a photo) but the error messages are at the top of the page.
Posts: 508
Okay, that's strange. What paths are the three is_dir statements checking now? (use 'buffered' debug again)
Posts: 40
Here are the first three that were clustered together:
is_dir(/var/www/domains/rhubarbdiaries.com/docs/gallery/modules/map/images/markers/bigdots) is_dir(/var/www/domains/rhubarbdiaries.com/docs/gallery/modules/map/images/markers/bigdots) is_dir(/var/www/domains/rhubarbdiaries.com/docs/gallery/modules/map/images/markers/bigdots) getParameter path for imagemagick plugin
Posts: 508
Hmm... Well, I don't know much about the open_basedir restriction, but I thought that would allow it to work. It's within your allowed directory prefix, with no relative paths.
I just did a bit of searching in this forum. Take a look at this post: http://gallery.menalto.com/node/59785#comment-218704 You could try making that change listed and see if it will fix your problem.
If that doesn't work, I don't know if there's anything else I can do for you. You might ask your provider why that particular path is being rejected.
If anyone else knows about open_basedir restrictions, please chime in.
Posts: 40
That must be from v.2.2, because when I checked GalleryPlatform.class, the specified line was at line 790 ... but the error is coming up at line 188 in v.2.1.2.
Posts: 40
I tried contacting the hosting company again ... and here is what I received ...
"Find out from the developer what types of trusts are required or what is permission is neccessary for the file"
Allan
Posts: 508
It's only checking the existence of that directory (and that it's a directory and not a regular file). It's just using the PHP function is_dir(). So I would presume only read permissions are required.
Posts: 40
I sent them the link to this thread ... and I've still not received an answer or solution. I don't understand how it isn't in the required path. The warning shows up in the header ... yet the page renders and the Google Map is displayed with markers etc. I tried it with two different themes with the same result.
Anyone have any ideas what is going on with GalleryPlatform.class at line 188?
Here is all I have been able to find on these forums ...
http://codex.gallery2.org/Gallery2:Known_Issues
http://codex.gallery2.org/Gallery2:How_to_configure_open_basedir_for_G2
Is there any chance of an issue of compatibility with v.2.1.2 (vs. 2.2.2)?
Allan
Posts: 508
There's a chance that Gallery 2.2 would help; if you have the option to upgrade it might be a good idea. However, it just seems that your webserver is not configured correctly. At least, I can't see any reason why it's not working the way it is now. But then again, I'm not an expert on PHP/webserver configuration so maybe there's something I'm missing.
Posts: 40
More data, SF ...
I uninstalled the map module ... and re-installed. The original error comes up (as it did before) in embedded mode (in Joomla), but when I go to test it in standalone mode, it seems to work fine. There aren't any errors or warnings, and maps seem to render fine. It's just when I view Gallery embedded that it does this (though I would swear that I tested standalone before with errors, but I digress).
Now I am thoroughly confused because this is the only part of Gallery that doesn't seem to want to function while embedded in Joomla!
Posts: 508
That is baffling. I don't have much experience with embedding. The map module project leader, Termitenshort, has more expertise with that. I don't know if he's monitoring this thread, but I'll ping him and see if he has any ideas.
Posts: 40
I've actually got the sidebar published on the Gallery pages now as "public" (had been just for me to use initially) ... so please go take a look and see. It's baffling to me too!
Posts: 1894
Can we get a link to your site, I'd like to take a look
Thanks!
- http://www.termitenshort.com/
-------------------------
The Termite -
Posts: 40
It's www.rhubarbdiaries.com ....
... and while we're at it ... how do I download an SVN version of the module?
Posts: 508
If you have subversion (SVN) installed (the command-line version), then the command I gave you above in this comment will do it. Or if you're using Windows, you could try TortiseSVN. If you don't have shell access on your hosting, you can check it out to your local computer and then upload it.
Posts: 1894
I think I know how to fix this,
I will be making a change to the ShowMap.inc file for module version 0.5.1d tonight and attaching it here, if that works for you, I'll be changing it to SVN also. See you later !
Thanks
- http://www.termitenshort.com/
-------------------------
The Termite -
Posts: 40
Thanks, Termite, I look forward to it ... you've all been so helpful!
As I have tested everything further, I am finding that the Joomla-Gallery 2 bridge must be a big part of the problem. When I run everything standalone, Gallery seems to be working quite nicely now ... but when I try to integrate into Joomla, there are some issues with the map, themes, and dynamic albums. Unfortunately there doesn't seem to be much help available on the developer's forum
Allan
Posts: 1894
Yep,
Sorry that "tonight" didn't happen. Here is the new file, let me know if that fixes your issue ^^
Thanks !
- http://www.termitenshort.com/
-------------------------
The Termite -
Posts: 40
Termite -
Thanks so much ... it seems to have remedied the open_basedir issues! It works with Gallery 2.1.2 and the Joomla bridge v.2.0.13 ... now I wonder if it will work with v.2.2.2 and bridge v.2.0.14. I can try this on my test site and see what happens ... and report back.
The only thing that I am having difficulty with now is the zoom setting with the "Show map filtered with the current album". Regardless of how I set it, it seems to be showing the map at a zoom level much higher than what I set.
Posts: 508
I don't know if this is your problem, but if you have Auto Center and Zoom set, it will override the zoom level you program. If your album has only a few tightly-clustered points, the auto zoom will be closer than you might want.