setting php include path on Windows XP?

I have an interesting problem.  I have PHP installed on the system root of a Windows XP install (G:\PHP)

In my php.ini (G:\Windows\php.ini) I have the include path set to:

include_path = .;G:\php\includes

If I run a simple phpinfo(); however, under "PHP Core" the include path shows up as:

.;C:\php5\pear

And as a result it's throwing the obvious errors.   Where then, is that directive pulling from?

The obvious fix (and one thats tested/works) is to just create that said directory on the C partition and shove my included files into there, but the C partition belongs to another user, and I'd prefer to fix it properly.

 My first thought was an errant php.ini but I confirmed the loaded config file as G:\WINDOWS\php.ini


Any suggestions?

Thanks!
jmoriartyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AielloJCommented:
The directive is being pulled from the Windows path.  The .ini file tells PHP how to find its files once it's running.  Next you have to tell Windows how to find the PHP files to get them running in the first place.  There's also a search order of how PHP looks for files.  I don't have the particulars in my head, but the process below will clear it up.

Add G:\WINDOWS to the default Windows path.  You can alter it by clicking on System in the Windows Control Panel, click on the Advanced tab, then click on the Environment Variables button at the bottom on the panel.
0
jmoriartyAuthor Commented:
Hi AielloJ,

Thanks for the comment! Unfortunately, that didn't fix it.  I'd already had G:\PHP in the environment path, and I did add G:\Windows like you suggested, but with, unfortunately, the same result.
0
jmoriartyAuthor Commented:
Hrm, maybe the problem is the format I'm using to set the directory? I was actually able to get it to change, I had forgotten quotes around the path, so it acted as if the line were commented I'm guessing.

I'm still getting weird include errors though.  

Here's what I have right now, to both set a specific directory (php\includes) and set the \includes directory one level above the current one. Is this the correct format to use for that on Windows?

include_path = "G:\php\includes; .\includes"

Thanks again.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

AielloJCommented:
jmoriarty:

What drive is PHP installed on?  I've found the php.ini file must be installed in the Windows folder (Usually C:\Windows) and the folder PHP is installed in (Usually C:\PHP).  The include path should also include the current folder (the dot), the folder PHP is installed in, as well as the includes folder.  I also suggest that all relative paths (.\includes) be formatted as full paths.  You can't make any assumptions about the base path Windows, and any other program, is using.  Thus a relative path easily introduces errors.  The following is the path in my php.ini file.  If you install PHP on the G; drive, then you should be able to not have to place any files in the C partition, except for a copy of the .ini file in the Windows folder.

include_path = ".;c:\php;c:\php\includes"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jmoriartyAuthor Commented:
PHP is installed on G:, which is the same as Windows. Structurally speaking, everything is installed as you've said -- except under G: instead of C: i.e., G:\Windows, G:\PHP, etc.  with the php.ini under G:\Windows\php.ini.

It does seem to be more of a relative path issue at this point though.  

I.E., if I write:

include_once("classes\db.inc.php"); (where classes is a sub directory under the "includes" directory) it doesn't work, but if I use the full path of

include_once("G:\Inetpub\wwwroot\includes\classes\db.inc.php"); it works fine.  I suppose that's a solution, to fully qualify each file path, but there's a good 40 of 'em, so I was trying to find a better way to make relative paths work.

Thanks for the verification on the include_path directive as well.
0
AielloJCommented:
The php.ini file should also be in the G:\PHP directory.  I've found that it has to be in both places.
0
jmoriartyAuthor Commented:
Thanks - sorry for the delay in response.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.