tags:

views:

116

answers:

0

Hi all:

I have a php script that updates a database via an api. This script works on one server but not on another. Both servers have curl enabled and they have php 5.2.6 or above. The error happens in the do_put() method. The rest of the script seems to be fine.

I have found that: curl_errno= 55 = "Failed sending network data". curl_error= select/poll returned error

<?php 
//phpinfo();
require_once "class.DelveAuthUtil.php"; 

$access_key = "";
$secret = "W";
$org_id = "";
$media_id = "";
$new_tag_name = "uvideo";

$assign_tag_to_media_url = "http://api..com/rest/organizations/$org_id/media/$media_id/properties/tags/$new_tag_name";

$signed_create_new_tag_url = DAU::authenticate_request("PUT", $assign_tag_to_media_url, $access_key, $secret);


# perform the creation of the new custom property               
$put_response = do_put($signed_create_new_tag_url); 
# Execute the POST
function do_post($url, $params=array()) {
# Combine parameters
$param_string = "";    
foreach ($params as $key => $value) {
  $value = urlencode($value);
  $param_string = $param_string . "&$key=$value";
}
// Get the curl session object
$session = curl_init($url);
// Set the POST options.
curl_setopt ($session, CURLOPT_POST, true);    
curl_setopt ($session, CURLOPT_POSTFIELDS, $param_string);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

// Do the POST and then close the session
$response = curl_exec($session);
curl_close($session);
return $response;
}



  # Execute the PUT
  function do_put($url) {
// Get the curl session object
$session = curl_init($url);
print(" <br> session= " . $session . "<br>");
// Set the PUT options.
print ("opt0= " . curl_setopt($session, CURLOPT_VERBOSE, TRUE) . "<br>");    
print ("opt1= " . curl_setopt ($session, CURLOPT_PUT, true) . "<br>");
print ("opt2= " . curl_setopt ($session, CURLOPT_HEADER, false) . "<br>");
print ("opt3= " . curl_setopt ($session, CURLOPT_RETURNTRANSFER, true) . "<br>");
// Do the PUT and then close the session
$response = curl_exec($session);

if (curl_errno($session)) {
print ( "curl_errno= " . curl_errno($session). "<br>");
 print( "curl_error= " . curl_error($session) . "<br>");
} else {
 curl_close($session);
}
}

I have small lead in the Apache log - there is an SSL issue that I do not know how to resolve.

[Thu Mar 25 15:57:58 2010] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Thu Mar 25 15:57:58 2010] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Thu Mar 25 15:58:59 2010] [notice] caught SIGTERM, shutting down
[Thu Mar 25 15:58:59 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Mar 25 15:58:59 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Mar 25 15:58:59 2010] [warn] RSA server certificate CommonName (CN) `yourvps.a2hosting.com' does NOT match server name!?
[Thu Mar 25 15:58:59 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Mar 25 15:58:59 2010] [warn] RSA server certificate CommonName (CN) `yourvps.a2hosting.com' does NOT match server name!?
[Thu Mar 25 15:58:59 2010] [warn] Init: SSL server IP/port conflict: my1.com:443 (/home/httpd/my.com/conf/kloxo.my1.com:69) vs. elggtest.my1.com:443 (/home/httpd/elggtest.my1.com/conf/kloxo.elggtest.my1.com:71)
[Thu Mar 25 15:58:59 2010] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Thu Mar 25 15:58:59 2010] [notice] Digest: generating secret for digest authentication ...
[Thu Mar 25 15:58:59 2010] [notice] Digest: done
[Thu Mar 25 15:59:00 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Mar 25 15:59:00 2010] [warn] RSA server certificate CommonName (CN) `yourvps.a2hosting.com' does NOT match server name!?
[Thu Mar 25 15:59:00 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Thu Mar 25 15:59:00 2010] [warn] RSA server certificate CommonName (CN) `yourvps.a2hosting.com' does NOT match server name!?
[Thu Mar 25 15:59:00 2010] [warn] Init: SSL server IP/port conflict: my1.com:443 (/home/httpd/my1.com/conf/kloxo.my1.com:69) vs. elggtest.my1.com:443 (/home/httpd/elggtest.my1.com/conf/kloxo.elggtest.my1.com:71)
[Thu Mar 25 15:59:00 2010] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Thu Mar 25 15:59:00 2010] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations[/PHP]

Any help would be great!

Thanks, 4dplane