简体   繁体   English

500 curl内部服务器错误

[英]500 Internal Server Error with curl

I've run out of ideas of what might causes the 500 Internal Server Error with cURL 我用尽了所有可能导致cURL导致500 Internal Server Error的想法

$someString = '7abcd684efg1hi085b7b47dc4e508e99a5edcba9';
$url = 'http://192.168.254.211:8080/sampleProject/auth/logout/'.$someString;
$logoutCurl = curl_init($url);
curl_setopt_array($logoutCurl, 
    array(
        CURLOPT_URL => $url,
        CURLOPT_POST => true,
        CURLOPT_HEADER => false,
        // CURLOPT_RETURNTRANSFER => true,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_HTTPHEADER => array(
            'Content-Type: application/json', 
            'jrr: '.$jrr, 
            'slave: '.$slave,
            'spoil: '.$spoil
        )
    )
);
curl_exec($logoutCurl);
curl_close($logoutCurl);

It keeps on giving me the Internal Server error, and it says that it doesn't actually call the server, but I'm sure I'm properly connected to the server as I can successfully login. 它不断给我“内部服务器”错误,并说它实际上并未调用服务器,但是我确定我可以正确登录,因此可以正确连接到服务器。

Some notes: $someString is a string added to the url as it is required by the server. 一些注意事项: $someString是服务器需要的添加到URL的字符串。 $jrr , $slave , and $spoil are required to be pass. 必须传递$jrr$slave$spoil the server doesn't return or respond anything, I just need to get the 200 status. 服务器没有返回或响应任何内容,我只需要获取200状态即可。 Is there something that I'm missing out on cURL? 我在cURL上缺少什么吗?

thanks! 谢谢!

我删除了CURLOPT_POST => true因为我实际上没有将变量传递给页面,这就是为什么我认为curl_error给我400 Bad Request

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

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