Setting PHP variables in httpd.conf?

后端 未结 6 1506
不思量自难忘°
不思量自难忘° 2020-12-24 14:55

I\'d like to automatically change my database connection settings on a per-vhost basis, so that I don\'t have to edit any PHP code as it moves from staging to live and yet a

6条回答
  •  时光取名叫无心
    2020-12-24 15:13

    The problem with .htaccess is that it is part of the code base tree. And the code base tree is part of VC/SVN. Hence any change in local/dev gets moved to production. Keeping the env variable setting in httpd.conf saves you the effort of being careful about not accidentally overwriting the server vs dev flag. Unless of course you want to do with IP address or host name, both of which are not scalable approaches.

提交回复
热议问题