简体   繁体   English

错误500找不到Http响应代码

[英]Error 500 No Http response code found

joomla 2.5.18 php -5.4.12 apache - 2.4.4 mysql - 5.6.12 , I am trying to post data on particular url and get the response, Here is my code joomla 2.5.18 php -5.4.12 apache-2.4.4 mysql-5.6.12,我正在尝试在特定的url上发布数据并获得响应,这是我的代码

jimport('joomla.http');
$data = array('foo' => 'bar'); //sample data array
$transport = null;
$transportWrappers=array('JHttpTransportCurl','JHttpTransportStream','JHttpTransportSocket');

$moduleParams = new JRegistry();
while (!$transport && $transportWrappers)
    try{
        $wrapper = array_shift($transportWrappers);
        $transport = new $wrapper($moduleParams);
    }
    catch (Exception $e){
        continue;
    }
$http = new JHttp($moduleParams, $transport);

$url = 'my_url';
$response = $http->post($url,$data);
print_r($response);

I have also checked other forums with same problem , they suggested to check #_update_sites table , my table is fine, no unknown data is there . 我还检查了其他具有相同问题的论坛,他们建议检查#_update_sites表,我的表很好,那里没有未知数据。 I am unable to figure out where is the problem.I tried the same code for different url.It worked. 我无法弄清楚问题出在哪里,我为不同的URL尝试了相同的代码。 I dont think there is problem in my url. 我认为我的网址没有问题。 Here is my apache log error 这是我的Apache日志错误

[Wed Mar 26 13:50:51.154818 2014] [:error] [pid 4504:tid 1664] [client ::1:51174] PHP 13. JHttp->post() C:\\wamp\\www\\joomla\\components\\com_name\\views\\abc\\tmpl\\default.php:70 [Wed Mar 26 13:50:51.154818 2014] [:error] [pid 4504:tid 1664] [client ::1:51174] PHP 14. JHttpTransportCurl->request() C:\\wamp\\www\\joomla\\libraries\\joomla\\http\\http.php:122 [Wed Mar 26 13:50:51.154818 2014] [:error] [pid 4504:tid 1664] [client ::1:51174] PHP 15. JHttpTransportCurl->getResponse() C:\\wamp\\www\\joomla\\libraries\\joomla\\http\\transport\\curl.php:134 [2014年3月26日星期三13:50:51.154818] [:错误] [pid 4504:tid 1664] [客户端:: 1:51174] PHP 13. JHttp-> post()C:\\ wamp \\ www \\ joomla \\ components \\ com_name \\ views \\ abc \\ tmpl \\ default.php:70 [2014年3月26日星期三13:50:51.154818] [:错误] [pid 4504:tid 1664] [客户端:: 1:51174] PHP 14. JHttpTransportCurl-> request ()C:\\ wamp \\ www \\ joomla \\ libraries \\ joomla \\ http \\ http.php:122 [2014年3月26日星期三13:50:51.154818] [:错误] [pid 4504:tid 1664] [客户端:: 1: 51174] PHP 15. JHttpTransportCurl-> getResponse()C:\\ wamp \\ www \\ joomla \\ libraries \\ joomla \\ http \\ transport \\ curl.php:134

Please help here. 请在这里帮助。

[UPDATED] It was the Wamp version problem , i tried the same codes in Xampp and it worked. [更新]这是Wamp版本的问题,我在Xampp中尝试了相同的代码,并且有效。

Introduction 介绍

The Web server (running the Web Site) encountered an unexpected condition that prevented it from fulfilling the request by the client (eg your Web browser or our CheckUpDown robot) for access to the requested URL. Web服务器(运行Web站点)遇到意外情况,阻止其满足客户端(例如Web浏览器或CheckUpDown机械手)对请求的URL的访问请求。

This is a 'catch-all' error generated by the Web server. 这是Web服务器生成的“全部捕获”错误。 Basically something has gone wrong, but the server can not be more specific about the error condition in its response to the client. 基本上发生了问题,但是服务器在响应客户端时无法更具体地说明错误情况。 In addition to the 500 error notified back to the client, the Web server should generate some kind of internal error log which gives more details of what went wrong. 除了将500错误通知给客户端之外,Web服务器还应生成某种内部错误日志,该日志提供了发生错误的详细信息。 It is up to the operators of the Web server site to locate and analyse these logs. 由Web服务器站点的操作员确定和分析这些日志。 (Last updated: October 2013) (最新更新:2013年10月)

Fixing 500 errors - general 解决500个错误-一般

This error can only be resolved by fixes to the Web server software. 该错误只能通过对Web服务器软件的修复来解决。 It is not a client-side problem. 这不是客户端问题。 It is up to the operators of the Web server site to locate and analyse the logs which should give further information about the error. 由Web服务器站点的操作员确定和分析日志,日志应提供有关该错误的更多信息。

Fixing 500 errors - CheckUpDown 修复500个错误-CheckUpDown

Our service monitors your site for HTTP errors like 500. Please contact us (email preferred) whenever you encounter 500 errors on your CheckUpDown account. 我们的服务会监视您的站点中是否存在HTTP错误(例如500)。如果CheckUpDown帐户遇到500错误,请与我们联系(首选电子邮件)。 We then have to liaise with your ISP and the vendor of the Web server software so they can trace the exact reason for the error. 然后,我们必须与您的ISP和Web服务器软件的供应商联系,以便他们可以跟踪错误的确切原因。 Correcting the error may require recoding program logic for the Web server software, which could take some time. 纠正错误可能需要重新编码Web服务器软件的程序逻辑,这可能需要一些时间。

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

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