Re: Still not getting Includes right.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



i just saw this last message and forgive me if I'm missing something but why not use $_SERVER['DOCUMENT_ROOT'] as a prefix to any of the paths?




On May 19, 2008, at 10:49 AM, Tyson Vanover wrote:

So have developed some nice tools for generating forms, connecting to databases, things that I do repeatedly. When I run test pages that include these utility files in the same directory as the utility files it works fine. The are included no problem. As soon as I have scripts in other directories include these utility tools it breaks.

Here is my path structure
Page that uses the tools:
/srv/www/html/lib/index.html

Tools:
/srv/www/html/Tools/formtool/formtool.php
/srv/www/html/Tools/dbtool/dbtool.php
/srv/www/html/secdepot/libquery.inc

phpinfo() returns:
doc_root	/srv/www/html	/srv/www/html
include_path	.:/srv/www/html	.:/srv/www/html

in the index.html I have tried:
ini_set( 'include_path', '/srv/www/html/Tools:/srv/www/html/ secdepot:.');
require 'dbtools/dbtool.php';
require 'libquery.inc';
require 'formtool/formclasses.php';
errors:
require(dbtools/dbtool.php) [function.require]: failed to open stream: No such file or directory /srv/www/html/lib/index.php, line 12 require() [function.require]: Failed opening required 'dbtools/ dbtool.php' (include_path='/srv/www/html/Tools:/srv/www/html/ secdepot:.') /srv/www/html/lib/index.php, line 12

as well as:
require '/srv/www/html/Tools/dbtools/dbtool.php';
require '/srv/www/html/secdepot/libquery.inc';
require '/srv/www/html/Tools/formtool/formclasses.php';
error:
require(/srv/www/html/Tools/dbtools/dbtool.php) [function.require]: failed to open stream: No such file or directory /srv/www/html/lib/ index.php, line 11 require() [function.require]: Failed opening required '/srv/www/html/ Tools/dbtools/dbtool.php' (include_path='.:/srv/www/html') /srv/www/ html/lib/index.php, line 11

as well as:
require 'dbtools/dbtool.php';
require 'libquery.inc';
require 'formtool/formclasses.php';
error:
require(Tools/dbtools/dbtool.php) [function.require]: failed to open stream: No such file or directory /srv/www/html/lib/index.php, line 11 require() [function.require]: Failed opening required 'Tools/dbtools/ dbtool.php' (include_path='.:/srv/www/html') /srv/www/html/lib/ index.php, line 11

as far as I can tell I am not chrooted:
?>ps aux | grep httpd
outputs:
root 1937 0.0 5.2 25600 13456 ? Ss 19:50 0:00 /usr/ sbin/httpd raa-web 1956 0.3 0.8 4636 2084 ? S 19:50 0:14 /usr/ sbin/lighttpd -f /etc/raa/lighttpd.conf apache 1987 0.0 4.2 25736 10920 ? S 19:50 0:00 /usr/ sbin/httpd apache 1990 0.0 4.2 25736 10892 ? S 19:50 0:00 /usr/ sbin/httpd apache 1993 0.0 4.3 25736 11048 ? S 19:50 0:00 /usr/ sbin/httpd apache 1995 0.0 4.2 25736 10908 ? S 19:50 0:00 /usr/ sbin/httpd apache 2003 0.0 4.2 25736 10912 ? S 19:50 0:00 /usr/ sbin/httpd apache 2008 0.0 4.2 25736 10908 ? S 19:50 0:00 /usr/ sbin/httpd apache 2011 0.0 4.2 25736 10864 ? S 19:50 0:00 /usr/ sbin/httpd apache 2014 0.0 4.2 25736 10900 ? S 19:50 0:00 /usr/ sbin/httpd root 2644 0.0 0.3 2908 788 tty1 R+ 20:57 0:00 grep httpd

Am I missing something blatently obvious?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux