apache2.4 - PHP server define -



apache2.4 - PHP server define -

i have 2 servers php project, 1 prod , 1 tests.

i want add together test server flag utilize in every php file. illustration add together define('test', true)

how can set define in "server level"? mean define in ini or somthing, not in php page.

you should utilize environment variables this.

in apache, instance, can utilize mod_env set environment variable in virtualhost directive test server:  

setenv application_env testing

and live server:

setenv application_env production

you utilize in php:

$environment = getenv('application_env'); if ($environment == 'testing') { // ... }

php apache2.4

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -