简体   繁体   English

无法使用EasyPHP运行Nexmo API

[英]Can't run Nexmo API using EasyPHP

I'm using EasyPHP on my computer as my localweb. 我在计算机上使用EasyPHP作为本地网络。 I'm trying to use pre-built PHP code to use Nexmo API available at https://github.com/prawnsalad/Nexmo-PHP-lib 我正在尝试使用预构建的PHP代码来使用https://github.com/prawnsalad/Nexmo-PHP-lib上可用的Nexmo API

But when I try to send sms, I get this error: Cannot display an overview of this response 但是,当我尝试发送短信时,出现此错误:无法显示此响应的概述

How can I fix this? 我怎样才能解决这个问题?

First can you enable error reporting: 首先可以启用错误报告:

<?php
error_reporting(E_ALL);
ini_set('display_error', 1);
?>

Secondly 其次

Can you check if you have either CURL or allow_url_fopen are enabled? 您可以检查是否启用了CURL或allow_url_fopen吗? You can create a phpinfo() file <?php phpinfo(); ?> 您可以创建一个phpinfo()文件<?php phpinfo(); ?> <?php phpinfo(); ?> . <?php phpinfo(); ?>

EDIT: 编辑:

Can you change your code to 您可以将代码更改为

<?php
include "NexmoMessage.php";
$nexmo_sms = new NexmoMessage('api_key', 'api_secret');
$info = $nexmo_sms->sendText( '+447234567890', 'MyApp', 'Hello!' );

var_dump($info);
?>

Then rebun your test and feedback. 然后重新进行测试和反馈。

Thanks, 谢谢,

Kyle, Nexmo Developer and Helpdesk Nexmo开发人员和服务台Kyle

Simply Try to change 只需尝试改变

var $nx_uri = 'https://rest.nexmo.com/sms/json';

to

var $nx_uri = 'http://rest.nexmo.com/sms/json';

(without s). (不带s)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM