Using Ubuntu 10.04.4 LTS. We run a php script that pulls info using XML from another server. We are not very familiar with XML. For example when we run:

php5 xmlrequest.php

We are supposed to get data from the other server and we see the output right on the terminal. We column names without the data. I have run:

sudo dpkg-reconfigure php5

And it worked. Not sure why. For the past week we have been trying the same solution, but it does not work anymore. We migrated from a shared server running CentOS to a VPS running Ubuntu. This is when issues started. Any suggestions? Help is very appreciated. Let me know if i am missing information. Thanks.

NyteOwl

07-30-2012 03:37 PM

Have you checked to amke sure all your paths are correct? Not only to the data on the other server but to php etc?

And nothing is updated. On the older(CentOS) server it works. How can I compare server configurations? Any ideas? Thanks again!

Wim Sturkenboom

08-02-2012 01:32 AM

The first part is the output of a print_r statement in php. That might be debugging info that the programmer has put in.
The second part is HTML code and makes me think that you're supposed to access the page using a web browser.

Your output seems to be incomplete; any chance that you can redirect the output to a file and post it here (either as attachment or between [code] and [/code] (instead of between [quote] and [/quote]). You might have missed error messages that scrolled over the screen.

From the fact that you get output I conclude that php is working and that this is not a php issue directly; maybe compatibility between different versions of php. Without knowing what your xmlrequest.php is exactly doing, it's difficult to say what is going on.

I guess it's time to call the programmer(s) in who wrote the application. Or start posting the code of xmlrequest.php here before anything meaningful can be said.

cucolin@

08-02-2012 08:34 AM

Yes, I forgot to post the code. I will post it shortly. Thanks again Wim Sturdenboom!

cucolin@

08-02-2012 12:12 PM

1 Attachment(s)

Here is the code. I have remove credentials for security reason. Thanks for your help!

Wim Sturkenboom

08-02-2012 03:02 PM

OK, that code probably a little over my head.

I indicated earlier that your text dump was not complete. I like to see what echo $res; displays on your screen and I expect echo "<br>total ".$products->length; to tell you that the total is zero.

cucolin@

08-02-2012 03:07 PM

1 Attachment(s)

Thanks!
Attached is the text dump of the complete output.
I appreciate your help.

Wim Sturkenboom

08-03-2012 01:58 AM

Trying to help is a pleasure. Unfortunately I can't really help further because I don't know anything about curl.

I suspect the problem to be in the curl part (curl_init() up to curl_close()) because $res seems to be empty.

Why this happens, I don't know. Connectivity is the prime suspect for me, but I might be totally wrong. Can you access the url using a web browser, can you ping the server?

cucolin@

08-03-2012 10:24 AM

1. Yes, I can access the URL using the web browser
2. Yes, I can ping the server.
Thanks for helping!