Home >Backend Development >PHP Tutorial > Centos与Debian PHP环境变量有关问题

Centos与Debian PHP环境变量有关问题

WBOY
WBOYOriginal
2016-06-13 12:41:081061browse

Centos与Debian PHP环境变量问题。
通过PHP shell_exec来执行 shell脚本。
shell脚本中有执行到python,

python脚本,os.path.expanduser('~')
在Centos系统是取到 /root/
而Debian系统是取到 /home/www

PHP的真实用户是www的,但上面shell脚本是以root权限运行的。


Centos下是取到root用户主目录
/root/

而Debian是取到www用户主目录
/home/www

现在怎么保持一致,有些晕了。

Statement:
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