我有一个运行php文件的cron作业。在php文件中,它需要另一个文件。对于由cron运行的其他php文件,我执行相同的require文件,它只是文件。我已将所有涉及的文件的权限更改为777(用于测试),问题仍然存在。当我从命令行执行文件时,它运行得很好。
为什么文件不允许这个1 php文件的权限?
以下是我从cron收到的错误:
[Fri Mar 29 00:05:01 2013] [warn-phpd] mmap cache can't open /home/rpn/public_html/admin/admin_functions.php - Permission denied (pid 29776)
PHP Warning: require(/home/rpn/public_html/admin/admin_functions.php): failed to open stream: Permission denied in /home/rp/public_html/cron/cron-boxscores.php on line 6
Warning: require(/home/rpn/public_html/admin/admin_functions.php): failed to open stream: Permission denied in /home/rp/public_html/cron/cron-boxscores.php on line 6
PHP Fatal error: require(): Failed opening required '/home/rpn/public_html/admin/admin_functions.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/rp/php') in /home/rp/public_html/cron/cron-scrape-boxscores.php on line 6
Fatal error: require(): Failed opening required '/home/rpn/public_html/admin/admin_functions.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/rp/php') in /home/rp/public_html/cron/cron-boxscores.php on line 6
这是第6行:
require('/home/rpn/public_html/admin/admin_functions.php');
以下是显示文件和权限设置的目录:
root@host [/home/rpn/public_html/admin]# ls -l admin*
-rw-r--r-- 1 nobody nobody 19022 Mar 8 14:18 admin_functions.php
没人:没有人会在Apache下运行。