View Full Version : Gallery2 Safe mode Issues
grazman
28th January 2007, 17:04
Using ISPConfig, I created two different users and sites. One with and one without safe mode (using individual settings).
In each instance I followed the "how to" to install Gallery2. In both instances I get...(paths shortned for readability).
"Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'LANG' - it's not in the allowed list in /var/www/.../GalleryTranslator.class on line 299
Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'LANGUAGE' - it's not in the allowed list in /var/www/.../GalleryTranslator.class on line 300"
In each instance, I get the above errors. What's the best way to check afe mode settings on an ISPConfig user or set to confirm they are working properly?
falko
29th January 2007, 13:24
Take a look here: http://es2.php.net/features.safe-mode
safe_mode_allowed_env_vars string
Setting certain environment variables may be a potential security breach. This directive contains a comma-delimited list of prefixes. In Safe Mode, the user may only alter environment variables whose names begin with the prefixes supplied here. By default, users will only be able to set environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
Note: If this directive is empty, PHP will let the user modify ANY environment variable!
trexen
26th August 2008, 20:48
i have safe mode off on my site.
doesent work iter
------------------------------------------------------------------------------------------------------------------------
Found this:
some things aren't ok with your setup.
please ask your webhost to...
remove fsockopen,ini_get,ini_set,get_defined_constants,ph p_uname,set_time_limit,version_compare,fwrite, fread, file, file, mail,opendir, readdir, closedir from the PHP disable_functions list.
i guess that could explain why the auth step isn't working for you.
that's an extremely restrictive server environment that is provided for you by your webhost. i'd switch to another webhost. disabling most filesystem functions, disabling version_compare, these are things that just don't make sense. one could make a point for the other functions for super cheap webhosting, but any somewhat inexpensive webhost should allow for all of them.
------------------------------------------------------------------------------------------------------------------------
But i canīt figure out how to get by this.... plz help
//Marcus
till
26th August 2008, 22:42
None of these functions is disabled in a ISPConfig setup by default, so if you did not disable them in the php.ini file, you dont have to change anything.
Is the error message exactly the same when you switch safemode off?
trexen
27th August 2008, 11:27
Yes its the same
............
Error:
Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'LANG' - it's not in the allowed list in /var/www/web13/web/gallery2/modules/core/classes/GalleryTranslator.class on line 306
Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'LANGUAGE' - it's not in the allowed list in /var/www/web13/web/gallery2/modules/core/classes/GalleryTranslator.class on line 307
.................................................. ................................................
From: /etc/php5/apache2/php.ini.
safe_mode = Off
safe_mode_gid = Off
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
I have seach om forums, and all talks about some Cockies that needs
Rgds
Marcus
till
27th August 2008, 11:42
An you are really sure that you did not enable the php safemode checkbox for this website in ISPConfig? Please double check this.
Please have a look in the file /etc/apache2/vhosts/Vhost_ispconfig.conf and veify that safemode is set to off in this vhost.
trexen
27th August 2008, 12:01
I was looking at the wrong place, now it works verry nice, Many thanks
Rgds
Marcus
trexen
27th August 2008, 12:39
After 3 step:
Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'LANG' - it's not in the allowed list in /var/www/web13/web/gallery2/modules/core/classes/GalleryTranslator.class on line 306
Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'LANGUAGE' - it's not in the allowed list in /var/www/web13/web/gallery2/modules/core/classes/GalleryTranslator.class on line 307
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web13/web/gallery2/modules/core/classes/GalleryTranslator.class:306) in /var/www/web13/web/gallery2/install/steps/MultisiteStep.class on line 62
.................................................. ................................................
Step 4
More errors =)
Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/g2data123/) is not within the allowed path(s): (/var/www/web13/) in /var/www/web13/web/gallery2/install/index.php on line 184
Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/web13/) in /var/www/web13/web/gallery2/install/index.php on line 190
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web13/web/gallery2/modules/core/classes/GalleryTranslator.class:306) in /var/www/web13/web/gallery2/install/index.php on line 213
It seems that it canīt accept g2data directory i make and Chmod 777 on that dir
I try lots of different pathīs
Rgds
Marcus.
falko
28th August 2008, 16:50
Can you post the vhost configuration of web13 from your Vhosts_ispconfig.conf?
trexen
28th August 2008, 18:15
######################################
Vhost: www.domain.se:80
######################################
<VirtualHost 192.168.250.6:80>
ServerName www.domain.se:80
ServerAdmin webmaster@domain.se
DocumentRoot /var/www/web13/web
ServerAlias domain.se mail.domain.se
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Defa
ult.htm default.htm
Alias /cgi-bin/ /var/www/web13/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web13/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
php_admin_flag safe_mode Off
php_admin_value open_basedir /var/www/web13/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /var/www/web13/phptmp/
php_admin_value session.save_path /var/www/web13/phptmp/
<IfModule mod_ruby.c>
<Directory /var/www/web13/web>
Options +ExecCGI
</Directory>
RubyRequire apache/ruby-run
#RubySafeLevel 0
<Files *.rb>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
</IfModule>
<IfModule mod_python.c>
<Directory /var/www/web13/web>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
</IfModule>
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/web13/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web13/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web13/user/$1/web/$3
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</IfModule>
</VirtualHost>
falko
29th August 2008, 14:34
Does it work when you remove this part manually and restart Apache?
php_admin_flag safe_mode Off
php_admin_value open_basedir /var/www/web13/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /var/www/web13/phptmp/
php_admin_value session.save_path /var/www/web13/phptmp/
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.