RE: WELCOME to pear-general@lists.php.net

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: WELCOME to pear-general@lists.php.net

Darren Ehlers
I have a problem that I cannot seem to track down.

Everthing works fine on my local test system, but when uploaded to my
server, it's like the include_path isn't being checked.  For example:

require_once ('MDB2.php');

Won't work at all (file not found), but the file IS there in the
/usr/local/lib/php/ directory.

BUT, this works fine:

require_once ('/usr/local/lib/php/MDB2.php');

And the include path is:

/usr/local/lib/php

I'm missing something here, and at a loss...

Thanks in advance for any ideas.

Darren Ehlers

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

Reply | Threaded
Open this post in threaded view
|

Re: WELCOME to pear-general@lists.php.net

Greg Beaver
Darren Ehlers wrote:

> I have a problem that I cannot seem to track down.
>
> Everthing works fine on my local test system, but when uploaded to my
> server, it's like the include_path isn't being checked.  For example:
>
> require_once ('MDB2.php');
>
> Won't work at all (file not found), but the file IS there in the
> /usr/local/lib/php/ directory.
>
> BUT, this works fine:
>
> require_once ('/usr/local/lib/php/MDB2.php');
>
> And the include path is:
>
> /usr/local/lib/php
>
> I'm missing something here, and at a loss...
>
> Thanks in advance for any ideas.
>
> Darren Ehlers

try this script:

<?php
var_dump(get_include_path());
require_once 'MDB2.php';
?>

Greg

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

Reply | Threaded
Open this post in threaded view
|

Re: RE: WELCOME to pear-general@lists.php.net

Justin Patrin
In reply to this post by Darren Ehlers
On 5/6/05, Darren Ehlers <[hidden email]> wrote:

> I have a problem that I cannot seem to track down.
>
> Everthing works fine on my local test system, but when uploaded to my
> server, it's like the include_path isn't being checked.  For example:
>
> require_once ('MDB2.php');
>
> Won't work at all (file not found), but the file IS there in the
> /usr/local/lib/php/ directory.
>
> BUT, this works fine:
>
> require_once ('/usr/local/lib/php/MDB2.php');
>
> And the include path is:
>
> /usr/local/lib/php
>
> I'm missing something here, and at a loss...
>

What does phpinfo(); say your include path is? Perhaps you edited the
wrong php.ini file (look in phpinfo()'s output for the php.ini file
it's using).

--
Justin Patrin

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

Reply | Threaded
Open this post in threaded view
|

RE: RE: WELCOME to pear-general@lists.php.net

Darren Ehlers
No, phpinfo() returns the correct/expected path:

/usr/local/lib/php

Darren Ehlers
OpenUI Consortium
http://www.openui.org/



> -----Original Message-----
> From: Justin Patrin [mailto:[hidden email]]
> Sent: Friday, May 06, 2005 6:51 PM
> To: [hidden email]
> Cc: [hidden email]
> Subject: Re: [PEAR] RE: WELCOME to [hidden email]
>
>
> On 5/6/05, Darren Ehlers <[hidden email]> wrote:
> > I have a problem that I cannot seem to track down.
> >
> > Everthing works fine on my local test system, but when
> uploaded to my
> > server, it's like the include_path isn't being checked.  
> For example:
> >
> > require_once ('MDB2.php');
> >
> > Won't work at all (file not found), but the file IS there in the
> > /usr/local/lib/php/ directory.
> >
> > BUT, this works fine:
> >
> > require_once ('/usr/local/lib/php/MDB2.php');
> >
> > And the include path is:
> >
> > /usr/local/lib/php
> >
> > I'm missing something here, and at a loss...
> >
>
> What does phpinfo(); say your include path is? Perhaps you edited the
> wrong php.ini file (look in phpinfo()'s output for the php.ini file
> it's using).
>
> --
> Justin Patrin
>

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

Reply | Threaded
Open this post in threaded view
|

RE: WELCOME to pear-general@lists.php.net

miras
In reply to this post by Darren Ehlers
On Fri, 06 May 2005 16:52:48 -0500, Darren Ehlers wrote:
>
> And the include path is:
>
> /usr/local/lib/php
>
> I'm missing something here, and at a loss...
>
Are your webserver running in a chroot environment?
--
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917

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

Reply | Threaded
Open this post in threaded view
|

RE: RE: WELCOME to pear-general@lists.php.net

Darren Ehlers
Okay, now you just hit over my head.  I'm not administering the server, just
using...

Can you explain, and how it would affect things?

Darren Ehlers

> -----Original Message-----
> From: Michael Rasmussen [mailto:[hidden email]]
> Sent: Friday, May 06, 2005 7:44 PM
> To: [hidden email]
> Subject: [PEAR] RE: WELCOME to [hidden email]
>
>
> On Fri, 06 May 2005 16:52:48 -0500, Darren Ehlers wrote:
> >
> > And the include path is:
> >
> > /usr/local/lib/php
> >
> > I'm missing something here, and at a loss...
> >
> Are your webserver running in a chroot environment?
> --
> Hilsen/Regards
> Michael Rasmussen
> http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Reply | Threaded
Open this post in threaded view
|

RE: Re: WELCOME to pear-general@lists.php.net

Darren Ehlers
In reply to this post by Greg Beaver
Here's the result:

string(42) "/usr/local/lib/php"
Warning: main(MDB2.php) [function.main]: failed to open stream: No such file
or directory in /web/dc/html/index.php on line 8

Fatal error: main() [function.require]: Failed opening required 'MDB2.php'
(include_path='/usr/local/lib/php') in /web/dc/index.php on line 8

The actual code is:

<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);

var_dump(get_include_path());
require_once 'MDB2.php';
?>

When I change it to this, it works fine:

<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);

