Javascript 发送消息的ajax函数调用,给出500个内部服务器错误

Javascript 发送消息的ajax函数调用,给出500个内部服务器错误,javascript,php,jquery,ajax,Javascript,Php,Jquery,Ajax,以下代码在触发以下代码时调用ajax函数将消息发送给用户,并给出500个内部服务器错误jquery.min.js 这些文件托管在amazon aws中。当相同的代码在普通的bigrock服务器上测试时,它工作正常,当托管在amazon上时,它给出了500个内部服务器错误 function sendotp(){ var vl = parseInt($('#otp').val()); var contact = $('#contact').val();

以下代码在触发以下代码时调用ajax函数将消息发送给用户,并给出500个内部服务器错误jquery.min.js 这些文件托管在amazon aws中。当相同的代码在普通的bigrock服务器上测试时,它工作正常,当托管在amazon上时,它给出了500个内部服务器错误

function sendotp(){
var vl = parseInt($('#otp').val());      
    var contact = $('#contact').val(); 
            //alert(contact);
        $.ajax({
        url: "validation.php", 
        type:'POST',
         data: {
                contact: contact,vals : vl
            },
        success: function(data){

        }
    });

}
下面是validation.php中的php代码

if(isset($_POST['contact']))
{
 $otp = $_POST['vals'];
     $contact_number = explode('-',$_POST['contact']);
     $number = $contact_number[1];
     $sms = "Your OTP Varification Code For Wrap2Earn Registration is ".$otp.".";

/*  sms Integration  */
//Your authentication key
$authKey = "XXXXX";

//Multiple mobiles numbers separated by comma
$mobileNumber = $number;

//Sender ID,While using route4 sender id should be 6 characters long.
$senderId = "XXXXXX";

//Your message to send, Add URL encoding here.
$message = urlencode("$sms");

//Define route
$route = "4";
//Prepare you post parameters
$postData = array(
    'authkey' => $authKey,
    'mobiles' => $mobileNumber,
    'message' => $message,
    'sender' => $senderId,
    'route' => $route
);

//API URL
$url="https://control.msg91.com/api/sendhttp.php";

// init the resource
$ch = curl_init();
curl_setopt_array($ch, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => $postData
    //,CURLOPT_FOLLOWLOCATION => true
));


//Ignore SSL certificate verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);


//get response
$output = curl_exec($ch);

//Print error if any
if(curl_errno($ch))
{
    echo 'error:' . curl_error($ch);
}

curl_close($ch);
}

curl
启用了吗?是的,它在服务器中启用了,where is
validation.php
hosted?在amazon ec2服务器中谢谢jaromanda X我重新安装了curl并启用了它的工作状态现在是
curl
启用了吗?是的,它在服务器中启用了,where is
validation.php
hosted?在amazon ec2服务器中谢谢jaromanda X我重新安装了旋度,使其工作良好