如何在 apache xampp 中设置环境变量?

编程入门 行业动态 更新时间:2024-10-18 23:24:36
本文介绍了如何在 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 中设置环境变量?

本文发布于:2023-11-01 01:44:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547884.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:环境变量   如何在   apache   xampp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!