var_dump(get_include_path());
require_once '/usr/local/lib/php/MDB2.php';
?>

There's got to be something on the server affecting it, as the paths all
seem correct...

Darren Ehlers

> -----Original Message-----
> From: Greg Beaver [mailto:[hidden email]]
> Sent: Friday, May 06, 2005 6:10 PM
> To: [hidden email]
> Cc: [hidden email]
> Subject: [PEAR] Re: WELCOME to [hidden email]
>
>
> Darren Ehlers wrote:
> > I have a problem that I cannot seem to track down.
> >
> > Everthing works fine on my local test system, but when
> uploaded to my
> > server, it's like the include_path isn't being checked.  
> For example:
> >
> > require_once ('MDB2.php');
> >
> > Won't work at all (file not found), but the file IS there in the
> > /usr/local/lib/php/ directory.
> >
> > BUT, this works fine:
> >
> > require_once ('/usr/local/lib/php/MDB2.php');
> >
> > And the include path is:
> >
> > /usr/local/lib/php
> >
> > I'm missing something here, and at a loss...
> >
> > Thanks in advance for any ideas.
> >
> > Darren Ehlers
>
> try this script:
>
> <?php
> var_dump(get_include_path());
> require_once 'MDB2.php';
> ?>
>
> Greg
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Reply | Threaded
Open this post in threaded view
|

Re: WELCOME to pear-general@lists.php.net

Greg Beaver
In reply to this post by Greg Beaver
Darren, did you try the script?  Please paste output.  I know it seems
silly, but you must verify from *within* the script that the
include_path is set up properly, otherwise we're just flapping in the
wind trying to help you.

Greg

Greg Beaver wrote:

> Darren Ehlers wrote:
>
>> I have a problem that I cannot seem to track down.
>>
>> Everthing works fine on my local test system, but when uploaded to my
>> server, it's like the include_path isn't being checked.  For example:
>>
>> require_once ('MDB2.php');
>>
>> Won't work at all (file not found), but the file IS there in the
>> /usr/local/lib/php/ directory.
>>
>> BUT, this works fine:
>>
>> require_once ('/usr/local/lib/php/MDB2.php');
>>
>> And the include path is:
>>
>> /usr/local/lib/php
>>
>> I'm missing something here, and at a loss...
>>
>> Thanks in advance for any ideas.
>>
>> Darren Ehlers
>
>
> try this script:
>
> <?php
> var_dump(get_include_path());
> require_once 'MDB2.php';
> ?>
>
> Greg

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

Reply | Threaded
Open this post in threaded view
|

Re: Re: WELCOME to pear-general@lists.php.net

Greg Beaver
In reply to this post by Darren Ehlers
Darren Ehlers wrote:

> Here's the result:
>
> string(42) "/usr/local/lib/php"
> Warning: main(MDB2.php) [function.main]: failed to open stream: No such file
> or directory in /web/dc/html/index.php on line 8
>
> Fatal error: main() [function.require]: Failed opening required 'MDB2.php'
> (include_path='/usr/local/lib/php') in /web/dc/index.php on line 8
>
> The actual code is:
>
> <?php
> ini_set('error_reporting', E_ALL);
> ini_set('display_errors', 1);
> ini_set('display_startup_errors', 1);
>
> var_dump(get_include_path());
> require_once 'MDB2.php';
> ?>
>
> When I change it to this, it works fine:
>
> <?php
> ini_set('error_reporting', E_ALL);
> ini_set('display_errors', 1);
> ini_set('display_startup_errors', 1);
>
> var_dump(get_include_path());
> require_once '/usr/local/lib/php/MDB2.php';
> ?>
>
> There's got to be something on the server affecting it, as the paths all
> seem correct...

