Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZF] nie czyta APPLICATION_ENV z htaccess
kaem
post
Post #1





Grupa: Zarejestrowani
Postów: 248
Pomógł: 38
Dołączył: 29.06.2008

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


Witam,
dzisiaj zacząłem naukę ZF i już mam problem. Nie czyta mi zmiennej APPLICATION_ENV z htaccess.
htaccess:
  1. # MOJE
  2. DirectoryIndex index.php # to mam w sumie w apachu ustawione chyba
  3. SetEnv APPLICATION_ENV development
  4. # KONIEC MOJE
  5.  
  6. RewriteEngine On
  7. RewriteCond %{REQUEST_FILENAME} -s [OR]
  8. RewriteCond %{REQUEST_FILENAME} -l [OR]
  9. RewriteCond %{REQUEST_FILENAME} -d
  10. RewriteRule ^.*$ - [NC,L]
  11. RewriteRule ^.*$ index.php [NC,L]
  12.  

i w index.php po wykonaniu echo APPLICATION_ENV; wyświetla 'production'. Co robię źle?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Damonsson
post
Post #2





Grupa: Zarejestrowani
Postów: 2 355
Pomógł: 533
Dołączył: 15.01.2010
Skąd: Bydgoszcz

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


Zmień sobie w index.php na
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));

A DirectoryIndex jest zbędny.
Go to the top of the page
+Quote Post
skowron-line
post
Post #3





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

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


Cytat(Damonsson @ 19.12.2011, 15:43:56 ) *
Zmień sobie w index.php na
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));

A DirectoryIndex jest zbędny.

Świetne rozwiązanie (IMG:style_emoticons/default/smile.gif) .

Zobacz sobie
Kod
print_r($_SERVER);

czy pokaże APPLICATION_ENV, bo wygląda jak by getenv nie czytało zmiennej.

http://pl.php.net/manual/pl/function.getenv.php
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 4.10.2025 - 05:55