Forum Moderators: coopster
Failed opening 'Includes/global.inc.php' for inclusion (include_path='.:/usr/share/pear')
I'm guessing that it's looking in php.ini where the include_path is currently commented out althought I have had it uncommented and get the same error.
I've read that you should also have register_globals = On which I do.
I don't know where it's getting '/usr/share/pear' but with '.' at the beginning meaning current directory I figured what do I care.
I've done a search through here and on the net a bit with no help so hopefully one of you php guru's can lend a hand.
Later...
identify the line the error is from, i expect something like:
include("./Includes/global.inc.php");
then manually check that ./Includes/global.inc.php exists on the server - remember to be case sensitive
if you've not installed at the root and the script is made for installation at the root then it MAY cause this problem. the most likley cause however is that file isn't in /Includes, (or the address ./Includes/global.inc.php is wrong)
--------------------------------
As for what the actual line causing the error is..
Include("Includes/global.inc.php");
was the original and I did switch to
Include("./Includes/global.inc.php");
and still nothing worked (which I figured).
--------------------------------
Here's the full error..
Failed opening './Includes/global.inc.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/phpInv/index.php on line 2
In my 'phpInv' folder where index.php is located there is a folder call 'Includes' with a capital I. In there there's global.inc.php.
Everything looks as it should be fine. I would like to know though where the error gets the include_path='.:/usr/share/pear' though as in etc/php.ini the include_path=".:/php/includes"
This by default was commented out so I'm wondering if something else is causing php to maybe look somewhere else and hence bring up this /usr/share/pear stuff.
----------------------
No, it's not installed in the root as you can see from above. I had an older computer sitting around and figured that since I'll be working more and more with php I would set up a little dev area. Bottom line, I'm newer to this so any suggestions are very welcome :)
include("Includes/global.inc.php");
-coupling this with the error..
Failed opening 'Includes/global.inc.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/phpInv/index.php on line 2
-this is leaving my noob self thinking that for whatever reason it can't find that darn global.inc.php file.
--------------------------------------
-the global.inc.php file does have includes in itself, but it looks we haven't got far enough for that to matter.
--------------------------------------
-Do any of you have a Theory on where that '.:/usr/share/pear' stuff is coming from in the error as I assure you it's not from the etc/php.ini file.
- is there a way to check using grep or something?
Thx again..
Looking in the file I'm seeing
Include("$str.IncludePrefix."/generalFunctions.inc.php");
all the other includes are in the same directory so taking out that initial garbage (it's garbage right?) I get
Include("generalFunctions.inc.php");
and doesn't give me any errors.
The program seems to work (kinda). I'm going to go back to one of the better ones I had this error with and see if it runs better once (if I can) fix it...
Thanks.
Also, did you change anything in your php.ini file and then not HUP the server. Server must be HUPPED after changing php.ini.
Here is a peak at it:
In addition there is a php.ini in your server php directory:
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/includes"
;
; Windows: "\path1;\path2"
include_path = ".;c:\apache\php\pear"
You will need to edit it:
in my case:
; Windows: "\path1;\path2"
include_path = ".;c:\apache\htdocs\includes"