One PHP script on website won't run

knipper

Well-Known Member
Sep 4, 2001
107
0
316
Hey All,

I've got an odd one. Not sure if it is WHM/cpanel or PHP thing. Started About two weeks ago...

I have a server with about 50 sites. Almost all use PHP, with no problems. I'm Using shoping carts, forums, etc. all no issues.

I have one site that uses a PHP script which is a datafeed from a vendor. This script won't work. It just hangs. I contacted their tech support, they said it works fine.

I uploaded it to a different server, and yes... it does work.

As mentioned all sites, and other scripts I am not having any issues with.

Was there a recent change that would have changed PHP on the server I may have missed? Any suggestions, tips to bring everything up to speed?
 

knipper

Well-Known Member
Sep 4, 2001
107
0
316
Hi,

Without turning on error reprting via php.ini on the server I used this file on the domain:

Code:
<?php
ini_set('display_errors','1');
ini_set('display_startup_errors','1');
error_reporting (E_ALL); 

include('myfeedtest.php');
?>
Same thing happens.... page just tries to load indefinately. Just to make sure I could see errors, I added a little bad code into 'myfeedtest.php', and was able to see parse errors, etc. from the test.

Any additonal tips?
 

acenetryan

Well-Known Member
PartnerNOC
Aug 21, 2005
197
1
168
Here is how I generally troubleshoot PHP scripts.

Insert die()s into the code at various points and you can see where the code's execution reaches and where it starts to hang. It's tedious when you have a large script and often you have to jump large blocks of code, then back track narrowing it down to the specific line.

Off the top of my head, I remember I once had a problem with a script working on one server but not another. After die()ing throughout the script, I was able to find a function which used a weather information feed was timing out because our Apache timeout was set too low (We had a DDOS attack the night before and dropped the timeout to help mitigate). Kinda sounds like your issue, but without actually seeing where the script dies, it's hard to diagnose.

The one drawback to my standard debug methods is it doesn't work for Zend, Ioncube, or other encoded scripts. But then again, you generally shouldn't be debugging these scripts anyways.

Hope that helps.
 

mctDarren

Well-Known Member
Jan 6, 2004
662
6
168
New Jersey
cPanel Access Level
Root Administrator
mod_security blocking?
firewalled IP of feed?
php.ini disable_fuctions blocking a command within myfeedtest.php?

Without an error message or looking at the actual code you're not going to get the answer you need. Can you use rking's suggestion and place
Code:
die("GOT TO STEP X!");
throughout your code to see how far it gets? Might give you some idea of where the code is hanging.
 

pjman

Well-Known Member
Mar 22, 2003
101
0
166
New York
Permissions or Ownership??

Stuff like that always happen when permissions of changed either on the file or system. I find myself having to deal with that every 2 years. Check and play with the ownership and permissions of all files the script uses.