Yeah, that's freaky weird.

Try this and see if it works:
<?php
set_include_path('/usr/local/lib/php/'); // <-- note trailing /
require_once 'MDB2.php';
?>

I doubt it will, but it's worth a try.

Greg

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

Reply | Threaded
Open this post in threaded view
|

RE: Re: WELCOME to pear-general@lists.php.net

Darren Ehlers
I think I might have figured something out....I've got a path in there using
a ';' as a separator, instead of the PATH_SEPARATOR value.  I'm running some
tests, but that may have fixed my problem.

Thanks for helping me in the right direction...

Darren Ehlers

> -----Original Message-----
> From: Greg Beaver [mailto:[hidden email]]
> Sent: Friday, May 06, 2005 11:39 PM
> To: [hidden email]
> Cc: [hidden email]
> Subject: Re: [PEAR] Re: WELCOME to [hidden email]
>
>
> Darren Ehlers wrote:
> > Here's the result:
> >
> > string(42) "/usr/local/lib/php"
> > Warning: main(MDB2.php) [function.main]: failed to open
> stream: No such file
> > or directory in /web/dc/html/index.php on line 8
> >
> > Fatal error: main() [function.require]: Failed opening
> required 'MDB2.php'
> > (include_path='/usr/local/lib/php') in /web/dc/index.php on line 8
> >
> > The actual code is:
> >
> > <?php
> > ini_set('error_reporting', E_ALL);
> > ini_set('display_errors', 1);
> > ini_set('display_startup_errors', 1);
> >
> > var_dump(get_include_path());
> > require_once 'MDB2.php';
> > ?>
> >
> > When I change it to this, it works fine:
> >
> > <?php
> > ini_set('error_reporting', E_ALL);
> > ini_set('display_errors', 1);
> > ini_set('display_startup_errors', 1);
> >
> > var_dump(get_include_path());
> > require_once '/usr/local/lib/php/MDB2.php';
> > ?>
> >
> > There's got to be something on the server affecting it, as
> the paths all
> > seem correct...
>
> Yeah, that's freaky weird.
>
> Try this and see if it works:
> <?php
> set_include_path('/usr/local/lib/php/'); // <-- note trailing /
> require_once 'MDB2.php';
> ?>
>
> I doubt it will, but it's worth a try.
>
> Greg
>

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

Reply | Threaded
Open this post in threaded view
|

RE: RE: WELCOME to pear-general@lists.php.net

miras
In reply to this post by Darren Ehlers
On Fri, 06 May 2005 20:53:16 -0500, Darren Ehlers wrote:

> Okay, now you just hit over my head.  I'm not administering the server,
> just using...
>
> Can you explain, and how it would affect things?
>
if running in chroot environment the webserver cannot access files outside
the jail. E.g on my webserver:
/usr/local/lib/php/  <- here resides Pear
/var/www <- here resides my webserver
When the webserver starts it chroot to /var/www and therefore can no
longer access files outside /var/www. To have access to the Pear libraries
you need to copy the files inside the jail:
/var/www/usr/local/lib/php.
When the webserver is running the root changes to /var/www so / actually
will be /var/www

--
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917

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

Reply | Threaded
Open this post in threaded view
|

RE: RE: WELCOME to pear-general@lists.php.net

Darren Ehlers
Gotcha.  I understand....

But, that's not the problem.  The file is accessible when I use the full
path, it's something with the search-path that I'm working on....and I may
have found the problem, relating to the PATH_SEPARATOR.

Darren Ehlers
OpenUI Consortium
http://www.openui.org/



> -----Original Message-----
> From: Michael Rasmussen [mailto:[hidden email]]
> Sent: Saturday, May 07, 2005 7:18 AM
> To: [hidden email]
> Subject: RE: [PEAR] RE: WELCOME to [hidden email]
>
>
> On Fri, 06 May 2005 20:53:16 -0500, Darren Ehlers wrote:
>
> > Okay, now you just hit over my head.  I'm not administering
> the server,
> > just using...
> >
> > Can you explain, and how it would affect things?
> >
> if running in chroot environment the webserver cannot access
> files outside
> the jail. E.g on my webserver:
> /usr/local/lib/php/  <- here resides Pear
> /var/www <- here resides my webserver
> When the webserver starts it chroot to /var/www and therefore can no
> longer access files outside /var/www. To have access to the
> Pear libraries
> you need to copy the files inside the jail:
> /var/www/usr/local/lib/php.
> When the webserver is running the root changes to /var/www so
> / actually
> will be /var/www
>
> --
> Hilsen/Regards
> Michael Rasmussen
> http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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