Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Sep 2001
    Posts
    107

    Default One PHP script on website won't run

    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?

  2. #2
    Member
    Join Date
    Jul 2006
    Posts
    290

    Default

    Have you tried turning on error display, or checking logs to see if it is reporting any problems?

  3. #3
    Member
    Join Date
    Sep 2001
    Posts
    107

    Arrow

    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?

  4. #4
    cPanel Partner NOC cPanel Partner NOC Badge rking's Avatar
    Join Date
    Aug 2005
    Posts
    192

    Default

    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.

  5. #5
    Member serversphere's Avatar
    Join Date
    Jan 2004
    Posts
    658

    Default

    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.

  6. #6
    Member
    Join Date
    Mar 2003
    Location
    New York
    Posts
    101

    Exclamation 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.

Similar Threads & Tags
Similar threads

  1. forcing php script to run with dedicated IP
    By BigLebowski in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-07-2011, 08:47 PM
  2. Cron Job, Run PHP script
    By bowers01 in forum New User Questions
    Replies: 2
    Last Post: 11-18-2010, 03:23 PM
  3. Replies: 3
    Last Post: 03-29-2007, 04:31 AM
  4. Apache won't start - httpd configtest won't run as root??
    By linearfusion in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 10-04-2006, 04:44 PM
  5. How to make PHP script to run with the user's id?
    By smartinfo in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-21-2002, 02:51 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube