如何在apache xampp中设置环境变量? [英] how to set environment variables in apache xampp ?

查看:214
本文介绍了如何在apache xampp中设置环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Windows的apache xampp中添加一些环境变量. 我已经尝试了以下方法: 将其添加到httpd.conf

I would like to add some environment variables in apache xampp in windows. I already tried the following : adding this in httpd.conf

SetEnv ENVIRONMENT "setting"

或者运行此脚本

putenv("ENVIRONMENT='setting'");

但是当我回显phpinfo()时,这似乎不起作用,环境部分中没有环境变量

but that doesn't seem to work when I echo phpinfo(), there isn't ENVIRONMENT variable in the environment section

推荐答案

我知道这是一篇过时的文章,OP可能已经亲自解决了这个问题,但对于其他人来说:

I know this is an old post and the OP already may has solved this by himself but for others:

SetEnv ENVIRONMENT setting

这将是httpd.conf文件中正确的语法.另外,此代码应放在文件末尾.

This would be the correct Syntax inside of the httpd.conf file. Also, this code should be put at the end of the file.

保存httpd.conf后,需要重新启动apache服务器.否则,将不会在此" apache会话中设置环境变量!

After saving httpd.conf the apache server needs to be restarted. Otherwise the environment variable will not be set in "this" apache session!

此致, 杨嘉美

这篇关于如何在apache xampp中设置环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