gpt4 book ai didi

php - PHP 的问题包括来自命令行(或 cronjob)

转载 作者:太空狗 更新时间:2023-10-29 12:31:36 24 4
gpt4 key购买 nike

我正在尝试在我的 AWS EC2 实例上设置一个 cronjob。 crontab 文件中的实际条目没有任何问题,但是当我尝试在命令行中运行命令时,我得到了这个响应。

PHP Warning:  include(../scripts/connect.php): failed to open stream: No such file or directory in /var/www/htdocs/crons/emailnotifications.php on line 2
PHP Warning: include(): Failed opening '../scripts/connect.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/crons/emailnotifications.php on line 2
PHP Warning: include(../scripts/functions.php): failed to open stream: No such file or directory in /var/www/htdocs/crons/emailnotifications.php on line 3
PHP Warning: include(): Failed opening '../scripts/functions.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/crons/emailnotifications.php on line 3
PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /var/www/htdocs/crons/emailnotifications.php on line 4
PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/htdocs/crons/emailnotifications.php on line 6
PHP Warning: mysql_query(): A link to the server could not be established in /var/www/htdocs/crons/emailnotifications.php on line 6
PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /var/www/htdocs/crons/emailnotifications.php on line 7

我可以在我的浏览器中加载这个页面并且它工作正常,但不能从命令行(或 cronjob)。

最佳答案

对要包含的文件使用绝对路径

关于php - PHP 的问题包括来自命令行(或 cronjob),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25165334/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com