Welcome Guest, Not a member yet? Register   Sign In
XML error using php v5.2.2 but works on php v5.2.1
#1

[eluser]gtech[/eluser]
I have two installations on two separate machines of Xampp (apache friends) which is a distribution of php 5.2.x, mysql and apache.

The two machines have exactly the same CI code (I retrieved it from a SVN repository).
Both machines are running windows XP. The only difference is one Xampp install is slightly newer than the other.

the new installation (where xmlrpc does not work) is running php 5.2.2.
the old installation (where xmlrpc deos work) is running php 5.2.1

I get the following error on the machine with php 5.2.2 when sending a request from the client to a server using the XMLRPC libraries

Code:
XML error: Invalid document end at line 1

however on the machine with 5.2.1 it works wonderfully, and I get a response back.

alexsancho made a fix which makes the code work on my 5.2.2 machine, however I dont know if it works for all PHP versions... please [url="http://ellislab.com/forums/viewthread/63287/"](see thread 63287)[/url]

here is my code, I have commented where the code fails.
Code:
function index()
    {    

        // XML RPC CLIENT
        $this->load->helper('url');
        $server_url = site_url('myxml/server');

        $this->load->library('xmlrpc');
        
        $this->xmlrpc->server($server_url, 80);
        
        $this->xmlrpc->method('Greetings');
        
        $request = array('hello');
        $this->xmlrpc->request($request);    
        
        // THIS IS WHERE IT FAILS ON PHP 5.2.2
        if ( ! $this->xmlrpc->send_request())
        {
           // PHP 5.2.2 CODE PATH
            echo $this->xmlrpc->display_error();
        }
        else
        {
           // PHP 5.2.1 CODE PATH
            echo '<pre>';
            $res = $this->xmlrpc->display_response();
            print_r($res);
            echo '</pre>';
        }
    }


have the XML libraries been tested on installations which have a php version greater than 5.2.1?

many thanks.




Theme © iAndrew 2016 - Forum software by © MyBB