Forum Moderators: coopster

Message Too Old, No Replies

include_path

It's causing me greif :P

         

Abdar

2:45 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



I was just trying out a couple open source "Inventory" managers and the last 3 that I have tried have been giving me the same error along the lines of..

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...

Robber

3:57 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



Is the file to be included in a folder called Includes? It looks like that is where the script is looking but it cant fine the include there - it will only look at the path you specify, the current folder or the pear folder.

Abdar

4:31 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



Ya, the 'Includes' folder is in the current folder so I don't know what to think.

In php.ini is says nothing about '/usr/share/pear' though so I don't know where it's getting that.

include_path = ".:/php/includes" is actually what it says

Any ideas?

Timotheos

5:50 pm on Jul 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you have PEAR installed?

vincevincevince

7:16 pm on Jul 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



don't worry about that error - do worry about the include line in the code

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)

Abdar

8:58 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



I'm not sure what PEAR is Timotheos but using '$locate pear' in Unix I do hit a lot of /usr/share/pear/whatever.

--------------------------------
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 :)

Robber

9:06 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



Is the offending line in the main file or is it in an include itself - I recently had troubles on a certain setup with an include trying to include something else.

Abdar

10:27 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



-index.php among other php files like login.php and help.php use the same thing on the second line..

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..

vincevincevince

10:41 pm on Jul 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



is that the ONLY error?
if there is an error within global.inc.php then you'll get the one you reported here afterwards

Abdar

11:03 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



Ya, I ran the global.inc.php and got errors.

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.

charlier

1:56 pm on Jul 10, 2003 (gmt 0)

10+ Year Member



A couple things to try, put
<? phpinfo()?>
exit;
at the top of your index page and see where it says its reading the ini file from, check for a prepend file that is changing your include path, (or an .hataccess). Also do a locate for "global.inc.php".

Also, did you change anything in your php.ini file and then not HUP the server. Server must be HUPPED after changing php.ini.

russgri

7:24 pm on Jul 12, 2003 (gmt 0)

10+ Year Member



In Windows the php.ini is in the windows directory or sometimes in C:\winnt\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"