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.

Upgraded to PHP 5 and simple includes are not working

Discussion in 'General Discussion' started by sh4ka, Dec 4, 2007.

  1. sh4ka

    sh4ka Well-Known Member

    Joined:
    May 12, 2005
    Messages:
    442
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    US
    cPanel Access Level:
    DataCenter Provider
    We upgraded 7 servers from our network from PHP 4.4.7 to PHP 5.2.5, and Apache 1.3.3.9 to Apache 2.0.61. In only one of this servers we found problems with includes...

    Include example that works:

    Code:
    <?
    include("http://www.google.com");
    ?>
    
    This doesnt work:

    Code:
    <?
    include("path/file.php");
    ?>
    And path/file.php does exist, also log error from apache doesnt even show a line .

    allow_url_fopen was replaced by allow_url_include and it's set to On.

    Any ideas? Im using PHP 5.2.5, Apache 2.0.61, cPanel and RHES 4.

    Thanks.

    PD: i already disabled zend optimizer, and still doesnt work.
     
  2. MaraBlue

    MaraBlue Well-Known Member

    Joined:
    May 3, 2005
    Messages:
    335
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Carmichael, CA
    cPanel Access Level:
    Root Administrator
    Register globals are off by default in PHP 5, and includes need to be written differently.

    http://us2.php.net/manual/en/security.registerglobals.php

    You can test this by turning register_globals on in php.ini (just for testing purposes, or to give you time to re-write the code). This link should get you going in the right direction:

    http://us2.php.net/variables.predefined

    Oops...my bad. Nevermind. I saw your phpinfo posted in another forum in regards to this. This won't help you at all, but I have no idea what the problem could be. It would make perfect sense if the absolute path / external URL didn't work, that would point to allow_url_fopen being disabled, but you've already said that's on.

    You might try enabling enable_dl just for testing, to see if that's a possibility. Btw, you also mentioned it working when you downgraded, until you reinstalled Zend 3.2.8. AFAIR, Zend installs it's own php.ini. Which would be something else to check is that you're looking at the correct php.ini.

    I'd love to hear what the problem was when you find what caused this.
     
    #2 MaraBlue, Dec 6, 2007
    Last edited: Dec 9, 2007
  3. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    File is in same directory.
    include './file.php';

    File is in directory relative to current file.
    include './directory/file.php';

    File is one directory up from current file
    include '../directory/files.php';

    PHP just likes to know where you're asking from. Check to see if this works with your PHP setup.
     
    #3 darren.nolan, Dec 6, 2007
    Last edited: Dec 6, 2007
Loading...

Share This Page