Twilio: PHP: SMS Not Work: HTTP ERROR 500
A web site migrated to a new machine, got these errors when sending SMS notification via Twilio.
Others normally.
這個網頁無法正常運作
domain.hk 目前無法處理這項要求。
HTTP ERROR 500
[proxy_fcgi:error] [pid 18017:tid 140484670535424] [client 127.0.0.1:33662] AH01071: Got error 'PHP message: PHP Warning: dirname() expects exactly 1 parameter, 2 given in /var/www/domain.hk/index.php on line 208\nPHP message: PHP Fatal error: Call to undefined function Twilio\\Http\\curl_init() in /var/www/domain.hk/extensions/Twilio/Http/CurlClient.php on line 32\n', referer: https://domain.hk/NoticeBySMS/id/14
[...]
[proxy_fcgi:error] [pid 18016:tid 140484555044608] [client 127.0.0.1:35200] AH01071: Got error 'PHP message: PHP Warning: dirname() expects exactly 1 parameter, 2 given in /var/www/doman.hk/index.php on line 208\nPHP message: PHP Fatal error: Call to undefined function curl_init() in /var/www/domain.hk/extensions/Twilio/Http/CurlClient.php on line 32\n', referer: https://domain.hk/NoticeBySMS/id/14
Twilio/Http/CurlClient.php
if (!$curl = \curl_init()) {
throw new EnvironmentException('Unable to initialize cURL');
}
Identified that because of php5.6-curl not yet installed.
$ sudo apt install php5.6-curl
More, Google Calendar API also related to the cURL.
[proxy_fcgi:error] [pid 18016:tid 140484403975936] [client 127.0.0.1:35344] AH01071: Got error 'PHP message: PHP Warning: dirname() expects exactly 1 parameter, 2 given in /var/www/domain.hk/index.php on line 208\nPHP message: PHP Fatal error: Call to undefined function curl_init() in /var/www/domain.hk/extensions/google-calendar-api.php on line 12\n', referer: https://domain.hk/calendar
References
Make an HTTP Request to Twilio
Update