once will not work, include will
I have one staging server that stopped running cron jobs. After some research, it turns out that require_once was failing.
I've seen other related questions, and this has nothing to do with paths, absolute or relative. I can create a new file test.php, try to require it in the same folder with the file owner, and fail:
php -r 'include("test.php"); echo "hellon"'
hello
php -r 'require("test.php"); echo "hellon"'
PHP Fatal error...failed opening 'test.php'...include path .:/usr/share/pear:/usr/share/php'
Out of desparation, I moved test.php to /usr/share/pear/test.php
, same error. Also I've tried ./test.php
, __dir__."/test.php"
, same error.
PHP 5.3.3, which is dated, but working on 2 other servers (dev and prod)
Is it just broken?
Thank you for everyone's help. I wanted to post the solution.
Someone altered the php.ini file and set the open_basedir (to a fairly useless directory I might add), which essentially limited php functionality to that directory. Unfortunately this doesn't throw any useful error.
Thanks again!
链接地址: http://www.djcxy.com/p/58122.html上一篇: 使用名称空间时找不到PHP类
下一篇: 一旦不行,包括意志