Re: Problems with includes
| From: | Dan Joseph | Date: | Fri, 16 May 2008 20:39:38 +0000 |
| Subject: | Re: Problems with includes | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274452@lists.php.net to get a copy of this message | ||
On Fri, May 16, 2008 at 4:36 PM, Tyson Vanover <tvanover@pdx.edu> wrote:
> Jim Lucas wrote:
>
>> Their are two ways that come to mind.
>>
>> 1. Like Dan suggested, use the full path.
>>
>> 2. (I prefer this way), change your include_path setting either in your
>> php.ini file, virtual host, .htaccess or in your script to include the base
>> path for your web site "/srv/www/html/" and then you can call them by simply
>> removing the leading slash from your existing calls.
>> require 'Tools/tool1/tool1.php';
>> require 'Tools/tool2/tool2.php';
>>
>>
> Ok, I have changed my php.ini and restarted apache. My include_path is set
> to
>
> include_path = ".:/srv/www/html"
>
> but when I try from /srv/www/html/library/index.php:
> require '/Tools/dbtools/dbtool.php';
> or
> require 'Tools/dbtools/dbtool.php';
> or
> require '../Tools/dbtools/dbtool.php';
>
> I get the error:
> require(/Tools/dbtools/dbtool.php) [function.require]: failed to open
> stream: No such file or directory /srv/www/html/lib/index.php, line 10
>
> require() [function.require]: Failed opening required
> '/Tools/dbtools/dbtool.php' (include_path='.:/srv/www/html')
> /srv/www/html/lib/index.php, line 10
>
> any thoughts? Am I missing something obvious?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
It deosn't look like it updated your path. Output a phpinfo() and make sure
you have the correct php.ini. web servers tend to have more than one laying
around.
--
-Dan Joseph
www.canishosting.com - Plans start @ $1.99/month. Reseller plans and
Dedicated servers available.
"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."