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 include file not working

Discussion in 'General Discussion' started by neronebr, Apr 15, 2014.

  1. neronebr

    neronebr Registered

    Joined:
    Apr 14, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I'm trying to use PHP to create my website. The home page is index.php, and it has several include statements. There are only a few include statements:
    include("pages/header.htm");
    include("pages/nav.htm");
    include("pages/body.htm");
    include("pages/footer.htm");
    The folder pages is a folder I created within the public_html folder; all of the files listed here exist. But they are not being found when the script is run. I've tried modifying the .htaccess file in the public_html directory with the line php_value include_path ".:/home/neronebr/public_html/pages"
    but that gives a 500 Internal Server Error. I also tried adding the line
    ini_set("include_path", "pages");
    in the php file, which caused no change in the output. The line
    set_include_path("pages");
    was equally unsuccessful. What should I do to allow the php script to include the .htm pages properly?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    This forum is primarily intended for matters related to the cPanel/WHM software itself. You will likely receive more feedback for this question on a forum that specializes in PHP coding or web design.

    Thank you.
     
Loading...

Share This Page