我对 Windows System %PATH% 变量有点困惑。当我使用 php-cli 和 apache 提供的网页运行以下脚本时,我得到了路径变量的不同输出。
// different output for php-cli and php executed by apache webserver
<?php
system('echo %PATH%');
?>
我在哪里可以更改与 apache 网络服务器一起使用的 PATH 变量?
我的系统:
- Win7 64位
- Zend Server Community Edition 5.0.4(使用 Apache,而不是 IIS)
编辑: 对不起,我不得不给你一个例子来理解这个问题:
我想执行system('mysqldump .....')
命令或类似的东西。关键是,从命令行运行脚本是可行的,因为 MySQL bin 路径在系统路径中,但通过 webbrowser 运行脚本不会在系统路径中包含 MySQL bin 路径。
web系统的路径是:
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Programme\Sysinternals;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Zend\ZendServer\bin
位原系统的路径要长得多。我现在的问题是,系统的路径在哪里受到限制,或者我在哪里可以找到网络执行的 php 脚本的系统路径设置?