Results 1 to 11 of 11
  1. #1

    Talking Just got my own dedicated to learn: what is this php error?

    I guess it's php or Mysql. the error is the one below.


    Warning: main(): Failed opening 'menu.php' for inclusion (include_path='/usr/local/lib/php:/usr/lib/php') in /home/ipsha/public_html/ipsha/includes/header.inc on line 28

  2. #2
    Join Date
    Jul 2001
    Location
    Singapore
    Posts
    1,889
    It is what is shown in the error. Edit your php.ini file and locate include_path='/usr/local/lib/php:/usr/lib/php' then change it to include_path='.:/usr/local/lib/php:/usr/lib/php'. Then restart apache after changes in php.ini.
    Giam Teck Choon
    :: Join choon.net Community today to share your tips and tricks on server issues please ::
    :: Singapore Dedicated Servers :: Singapore Virtual Private Servers :: Linux/FreeBSD Server Management ::

  3. #3
    Thanks, but this does not help. I got the below in php.


    ;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Paths and Directories ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;

    ; UNIX: "/path1:/path2"
    ;include_path = ".:/usr/local/lib/php:/usr/lib/php"
    ;
    ; Windows: "\path1;\path2"
    ;include_path = ".;c:\php\includes"

  4. #4
    You need to remove the ; from the beginning of the first include_path = line to end up with this:

    ;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Paths and Directories ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;

    ; UNIX: "/path1:/path2"
    include_path = ".:/usr/local/lib/php:/usr/lib/php"
    ;
    ; Windows: "\path1;\path2"
    ;include_path = ".;c:\php\includes"

    Then restart apache for the changes to take affect.

  5. #5
    Still does not go.

    I tried

    include_path = ".:/usr/local/lib/php:/usr/lib/php"
    ;include_path = ".:/usr/local/lib/php:/usr/lib/php"
    include_path = ":/usr/local/lib/php:/usr/lib/php"
    include_path = "/usr/local/lib/php:/usr/lib/php"
    include_path = "./usr/local/lib/php:/usr/lib/php"

  6. #6
    Are you sure your restarted apache (normally accomplished by: service httpd restart)?

    Even though afaik PHP is only launched when you run a script, it only reloads the ini file when apache reloads.

    It should be this:
    include_path = ".:/usr/local/lib/php:/usr/lib/php"

    If that still doesn't work then it is possible that you have missed a file of whatever script you are trying to use so it can't actually find the file it is trying to include. Is there a file called menu.php in the same folder as the script you are running or possibly in /home/ipsha/public_html/ipsha/includes/?

  7. #7
    I use: /etc/rc.d/init.d/httpd restart

    I have added the below again and tried your code and it restarted, but jsut the same. I will check the files.

    ;include_path = ".:/usr/local/lib/php:/usr/lib/php"

  8. #8
    You need to remove the ; at the beginning - the ; indicates it is a comment so will be ignored by PHP. You need the line to be:

    include_path = ".:/usr/local/lib/php:/usr/lib/php"

  9. #9
    The file is there and all is fine. I move dthe ';' but still the same. I also ran the apache check and saw no errors.

  10. #10
    Join Date
    Mar 2004
    Posts
    31
    ok this is going to sound silly but are you using the full path to the filename in the include function...

    include('/home/user/public_html/file.inc');

    also I've noticed sometimes if you put the include line on a different line of the <?php and ?> tags that can clear up the error as well...

    <?php
    include('/home/user/public_html/file.inc');
    ?>

    Hope this helps cause it looks to me like you are just using the filename and not telling php where the file is located in relationship to the document that is trying to include it so it looks in the default include directories.

  11. #11
    no luck with that. Must be a bug I think.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •