Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Can';t在crontab任务中将WeasyPrint命令用作www数据_Python_Php_Cron_Debian Buster_Weasyprint - Fatal编程技术网

Python Can';t在crontab任务中将WeasyPrint命令用作www数据

Python Can';t在crontab任务中将WeasyPrint命令用作www数据,python,php,cron,debian-buster,weasyprint,Python,Php,Cron,Debian Buster,Weasyprint,我在Debian buster上使用www数据执行crontab任务,它可以工作,但对于包含一些WeasyPrint命令的任务,它会显示消息 sh:1:weasyprint:未找到 其他用户可以将Weasyprint与crontab一起使用,但www-data不能,我不知道为什么 我的PHP代码中不作为www数据使用的部分 exec('weasyprint'.$servicesdir.$my_file_name..html'.$servicesdir.$my_file_name..pdf');

我在Debian buster上使用www数据执行crontab任务,它可以工作,但对于包含一些WeasyPrint命令的任务,它会显示消息

sh:1:weasyprint:未找到

其他用户可以将Weasyprint与crontab一起使用,但www-data不能,我不知道为什么

我的PHP代码中不作为www数据使用的部分

exec('weasyprint'.$servicesdir.$my_file_name..html'.$servicesdir.$my_file_name..pdf');
$servicedire是我的项目的tmp目录的位置

这相当于:

weasyprint ./tmp/foo.html ./tmp/foo.pdf
crontab-e作为根用户:

*/10****su www-data-s/bin/bash-c”/usr/bin/php/var/www/apps/services/myproject/foo.php“>/var/www/apps/services/myproject/foo.error.log 2>&1

WeasyPrint是一个python包