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.

php includes

Discussion in 'General Discussion' started by sv1, Oct 17, 2007.

  1. sv1

    sv1 Well-Known Member

    Joined:
    Aug 31, 2003
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    What would cause php includes not to work? We've move about 60 clients to a new machine and some of their php pages are not working correcetly. I have gone through the php settings and kind find no difference from the old machine. Here is our current php:
    http://www.pwrhost.com/php.php
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    What is the error being generated in the Apache error log or error_log file?

    Are these includes to remote URLs? Are these includes to other user accounts? Or are these simply includes to files within the user account?

    Includes to remote URLs can be enabled/disabled in php.ini

    Including files from other user's accounts is disabled by SuPHP/phpSuExec.

    Including files within the user account may malfunction if that file has excessive permissions. SuPHP/phpSuExec prevents the execution of any script with global write permissions as a security measure to prevent scripts on the server from being rewritten then execute the rewritten code.
     
  3. sv1

    sv1 Well-Known Member

    Joined:
    Aug 31, 2003
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16

    I believe this is the issue. I have been over the php.ini file I don't know how many times and cannot find where this setting would be changed.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Go to WHM -> Service Configuration -> PHP Configuration Editor and click the button labeled Switch to Advanced Mode. Scroll down until you start seeing Filesystem entries, and the setting would be allow_url_fopen. Note, this does govern all file I/O operations/functions including require() and include().

    Traditionally it is strongly recommended this is turned off so in the case one of your users' scripts becomes exploited, it is harder to simply point the script to remote code to run and execute. However, if you are comfortable with that security risk, feel welcome to turn this feature on.
     
Loading...

Share This Page