Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML, CF and PHP in one problem

Status
Not open for further replies.

keneck

Programmer
Nov 26, 2002
23
US
I'm not sure this is a CF problem or PHP problem. Both are involved.

I am getting a very strange result from a scheduled task that runs code on a PHP page and then writes an XML file with the data returned. The task is set in CF Administrator to run every hour. CF is used to read the XML and put data in SQL server. This was working fine until the server had major problems and had to be fully restored.

Since the server was restored, the PHP script mirrors its own contents into the file. It correctly overwrites the existing file, but with its own script instead of the XML data. Running the same script from a different server produces the correct output. So we think it is a server problem. But is it IIS? CF or the CF Administrator scheduled task functions?

Has anyone ever experienced anything like this? The server is running Windows 2003. PHP 5 is installed and working. We are running CFMX 7. And all of this was working before the server had to be restored. We can still run it on a different server with the same basic components.

Thanks for any ideas.
 
Well, does the task run as scheduled? Then it's not the CF sheduler. Does CF read the xml file and put what it has in the SQL Server? Then it's not CF. Does PHP put correct or incorrect data in the xml file? If it's incorrect, then PHP is not working correctly. The problem exists before CF even enters the equation.


Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
Here is where things stand or fall. Still no solution, mostly more mystery.

The entire process is running without a hitch on one server, but fails completely on the other server. We have checked the xml file to which the weather data is saved on the server that works and it is valid. We have created a test file that simply returns some basic xml and run it as a scheduled task on the problem server. The result is valid. So when given a php file to run that returns xml, we get what we expect. But running the more complex php file for the weather fails on the same server, returning the script instead.

We have copied all the relevant files from the server that works to the server that doesn't work and they failed as before while still working on the other location.

We have checked IIS to be sure the MIME type for handling PHP was correct. Other scheduled tasks on the problem server that don't involve PHP seem to be working okay. However, there are several that depend on the result of the problem process and we can't test those. Those tasks are intended to parse the returned XML. We have no XML to parse.

The problem process uses the nusoap.php code and the associated class and library files. We had no need to make any special adjustments for this in the past. We have all those files working correctly on one server, but not on the other. Unfortunately, they need to work on the problem server since it is the main server and the other is an old machine used for development only, not production.

The consensus is that the problem is in PHP since CF only comes into play when saving what is passed to it by the PHP code. It saves what it is handed, but it is being handed junk. The problem isn't in the specific files since those work without a problem in another location. Something has changed with the restored server, but we still haven't tracked it down.
 
Found the solution. We had to switch to a default configuration file instead of the recommended configuration file in PHP. The original installation had used the "recommended" config. When the server was restored, we did the same installation. No clue as to what might have changed in the server restore that might have changed which config file would work, but we will look into that.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top