Welcome! Log In Create A New Profile

Advanced

how to use chdir

Posted by Neves 
Neves
how to use chdir
July 02, 2009 02:23PM
I ve compiled php to use this dir: /qi/php
and I put my webfiles at /qi/www

I configured php-fpm.conf like this: <value name="chroot">/qi/</value>
So the php binaries and the webfiles can be seen inside the chroot
dir /qi

After restarting, I start to get this error while accessing a page:
curl localhost/index.php
<br />
<b>Warning</b>: Unknown: Filename cannot be empty in <b>Unknown</b>
on line <b>0</b><br />
<br />
<b>Fatal error</b>: Unknown: Failed opening required
'' (include_path='.:/qi/php/lib/php') in <b>Unknown</b> on line <b>0</
b><br />

As if it cant find where are the php files.
If I comment chroot config, all back to normal.
Re: how to use chdir
July 02, 2009 04:50PM
I'm afraid there's probably not many people who use that feature and
it might be a feature that isn't implemented properly or has been
tested.

Someone who can examine the code might be able to understand it better
but if it's running under chroot it depends on the exact
implementation, but if it's running under chroot from the actual php
engine perspective you might need some system libraries, your php.ini
file and other things for it to properly function inside of the
chroot.

However, it might simply just make the engine consider /qi to be the
root in PHP's mind, so not a chroot on the process level but a
pseudo-chroot inside of the PHP engine itself. Sort of like a forced
safe_basedir type deal...


On Thu, Jul 2, 2009 at 11:23 AM, Neves<marcos.neves@gmail.com> wrote:
>
> I ve compiled php to use this dir: /qi/php
> and I put my webfiles at /qi/www
>
> I configured php-fpm.conf like this: <value name="chroot">/qi/</value>
> So the php binaries and the webfiles can be seen inside the chroot
> dir /qi
>
> After restarting, I start to get this error while accessing a page:
> curl localhost/index.php
> <br />
> <b>Warning</b>:  Unknown: Filename cannot be empty in <b>Unknown</b>
> on line <b>0</b><br />
> <br />
> <b>Fatal error</b>:  Unknown: Failed opening required
> '' (include_path='.:/qi/php/lib/php') in <b>Unknown</b> on line <b>0</
> b><br />
>
> As if it cant find where are the php files.
> If I comment chroot config, all back to normal.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 131
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready