嗯,我想運行一個cronjob有一些文件包括但當我通過命令行運行它一直說文件不存在試圖運行一個cronjob與文件包括但當我運行命令行它繼續說有一個錯誤和文件都沒有
這裏是php文件:
include "../includes/common.php";
require_once('../anotherfile.php');
require_once '../swift/lib/swift_required.php';
//some database things
這裏是命令行我運行:
/usr/local/bin/php /home/xxxxx/public_html/cron/somefile.php
這裏是錯誤我得到:
Warning: include(..includes/common.php): failed to open stream: No such file or directory in /home/xxxxx/public_html/cron/somefilek.php on line 3
Warning: include(..includes/common.php): failed to open stream: No such file or directory in /home/xxxxx/public_html/cron/somefilek.php on line 3
Warning: include(): Failed opening '..includes/common.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxxx/public_html/cron/somefilek.php on line 3
Warning: require_once(..anotherfile.php): failed to open stream: No such file or directory in /home/xxxxx/public_html/cron/somefilek.php on line 4
Fatal error: require_once(): Failed opening required '..anotherfile.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxxx/public_html/cron/somefilek.php on line 4
由於某種原因隻字未提swift_required.php
您確定自己沒有輸錯嗎?你錯誤地說:'include(.. includes/common.php)'而不是'include(../ includes/common.php)' –
嵌套是否包含?就像common.php有一個不起作用的包含...我想我可能會讀錯誤的錯誤。 – kevingreen
john我試過兩種方法都沒有工作../,只是.. common.php適用於整個網站,並有一些包括,但他們正常工作 –