Results 1 to 11 of 11
-
03-24-2004, 05:56 AM #1Newbie
- Join Date
- Mar 2004
- Posts
- 8
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
-
03-24-2004, 06:05 AM #2Retired Moderator
- 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 ::
-
03-24-2004, 07:32 AM #3Newbie
- Join Date
- Mar 2004
- Posts
- 8
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"
-
03-24-2004, 08:24 AM #4Junior Guru Wannabe
- Join Date
- Feb 2004
- Posts
- 82
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.
-
03-24-2004, 09:04 AM #5Newbie
- Join Date
- Mar 2004
- Posts
- 8
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"
-
03-24-2004, 09:09 AM #6Junior Guru Wannabe
- Join Date
- Feb 2004
- Posts
- 82
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/?
-
03-24-2004, 09:23 AM #7Newbie
- Join Date
- Mar 2004
- Posts
- 8
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"
-
03-24-2004, 09:24 AM #8Junior Guru Wannabe
- Join Date
- Feb 2004
- Posts
- 82
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"
-
03-24-2004, 09:37 AM #9Newbie
- Join Date
- Mar 2004
- Posts
- 8
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.
-
03-24-2004, 11:22 AM #10Junior Guru Wannabe
- 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.
-
03-24-2004, 11:56 AM #11Newbie
- Join Date
- Mar 2004
- Posts
- 8
no luck with that. Must be a bug I think.