php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #11703 Failed opening prepend.php3
Submitted: 2001-06-26 13:06 UTC Modified: 2001-08-07 13:59 UTC
From: gmills at library dot berkeley dot edu Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 4.0.6 OS: Solaris 8
Private report: No CVE-ID: None
 [2001-06-26 13:06 UTC] gmills at library dot berkeley dot edu
PHP compiled with imap support. I get this:

Warning: Failed opening ''/opt/apache/php/prepend.php3'' for inclusion (include_path=''.:/opt/apache/php'') in Unknown on line 0

opening any '.php' file with the browser. prepend.php3 has correct permissions and so do the containing directories. It won't open anywhere I put it. I have also tried just putting the file name in php.ini. I have also tried permuting the include path.

PHP is compiled into Apache 1.3.20 as a static module, and httpd.conf has an AddType directive for php.

What am I doing wrong?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-26 14:52 UTC] gmills at library dot berkeley dot edu
I commented out the auto-prepend-file directive and a 'test.php' file to run phpinfo.
 [2001-06-26 14:54 UTC] gmills at library dot berkeley dot edu
The comment should read "I commented out the auto-prepend-file directive in php.ini and got a 'test.php' file to run phpinfo."
 [2001-06-27 09:00 UTC] sniper@php.net
What is in the file prepend.php3 ??

 [2001-06-29 18:41 UTC] gmills at library dot berkeley dot edu
Sniper - I sent my prepend.php3 file. Did you get it?
 [2001-06-29 23:51 UTC] sniper@php.net
I don't see it here. You have to attach it to this bug report..

 [2001-06-30 03:06 UTC] gmills at library dot berkeley dot edu
Here is the prepend.php3 file. It comes from the phplib distributed with HORDE

<?php
/*
 * Session Management for PHP3
 *
 * Copyright (c) 1998,1999 SH Online Dienst GmbH
 *                    Boris Erdmann, Kristian Koehntopp
 *
 * $Id: prepend.php3,v 1.1.2.4 2000/09/08 20:55:27 bjn Exp $
 *
 */ 

if (empty($_PHPLIB) || !is_array($_PHPLIB)) {
# Aren't we nice? We are prepending this everywhere 
# we require or include something so you can fake
# include_path  when hosted at provider that sucks.
  $_PHPLIB["libdir"] = ""; 
}

require($_PHPLIB["libdir"] . "db_mysql.inc");  /* Change this to match your database. */
require($_PHPLIB["libdir"] . "ct_sql.inc");    /* Change this to match your data storage container */
require($_PHPLIB["libdir"] . "session.inc");   /* Required for everything below.      */

/* Additional require statements go below this line */
/* Additional require statements go before this line */

require($_PHPLIB["libdir"] . "local.inc");     /* Required, contains your local configuration. */
require($_PHPLIB["libdir"] . "page.inc");      /* Required, contains the page management functions. */

?>
 [2001-07-12 13:41 UTC] gmills at library dot berkeley dot edu
phpinfo can be run if there is no prepend file defined. You can see the info produced by phpinfo at
http://samba.berkeley.edu/test.php
 [2001-07-12 14:35 UTC] gmills at library dot berkeley dot edu
Turns out that php scripts to be opened must exist under the httpd document root, and that the include_path directive is the path under the document root as well. Would have helped if this was made a little clearer in the installation instructions! Thanks for all the help;

Garey Mills
 [2001-07-12 14:38 UTC] derick@php.net
Making this a documentation problem.

Derick
 [2001-08-07 13:59 UTC] jmcastagnetto@php.net
The assertion "... Turns out that php scripts to be opened must exist under the httpd document root, and that the include_path directive is the path under the document root as well ..." is unfounded.

Include files *can* be outside the doument root of the server, *but* those directories should be readable by the user under which the server (and PHP) runs, e.g.

[/tmp/foo.php]
<?php echo "I am not in the server's doc root"; ?>

[/usr/local/apache/htdocs/testincpath.php]
<?php
include "foo.php";
echo "<hr>But I am in the server's doc root"
?>

And in php.ini

include_path=".:/tmp";

Then, when you use the URL:

http://example.com/testincpath.php

(remember to start/stop Apache)

you will get (used lynx for the lines below):


   I am not in the server's doc root   ____________________________________________

    But I am in the server's doc root

The users's problem seems to be a setup/permissions problem w/ his/her system, not a documentation problem.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC