Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: EdelingF on December 27, 2008, 12:33:52 PM

Title: PHP open_basedir error
Post by: EdelingF on December 27, 2008, 12:33:52 PM
I've been trying to integrate Gallery2 into WordPress because of the great facilities it gives me, which no WordPress plugin can give me.
But I get the error
Code: [Select]
file /opt/gallery2/embed.php is restricted by PHP open_basedir
I've been reading about open_basedir on this page http://wiki.contribs.org/PHP#Open_basedir_restriction (http://wiki.contribs.org/PHP#Open_basedir_restriction) but it doesnt make it understandable for me.
Since I'm not familiar with this and I certainly don't want to open my server for everybody, I was wondering if someone could tell me what I should do.
This is the code in the template 92gallery2:
Code: [Select]
# Gallery2
Alias /gallery2 /opt/gallery2/html
<Directory /opt/gallery2/html>
    AddType application/x-httpd-php .php .php3 .phtml
    php_admin_value open_basedir /opt/gallery2/html/:/opt/gallery2/g2data
    Options None
    Options +Includes
    AllowOverride None
    order deny,allow
    deny from all
    allow from all
</Directory>
<Directory /opt/gallery2/g2data>
    SetHandler Gallery_Security_Do_Not_Remove
    Options None
    <IfModule mod_rewrite.c>
          RewriteEngine off
    </IfModule>
    <IfModule mod_access.c>
          order deny,allow
          deny from all
    </IfModule>
</Directory>
Title: Re: PHP open_basedir error
Post by: Normando on December 27, 2008, 01:18:37 PM
Try change from

Code: [Select]
php_admin_value open_basedir /opt/gallery2/html/:/opt/gallery2/g2data
to

Code: [Select]
php_admin_value open_basedir /opt/gallery2:/tmp
Of course, then expand-template and restart httpd-e-smith

At the future you can try http://wiki.contribs.org/SME_Site_Maker
Title: Re: PHP open_basedir error
Post by: EdelingF on December 27, 2008, 08:19:17 PM
Nope, that didn't do it. I still get:
Code: [Select]
file /opt/gallery2/embed.php is restricted by PHP open_basedir
Title: Re: PHP open_basedir error
Post by: cactus on December 27, 2008, 08:40:23 PM
Nope, that didn't do it. I still get:
Code: [Select]
file /opt/gallery2/embed.php is restricted by PHP open_basedir
You did expand your webserver configuration file and restart the webservice ith these commands?
Code: [Select]
expand-template /etc/httpd/conf/http.conf
sv t httpd-e-smith
Title: Re: PHP open_basedir error
Post by: EdelingF on December 27, 2008, 09:02:33 PM
In
Code: [Select]
/etc/e-smith/templates/etc/httpd/conf/httpd.conf
I changed in 92gallery2
Code: [Select]
php_admin_value open_basedir /opt/gallery2/html/:/opt/gallery2/g2datato
Code: [Select]
php_admin_value open_basedir /opt/gallery2:/tmpThen I did
Code: [Select]
expand-template /etc/httpd/conf/http.conf
sv t httpd-e-smith
Then I went back to WordPress and activated the plugin WPG2

The results are:
WPG2 Validation Check: Failed (Help)
1. Wordpress Compatible? - [ Success]
2. URI to Gallery2 Ok? - [Success]
3. Gallery2 can be located in G2 File Path? - [Failed]

On the second tab you can manually fill in the URL: http://www.domain.nl/gallery2/
The result of this is:
Code: [Select]
file /opt/gallery2/html/embed.php is restricted by PHP open_basedir
Title: Re: PHP open_basedir error
Post by: EdelingF on December 27, 2008, 09:12:11 PM
I jus found a HowTo from 2007:
http://wiki.contribs.org/WPG2_Plugin (http://wiki.contribs.org/WPG2_Plugin)
Which directs to:
http://forums.contribs.org/index.php?topic=38549.msg174775#msg174775 (http://forums.contribs.org/index.php?topic=38549.msg174775#msg174775)
Would this do the trick?
Title: Re: PHP open_basedir error
Post by: cactus on December 27, 2008, 09:17:59 PM
I jus found a HowTo from 2007:
http://wiki.contribs.org/WPG2_Plugin (http://wiki.contribs.org/WPG2_Plugin)
Which directs to:
http://forums.contribs.org/index.php?topic=38549.msg174775#msg174775 (http://forums.contribs.org/index.php?topic=38549.msg174775#msg174775)
Would this do the trick?
Perhaps as you need to adjust the PHP BaseDir setting for wordpress (in this case) as you are running into it's limits from the wordpress source dir.

When following suggested link be sure to not use the commands listed there to restart the webserver, they have changes in the mean time. Use the one in my earlier post.
Title: Re: PHP open_basedir error
Post by: EdelingF on December 27, 2008, 09:43:31 PM
It looks good, it did the trick I think
Just struggeling with some relative paths

Thank for your help