HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   pear + safe_mode? (http://www.howtoforge.com/forums/showthread.php?t=7370)

Ben 10th October 2006 13:37

pear + safe_mode?
 
Hi folks,

got the followin problem, I have an application using pear / excel spreadsheet to create excel files.
Safe mode is on for the web.
The first error is that in can not open the pear files because the dir is not in the open_basedir list. If I now add it, that error is gone but because of safe mode we have a uid conflict because the pear stuff is owned by root.
Sure switching safe_mode off the whole stuff works.
But I'm looking for a solution that I can use pear with any web (if possible without switching to suphp), that means changing the pear files owner to the web one won't help.
Any ideas?

till 11th October 2006 11:10

If i remember correctly, there is a setting in PHP to define a directory that is outside the open_basedir directory for includes. Have you tested this option?

The other solution is to install a local copy of the pear files for the website, but thats nor really elegant :(

Ben 11th October 2006 20:52

Hi Till,

sure, I could just throw it in the include path, but then open_basedir restriction takes effekt due to safe_mode.
If I add it as well to the open_basedir, I have a safemode restriction because of uid of root (pear files owned by root), vs. apache2 user under which the php script that tries to include the pear stuff... so that's my "real" problem ;)

Regarding the copy, is it possible to create symlinks having another owner, than the file they link to=

till 12th October 2006 10:37

I dont meant the normal include setting, I meant the safemode_include_dir (forgot the correct name in the first post :).

From php.ini:

Quote:

; When safe_mode is on, UID/GID checks are bypassed when
; including files from this directory and its subdirectories.
; (directory must also be in include_path or full path must
; be used when including)
safe_mode_include_dir =
But I have not tested this, especially with open_basedir. Maybe it is possible to set this to a local website directory that is symlinked to a global pear directory... :)

Ben 26th October 2006 08:10

To finish that post for others having the same problem, yes, safe_mode_include_dir helps.

@Till: Already entered it there but just with some typos in the path :(

Ben 30th October 2006 10:50

@till: Well it does not really help, because the php.ini settings are overwritten by the vhost.conf settings. Adding it to the httpd additional stuff won't help, because these values are written before the php stuff in the conf though they have no effect.

Is there a way to change that, to either always allow pear, make the user check "allow pear" or most flexible, an additional box for the admin to add pathes to openbasedir...

In my case I changed linke 1448 from config.lib.php
PHP Code:

php_admin_value open_basedir "/usr/src/php/:".$mod->system->server_conf["server_path_httpd_root"]."/"."web".$web["doc_id"]."/\" 


falko 31st October 2006 17:20

You could put an .htaccess file in the directory. You might have to enable
Code:

AllowOverride all
for that directory.


All times are GMT +2. The time now is 16:53.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.