通过 cron 作业运行脚本时不包含脚本中的类,但从 url 运行它可以正常工作

问题描述 投票:0回答:0
Class not found on line 77. Why do I only get this error when calling the script from 
a cron job, but when called in the url the code runs fine.

Using twilio sms api
my code is plain and looks like this 

''' include_once './new-twilio-project/twilio-php-main/src/Twilio/autoload.php'; //需要DIR.'./new-twilio-project/twilio-php-main/src/Twilio/autoload.php';

//use Twilio\Rest\Client;
//the line below is line 77
$client = new Twilio\Rest\Client($account_sid, $auth_token);

''' 错误说未捕获的错误:类 twilio 是

php twilio twilio-api
© www.soinside.com 2019 - 2024. All rights reserved.