apache httpd.conf 设置可以使用环境变量嘛解决思路

WBOY
Release: 2016-06-13 10:09:24
Original
1530 people have browsed it

apache httpd.conf 设置可以使用环境变量嘛
小弟需要打个php运行的环境包 把自己写的php程序和环境一起打包然后做成安装包,
可是在配置方面想问一下,apache httpd.conf 设置可以使用环境变量吗?因为一个
一个改起来太麻烦比如

DocumentRoot "C:/Console/www/"

LoadModule php5_module "C:/Console/php/php5apache2_2.dll"
PHPIniDir "C:/Console/php"

上面的C:/Console开始可以设成一个环境变量 然后httpd.conf 直接写死这样可以吗?
怎么实现 谢谢了 


------解决方案--------------------

探讨
小弟需要打个php运行的环境包 把自己写的php程序和环境一起打包然后做成安装包,
可是在配置方面想问一下,apache httpd.conf 设置可以使用环境变量吗?因为一个
一个改起来太麻烦比如

DocumentRoot "C:/Console/www/"

LoadModule php5_module "C:/Conso……

------解决方案--------------------
竟然你都要發佈產品了,那麼你完全可以通過php代碼來修改 Apache config.ini文件的是不是.修改好了順帶 restart apache.
------解决方案--------------------
如果你有兴趣,可以看看mod_perl,
这个似乎可以对apache配置做定制,看见可以嵌入perl到httpd.conf里 

http://perl.apache.org/docs/2.0/user/config/custom.html

http://www.issociate.de/board/goto/1147159/Using_environment_variable_in_httpd.conf.htm

我不了解这个,你可以到perl版问问.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!