how to set environment variables in apache xampp ?(如何在 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() 时这似乎不起作用,环境部分中没有 ENVIRONMENT 变量
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 服务器.否则将不会在this"apache session 中设置环境变量!
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 中设置环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 apache xampp 中设置环境变量?


基础教程推荐
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01