命令未找到 php 中的 cronjob 错误



我已经设置了一个cron job命令来自动增加通过API发布的金钱装载

0 0 * * * /usr/bin/php -f /home/wmglobal/public_html/admin/congtienbaohiem.php > /dev/null

和 congtienbaohiem.php用这个代码

$db = mysqli_connect('localhost', 'wmglobal_lixin', 'wmglobal_lixin', 'wmglobal_lixin');
$query = "SELECT * FROM baohiem where trangthai='1'";
$result= $db->query($query);
if ($result->num_rows > 0) {
while($row = $result ->fetch_assoc()) {
$sotien = $row['sotien'];
$username = $row['username'];
$id = $row['id'];
$loituc = $sotien * 0.1 /100;
$gmusername = '789'.$username;
$gmpassword = $passwordmd5;
$externalTransactionId = 'WM555BLOBAL'. $id;
$params=[
'username'=> $gmusername,
'amount'=> $loituc,
'externalTransactionId'=> $externalTransactionId
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.gmaster8.com/WM/credit/deposit",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $params,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Basic Nzg5QVBJOjEyMzQ1Njc4OTA="
),
CURLOPT_USERPWD => "$gmusername:$gmpassword",
));
curl_exec($curl);
}
}

但是发送到我的电子邮件的结果是

/usr/local/cpanel/bin/jailshell: 0: command not found

我不知道如何解决这个问题,请帮忙。

我已经通过将 cron job 命令更改为

wget http://www.wm555.global/admin/congtienbaohiem.php

并将成功结果发送到电子邮件

--2020-07-06 14:08:02--  http://xxxxxxxx/admin/congtienbaohiem.php
Resolving www.wm555.global... xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx, 104.18.63.120, ...
Connecting to xxxxxxx|104.18.62.120|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “congtienbaohiem.php”
0K                                                        25.8M=0s
2020-07-06 14:08:03 (25.8 MB/s) - “congtienbaohiem.php” saved [83]

最新更新