php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11493 Having issues include_path and auto_prepend_file
Submitted: 2001-06-14 15:42 UTC Modified: 2001-06-18 16:29 UTC
From: gpreston at ycp dot edu Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.0.5 OS: SunOS 5.7
Private report: No CVE-ID: None
 [2001-06-14 15:42 UTC] gpreston at ycp dot edu
I am having problems with my include_path and auto_prepend_file in my php.ini file.  I configured PHP with the follow flags:
  --with-mysql
  --with-apache=../apache_1.3.19
  --with-tsrm-threads
  --enable-yp
  --enable-track-vars

In my php.ini file, I have the two options set in this manner:

auto_prepend_file="verifyuser.php"
include_path = ".:/usr/local/apache/htdocs"

Now, if I view a webpage that sits in /usr/local/apache/htdocs, it opens just fine.  It can find all the files to include and I have no issues.  But once I try to view a file that is located in a subdirectory of htdocs, for example, htdocs/chat/Install.html, I am given the following error through my browser:

Warning: Failed opening '/usr/local/apache/htdocs/chat/Install.html' for inclusion (include_path='.:/usr/local/apache/htdocs') in Unknown on line 0

It seems to me that it is having trouble finding any file located in a subdir of 'htdocs'.  Is this a bug of PHP4.0.5?

I've tried experimenting to include the path of a few test subdirs with files in them into the include_path, but I still have the same error.  I'm not sure exactly what's going on here.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-14 17:11 UTC] sniper@php.net
You need to add every directory into the include_path.
This is how it works. Maybe it will be changed sometime.
But not in near future.


 [2001-06-15 08:55 UTC] gpreston at ycp dot edu
Okay, I changed my include_path appropriately, and here is the new message I saw:

Warning: Failed opening '/usr/local/apache/htdocs/chat/httpd/index.html' for inclusion (include_path='.:/usr/local/apache/htdocs:/usr/local/apache/htdocs/chat:/usr/local/apache/htdocs/chat/httpd:/usr/local/apache/htdocs/chat/httpd/images:/usr/local/apache/htdocs/chat/httpd/mschat:/usr/local/apache/htdocs/chat/httpd/pchat:/usr/local/apache/htdocs/chat/httpd/plynx:/usr/local/apache/htdocs/chat/httpd/scripts:/usr/local/apache/htdocs/chat/httpd/ticker:/usr/local/apache/htdocs/chat/httpd/help:/usr/local/apache/htdocs/chat/httpd/evendchat') in Unknown on line 0

I included every single directory possible within htdocs, chat, and httpd.  Chat being the only folder under htdocs, and httpd being the only one under chat.  As you can see, it is still having issues with the include path.  Any ideas on this?
 [2001-06-15 11:43 UTC] sniper@php.net
I just tried this, and it works for me just fine.
You don't need every single directory in include_path..
That was bullshit. I should have tested it immediately.

Can you add short script into this report that reproduces this?

 [2001-06-15 13:40 UTC] gpreston at ycp dot edu
I'm sorry, but I unfortunately don't know what you mean by that?  Do you want my php.ini file?  I'd try and let you see the page I'm attempting to do this on, but it's located on one of the server's in my company's intranet section.  I'll explain what I'm doing for now, and maybe that will help.

I edit my php.ini file in /usr/local/lib and change the include_path variable, then save those changes.  Then I stop my webserver and restart it (/usr/local/apache/bin/apachectl stop/start).  The changes in the error msg are reflected immediately at this point when I try to view the webpage.  And again, this works fine if I try to view a webpage located in the htdocs directory, but any file located in a subdirectory of htdocs produces this error.
 [2001-06-16 11:08 UTC] sniper@php.net
Please include a short example script that can be used
to reproduce this. What is in the file that is auto_prepend_file ?? 




 [2001-06-18 09:15 UTC] gpreston at ycp dot edu
This is the contents of my auto_prepend_file, but this isn't giving me the issues:

<?php
    if( !isset($username) ){
        print "<html>\n";
        print "<head>\n";
        print "  <title>Login</title>\n";
        print "</head>\n";
        print "<body>\n";
        print "<p align=\"center\">\n";
        print "  <font size=\"+4\" color=\"red\">Please Login</font>\n";
        print "</p>\n";
        print "<center>\n";
        print "<form action=/cgi-bin/python.py method=POST><br>\n";
        print "  Please enter your Username: <input type=\"text\" name=\"usrname\"><br>\n";
        print "  Please enter your Password: <input type=\"password\" name=\"passwrd\"><br>\n";
        print "  <input type=\"Submit\" value=\"Login\"><br>\n";
        print "</form>\n";
        print "</center>\n";
        print "</body>\n";
        print "</html>\n";
        exit;
    }
?>


If there is no cookie set, it will show the login form and stop the browser from showing any more of the content of the rest of the page.  If there is a cookie set, then don't show the login form and show the user the actual page they wanted to see.

As for a script to reproduce this problem on your end, I'm not sure that's entirely possible.  From the discussions I've had with numerous people regarding this issue, the three systems that these people have seen this problem on are Solaris 7 and 8, and Sparc, all using the GCC compiler.  I myself am using Solaris 7 with the GCC compiler.  Now, I don't believe I can possibly give you a script to reproduce this.  Simply because this is an issue with the php.ini file and the PHP interpreter, rather than a page I might have made in PHP to do a specific task/function.  All I can offer as a suggestion is the following:

On a Solaris 7 machine with the GCC compiler, create a file for use as your auto_prepend_file(set in php.ini), then in a subdirectory of what you set as the prefix of your web server, in my case '/usr/local/apache/htdocs/' and then put a file in a subdirectory of that and try to view it through your browser.  There's no real script that I can write to show you this.
 [2001-06-18 14:20 UTC] gpreston at ycp dot edu
After a lot of frustration, I decided to wipe the slate clean and start over.  I backed up all my files and re-installed Apache 1.3.19 and PHP 4.0.5 from the bottom up.  And believe it or not, it works fine now.  I'm not sure why or what was causing this problem before, but I am no longer suffering from it.  Thanks for the attention you gave me, Sniper.

-Gabe
 [2001-06-18 16:29 UTC] sniper@php.net
Let's bogus this..I wonder what was wrong too.
Maybe some old stuff? Like old php.ini? Anyway, great that it works now!

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC