Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Class.upload.php Dziwny blad po przeniesieniu na serwer
JamalBIG
post
Post #1





Grupa: Zarejestrowani
Postów: 496
Pomógł: 1
Dołączył: 16.01.2008
Skąd: Świnoujście

Ostrzeżenie: (0%)
-----


Witam

Mam dziwny problem z klasa class.upload.php - otoz na localhost'cie wszystko dziala poprawnie natomiast po przeniesieniu na serwer wywala mi:
Cytat
Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'MAGIC' - it's not in the allowed list in /.../class.upload.php on line 2270


Caly 'fragment' kodu z tej klasy to (linia 2266-2272)
  1. <?php
  2. if (getenv('MAGIC') === FALSE) {
  3.                    if (substr(PHP_OS, 0, 3) == 'WIN') {
  4.                        putenv('MAGIC=' . realpath(ini_get('extension_dir') . '/../') . 'extras/magic');
  5.                    } else {
  6.                        putenv('MAGIC=/usr/share/file/magic');
  7.                    }
  8.                }
  9. ?>


Wiecie moze jak temu zaradzic?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
decha-design
post
Post #2





Grupa: Zarejestrowani
Postów: 415
Pomógł: 46
Dołączył: 26.05.2007
Skąd: Sandomierz

Ostrzeżenie: (0%)
-----


"Safe Mode warning: Cannot set environment variable"

Proste, nie można edytować zmiennych środowiskowych z wyłączonym SAFE MODE ... via manual

Cytat
These directives have only effect when safe-mode itself is enabled!


Musisz włączyć safe mode lub robic to innym sposobem. Jak? Było na forum o.O'

Ten post edytował decha-design 24.03.2009, 00:18:22


--------------------
Go to the top of the page
+Quote Post
dr_bonzo
post
Post #3





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

Ostrzeżenie: (0%)
-----


@decha-design - tos zamieszal - wlasnie na odwrot -
Cytat
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!
safe_mode_protected_env_vars string

This directive contains a comma-delimited list of environment variables that the end user won't be able to change using putenv(). These variables will be protected even if safe_mode_allowed_env_vars is set to allow to change them.

http://php.mirror.facebook.com/manual/en/i...t.safe-mode.php

Cytat
Setting certain environment variables may be a potential security breach. The safe_mode_allowed_env_vars 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 by this directive. 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!

The safe_mode_protected_env_vars directive contains a comma-delimited list of environment variables, that the end user won't be able to change using putenv(). These variables will be protected even if safe_mode_allowed_env_vars is set to allow to change them.
---------------
These directives have only effect when safe-mode itself is enabled!

http://php.net/putenv

Czyli jesli masz wlaczone safe mode (a masz) to php sprawdza czy mozesz ustawic zmienne systemowe putenv()em - lista dozwolonych/zabronionych ustawien konfigurowalna jest tylko w php.ini.
Czyli pozostaje ci raczej przerobienie skryptu - wziecie innego.


--------------------
Nie lubię jednorożców.
Go to the top of the page
+Quote Post
decha-design
post
Post #4





Grupa: Zarejestrowani
Postów: 415
Pomógł: 46
Dołączył: 26.05.2007
Skąd: Sandomierz

Ostrzeżenie: (0%)
-----


No to możliwe ze zamieszałem =) Późno było haha.gif


--------------------
Go to the top of the page
+Quote Post
JamalBIG
post
Post #5





Grupa: Zarejestrowani
Postów: 496
Pomógł: 1
Dołączył: 16.01.2008
Skąd: Świnoujście

Ostrzeżenie: (0%)
-----


A znacie moze cos podobnego do class.upload.php - rownie prostego i funkcjonalnego ale dzialajacego z wlaczonym safe mode?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 02:21