Php include path


#1

Hi, I checked an earlier thread here, but I believe I have done what was recommended and it isn’t finding my include path.

Here is my code:

ini_set(‘include_path’, ini_get(‘include_path’).’:’.$_SERVER[‘DOCUMENT_ROOT’].’/includes’);

I get this error message:
Failed opening ‘connect.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php:/home/columbuswebmakers/townlinefarm.com/includes’) in /home/.hunter/columbuswebmakers/townlinefarm.com/admin/MailingList.php

I see the difference seems to be the .hunter directory, but I’m not sure what to do about this, since $_SERVER[‘DOCUMENT_ROOT’] doesn’t seem to know about it.


#2

Your include_path is working fine. The error message, in parenthesis, tells you what the parser thinks your include path is, and it’s exactly what you set in your ini_set() call.

The .hunter part isn’t important, you don’t need to worry about it. Just consider these two paths to be the same. You can read more about this if you’re interested.

Look for the problem in MailingList.php or in the contents of your includes directory.


If you want useful replies, ask smart questions.


#3

hmmm. I was sure you were wrong, … until I checked my path, and realized my file was not in ‘includes’ but elsewhere.

thanks