我遇到了hosts文件和PHP的问题.运行PHP代码时root,将读取/ etc/hosts中的条目.但不是以我的用户或apache运行代码时.
root@server:/# cat /etc/hosts
127.0.0.1 mydomain.com
root@server:/# php -r "echo gethostbyname('mydomain.com');"
127.0.0.1
markus@server:/$ php -r "echo gethostbyname('mydomain.com');"
xxx.xxx.xxx.xxx
Run Code Online (Sandbox Code Playgroud)
知道为什么会这样吗?
| 归档时间: |
|
| 查看次数: |
4070 次 |
| 最近记录: |