The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

One PHP script on website won't run

Discussion in 'General Discussion' started by knipper, Feb 3, 2009.

  1. knipper

    knipper Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    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. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
    Have you tried turning on error display, or checking logs to see if it is reporting any problems?
     
  3. knipper

    knipper Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    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. acenetryan

    acenetryan Well-Known Member
    PartnerNOC

    Joined:
    Aug 21, 2005
    Messages:
    197
    Likes Received:
    1
    Trophy Points:
    18
    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. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    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.
     
  6. pjman

    pjman Well-Known Member

    Joined:
    Mar 22, 2003
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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.
     
Loading...

Share This Page