Needing help with php versions i think.

Discussion in 'PHP' started by jimmybloggs91, Apr 19, 2008.

  1. #1
    hey when i look at my site (www.cancernewsnow.com) all i get is a completely white screen, i think it has something to do with the versions of php. but i am not sure. could anyone look at my code for me quickly and help me out?

    /////////////////////////////////////////////////////////////////////////////////////

    // Make sure the PHP later version fix is in place

    /////////////////////////////////////////////////////////////////////////////////////



    /* PHP 4.20+ FIX */

    $list = array('_COOKIE','_ENV','_FILES','_GET','HTTP_COOKIE_VARS','HTTP_GET_VARS','HTTP_POST_VARS', 'HTTP_POST_FILES', '_POST','_SERVER','_SESSION','_SYSTEM');

    foreach($list as $element) {

    if(!empty($$element) && is_array($$element) ) {

    extract($$element);

    }

    }



    if (phpversion() < "4.1.0") {

    $_GET = $HTTP_GET_VARS;

    $_POST = $HTTP_POST_VARS;

    $_COOKIE = $HTTP_COOKIE_VARS;

    $_SESSION = $HTTP_SESSION_VARS;

    $_ENV = $HTTP_ENV_VARS;

    $_SERVER = $HTTP_SERVER_VARS;

    $_FILES = $HTTP_FILES_VARS;

    $_REQUEST = array_merge($_GET, $_POST, $_COOKIE);

    }



    I am with hostgator as well if this helps anyone

    any help will be greatly appreciated
     
    jimmybloggs91, Apr 19, 2008 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Your code is creating an environment like register_globals on. It is not displaying anything.
     
    mwasif, Apr 19, 2008 IP
  3. phpl33t

    phpl33t Banned

    Messages:
    456
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I see error 500. Instead of calling the php functions in .htaccess, try creating a file called php.ini and putting them there. Then upload to web root.
     
    phpl33t, Apr 19, 2008 IP
  4. XiNiX

    XiNiX Well-Known Member

    Messages:
    194
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    110
    #4
    If u are on a Shared Hosting Then Most Probably you wont have access to the php.ini File. Only ur Admins can handle it.

    And Yes, These and similar errors are almost always caused by .htaccess. The .htaccess file is used by Textpattern to mange “clean” URLs – example.com/articles/123/hello-world instead of example.com/index.php?id=123. . A 500 Internal Server Error or 403 Forbidden response is usually the result of a .htaccess file that tries to exceed these restrictions .

    What can u do ?

    The simplest thing you can do to fix the problem is simply delete or rename .htaccess,

    OR Try to comment lines in .htaccess file. Some of them must cause this error.

    Also, With 500 internal server errors, you should check your web server logs to see what the problem is, though with this situation the above suggestion would do the trick too.

    I would recommend, especially for the .htaccess file, to edit it using the cPanel's File Manager.
     
    XiNiX, Apr 19, 2008 IP
  5. phpl33t

    phpl33t Banned

    Messages:
    456
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #5
    As I said, on MOST modern shared hosts, you just upload your own php.ini to your web root. It will override the defaults. That is what to do if you cannot use the options in .htaccess. This applies to hostgator, godaddy, aplus.net, and many more. Using php.ini settings in .htaccess brings up 500, not 403, when the host does not allow them in there. This is only 10 years experience talking from a guy with numerous dedicated linux servers and an associates degree in Web Development.
     
    phpl33t, Apr 19, 2008 IP