|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21540 include_path problem
Submitted: 2003-01-09 03:37 UTC Modified: 2003-01-31 13:47 UTC
Avg. Score:4.3 ± 0.9
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:4 (66.7%)
From: kjanisz at fr dot pl Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4.3.0 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-01-09 03:37 UTC] kjanisz at fr dot pl
It seems that include_path is not working correctly. When I try to include Mail.php from PEAR I get

Warning: sendmail() [function.sendmail]: Failed opening 'Mail.php' for inclusion (include_path='./:/usr/local/src/php-4.3/pear;') in /usr/local/apache/www/htdocs/ on line 6

Mail.php IS in directory /usr/local/src/php-4.3/pear
My config:
php_value include_path ./:/usr/local/src/php-4.3/pear

Look at the error - there is ; at the end of include_path, but it is not in my server configuration. When I added another path at the end:

php_value include_path ./:/usr/local/src/php-4.3/pear:.

script started to work. I think that there is an typo somewhere in the code.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-09 19:42 UTC]
Which Apache are you using and where are you specifying the include_path, httpd.conf (virtual host) or .htaccess?
 [2003-01-10 01:53 UTC] kjanisz at fr dot pl
I'm running Apache 1.3.27. I tried include_path both in httpd.conf and .htaccess. Problem existed in both cases.
 [2003-01-10 16:37 UTC]
Do you have include_path specified in your php.ini?
 [2003-01-12 06:13 UTC] kjanisz at fr dot pl
Yes, I have the following line in php.ini

include_path    =       .:./:/usr/local/src/php-4.1.1/php-4.1.1/pear
 [2003-01-15 03:08 UTC]
But your include_path definition is different than the one
mentioned in the error message..are you sure your php.ini
is used by PHP ?

 [2003-01-31 13:47 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

 [2003-02-07 17:15 UTC] georgep at phaistosnetworks dot gr

Using linux and the php 4.3.0 causes the same problems. For some reason php seems to ingore the path_info set in php.ini.
 [2003-02-17 21:44 UTC] pro_link83 at yahoo dot com
but in my case is 
Warning: Failed opening '' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/html/services/admin/detil.php on line 2
there is no ":" or ";" in the end of include_path
i dont know the way out of this, can you help me?
 [2003-04-17 04:31 UTC] russell+php dot net at loosenut dot com
It would appear as though PHP 4.3.1 RC1 is also with this problem (running on Solaris, here).  It appears as though PHP doesn't like the "./" prepended to the filename in the "include" or "require" statement (though earlier versions of PHP (4.1.2 for example) work without a problem with these same scripts).

According to "phpinfo();" run on the server in this same directory, I have:

Directive: include_path
Local Value: .:/usr/local/php-4.3.2rc1/lib/php
Master Value: .:/usr/local/php-4.3.2rc1/lib/php 

Safe mode is also off.

Test case:

-- begin
  <TITLE>PHP Test Case</TITLE>



// index.php

print( "Including file:<BR>\n" );
include( "file.php" );

print( "Including file with dot-slash:<BR>\n" );
include( "./file.php" );


-- end

-- begin
// file.php

print( "<B>File Successfully Included</B><BR>\n" );

-- end
 [2003-04-17 04:33 UTC] russell+php dot net at loosenut dot com
Sorry... that's PHP 4.3.2 RC 1.  Not PHP 4.3.1 RC 1.  Still b0rked there, unless there's an easy workaround.
 [2003-04-17 04:40 UTC] russell+php dot net at loosenut dot com
I'll stop spamming on this, but... here are the error messages that the two above files generate (Apache 1.3.27):

-- begin
[Thu Apr 17 02:38:11 2003] [error] PHP Warning:  main(./file.php) [<a href=''>function.main</a>]: failed to open stream: No such file or directory in /export/home/russell/public_html/inc-problem/index.php on line 18
[Thu Apr 17 02:38:11 2003] [error] PHP Warning:  main() [<a href=''>function.include</a>]: Failed opening './file.php' for inclusion (include_path='.:/usr/local/php-4.3.2rc1/lib/php') in /export/home/russell/public_html/inc-problem/index.php on line 18
-- end
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Nov 30 02:05:53 2022 UTC