[maps] open_basedir on shared hosting?

AllanB

Joined: 2007-03-01
Posts: 40
Posted: Sat, 2007-06-16 20:59

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

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Sun, 2007-06-17 18:43

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)

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Sun, 2007-06-17 21:59

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

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Sun, 2007-06-17 22:09

Uploaded and tested ...

Now the same error message ... but in modules/core/classes/GalleryPlatform.class on line 188.

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Mon, 2007-06-18 00:07

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.

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Mon, 2007-06-18 03:50

From phpinfo() ... open_basedir ...

/var/www/domains/rhubarbdiaries.com/:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/www/myfilemanager:/var/www/myinstaller:/usr/local/lib/php

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Mon, 2007-06-18 04:14

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.

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Mon, 2007-06-18 04:16

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>

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Mon, 2007-06-18 14:13

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.

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Mon, 2007-06-18 20:48

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

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Tue, 2007-06-19 18:23

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.

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Wed, 2007-06-20 02:54

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!

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Wed, 2007-06-20 04:43

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:

svn co http://gmap-module.svn.sourceforge.net/svnroot/gmap-module/Gallery2.1/modules/map map

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).

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Wed, 2007-06-20 14:07

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.

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Wed, 2007-06-20 14:10

Okay, that's strange. What paths are the three is_dir statements checking now? (use 'buffered' debug again)

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Wed, 2007-06-20 14:25

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

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Wed, 2007-06-20 17:34

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.

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Wed, 2007-06-20 18:53

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.

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Wed, 2007-06-20 19:52

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

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Wed, 2007-06-20 19:56

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.

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Sat, 2007-06-23 00:11

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

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Sat, 2007-06-23 04:14

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.

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Sat, 2007-06-23 06:05

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!

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Sat, 2007-06-23 15:43

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.

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Sat, 2007-06-23 16:05

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!

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Sat, 2007-06-23 16:58

Can we get a link to your site, I'd like to take a look :-)

Thanks!
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Sat, 2007-06-23 19:11

It's www.rhubarbdiaries.com ....

... and while we're at it ... how do I download an SVN version of the module?

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Sun, 2007-06-24 03:14

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.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Mon, 2007-06-25 14:26

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
-------------------------
The Termite - :-) - http://www.termitenshort.com/

 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Mon, 2007-06-25 17:25

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

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Wed, 2007-06-27 01:43

Yep,

Sorry that "tonight" didn't happen. Here is the new file, let me know if that fixes your issue ^^

Thanks !
-------------------------
The Termite - :-) - http://www.termitenshort.com/

AttachmentSize
ShowMap.zip10.12 KB
 
AllanB

Joined: 2007-03-01
Posts: 40
Posted: Thu, 2007-06-28 02:06

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.

 
SiliconFiend
SiliconFiend's picture

Joined: 2006-12-27
Posts: 508
Posted: Thu, 2007-06-28 04:21
AllanB wrote:
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.

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.