php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #29085 bad default include_path on Windows
Submitted: 2004-07-10 13:50 UTC Modified: 2010-12-03 00:23 UTC
Votes:34
Avg. Score:4.0 ± 1.1
Reproduced:32 of 34 (94.1%)
Same Version:15 (46.9%)
Same OS:29 (90.6%)
From: christian at wenz dot org Assigned: pajoye
Status: Closed Package: *General Issues
PHP Version: 5.0.0RC3 OS: Windows
Private report: No CVE-ID:
 [2004-07-10 13:50 UTC] christian at wenz dot org
Description:
------------
the default include_path on Windows systems is ".;c:\php5\pear". IMO that's a bad idea (TM) because most installation tutorials recommend c:\php and the PEAR installer defaults to that directory, too. 

Looks like a "port" of bug #21609 :-)

Reproduce code:
---------------
call phpinfo(), look at output for include_path

Expected result:
----------------
Directive  Local Value  Master Value
include_path .;C:\php\pear .;C:\php\pear 

Actual result:
--------------
Directive  Local Value  Master Value
include_path .;C:\php5\pear .;C:\php5\pear 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-05 23:33 UTC] edink@php.net
Well this is a matter of opinion :) Most people prefer to be able to run php4 and php5 on the same box right now. This might change in the future. Anyway setting include_path in php.ini isn't that difficult, is it :)
 [2004-08-06 08:54 UTC] christian at wenz dot org
sorry, here I completely disagree. Of course it _is_ possible to change the include_path manually or within the script, however there is a divergence between the installation section of the manual (where it says "C:\php") and this built-in behavior of PHP ("C:\php5"). Also, I know of only very few people who actually use both versions on one machine (only few now of the possibility to store php.ini in the PHP directory and not in the Windows directory; furthermore you have to use PHP as CGI). 
This bug appears again and again; I am getting 2-3 reader mails about this per month; and it is (IMO) just annoying. Therefore, one thing has to change IMO: either the installation recommends installing PHP into C:\php5, or the include_path is set to something that includes C:\php. Of course, the latter is preferable.  So I dare to reopen this one :)
 [2005-01-05 21:34 UTC] justin at telepop dot net
This setting just caused me some problems.  Somehow my php.ini had a bad path in its include_path setting.  Rather than spit out an error, it assumed that c:\php4\pear was my default include directory, and gave me little information to figure out why.  Once I fixed the path, my declared settings took effect and everything worked fine, but it wasn't a very intuitive leap to see why that include path was showing up.
 [2005-02-15 01:08 UTC] tony2001@php.net
This is not a bug, but change request.
Reclassifying.
 [2009-09-07 23:43 UTC] php dot netsm at majorsite dot com
I, too, find this VERY confusing, and I can't seem to get around it.

Running Win2K Server (was to upgrade this year - market stopped that...) and have had PHP running on 5.0.3 for awhile (in C:\Program Files\PHP - the 'default' from the install).

Went to upgrade and found latest versions need Win2003 Server or better, so I had to take 5.2.10, but I cannot get the .ini to read.

Install.txt file says to avoid \program files\ so I deleted that and went for a 'clean' install to \php\

phpinfo() says I'm looking at loaded .ini from C:\PHP\php.ini I've tried setting the php.ini include_path = ".;c:\php;c:\php\ext", yet phpinfo() says include_path is .;C:\php5\pear

The comments on this page were from 2004 - and the 'fix' was that "people want to run php4 and php5, though, how long has php4 been gone, and this issue is still relevant 5 years on.....  this IS (IMHO) a BAD thing and very confusing.

I look forward to some reply as I now have php running again, but none of my databases run, none of my 'include' files work, etc.

And, please do not tell me to save my .ini file in some other location - I've tried \winnt\system32, \winnt, c:\ and certainly c:\php - nothing has worked.  I am almost frustrated enough to try c:\php5 and even c:\php5\pear, but I am trying to use the install instructions!

I think this php5 error is a bug and should be fixed - even in other versions of php (for those of us that can't afford the upgrade).
 [2009-09-08 23:50 UTC] pajoye@php.net
Agreed. Let change it in trunk at least, or maybe in 5.3.2 as well.
 [2009-09-09 06:18 UTC] christian at wenz dot org
great to see that this bug/change request gets some lovin' after over five years ;-) This should do the trick in win32/build/config.w32:

---SNIP---
107c107
<       PHP_PREFIX = "C:\\php" + PHP_VERSION;
---
>       PHP_PREFIX = "C:\\php";
---SNIP---

Not sure if this should go into 5.x -- of course I'd love to see it, but we would probably change the current behavior, and some people might actually have installed PHP into C:\php5 and expect the include_path to contain that automatically.
 [2009-09-16 18:30 UTC] php dot netsm at majorsite dot com
So, what does this mean to those of us NOT yet on W2K3?

php.net says support for W2K Server, but 5.3 requires newer software.

I'm STILL unable to get the .ini working and I have a lot of pages simply not loading (now I'm very glad I didn't do a full xfer to .php pages this last few months as I wanted - I would be totally out of business!)

I have some php pages working - the 'simple' ones that are self-contained, but all those that use mysql are DEAD as php says  Fatal error: Call to undefined function mysql_connect() in [FILENAMEREMOVED] on line XXX

I was able to get my MDaemon WorldClient working by doing a re-route and using its built-in server, but mysql is out.

Just not sure where to go/what to try anymore.....  if .ini would simply read, I'm sure all would be fine, but WHAT TO DO????

thanks for any help!
 [2009-09-16 18:33 UTC] pajoye@php.net
First of all what you are asking has nothing to do with this bug. There is another report about this issue, marked as "to be documented".

About you mysql problem, load the mysql extension(s) and everything will be fine. Please further support question on the php-windows or php-setup mailing list.

Thanks for your understanding,
 [2010-12-03 00:23 UTC] pajoye@php.net
-Status: Assigned +Status: Closed -Package: Feature/Change Request +Package: *General Issues
 [2010-12-03 00:23 UTC] pajoye@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2010-12-03 00:23 UTC] pajoye@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=305923
Log: - Fix #29085, bad default include_path on Windows
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 01:02:05 2014 UTC