Edit report at https://bugs.php.net/bug.php?id=65226&edit=1

 ID:                 65226
 Comment by:         josh at servebyte dot com
 Reported by:        josh at servebyte dot com
 Summary:            chroot() does not get enabled
 Status:             Feedback
 Type:               Bug
 Package:            CGI/CLI related
 Operating System:   Debian 7
 PHP Version:        5.5.0
 Block user comment: N
 Private report:     N

 New Comment:

There's no file called config.nice in the 5.5.0 tar?

./configure | grep chroot
checking for chroot... yes

I can get it working by editing the configure file and commenting these lines 
like so;

if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "cli" || test "$PHP_SAPI" = $
$as_echo "#define ENABLE_CHROOT_FUNC 1" >>confdefs.h
fi

to 

#if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "cli" || test "$PHP_SAPI" = $
$as_echo "#define ENABLE_CHROOT_FUNC 1" >>confdefs.h
#fi

The variable $PHP_SAPI is set to "none" so it seems to be a configure bug of 
some sort.


Previous Comments:
------------------------------------------------------------------------
[2013-07-10 17:09:48] a...@php.net

#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC

thats what has to match.

please post the output of 

./config.nice | grep chroot

------------------------------------------------------------------------
[2013-07-10 16:51:01] josh at servebyte dot com

PHP 5.3... during the configure $PHP_SAPI is set to: cgi
PHP 5.5... during the configure $PHP_SAPI is set to: none

------------------------------------------------------------------------
[2013-07-10 16:43:08] josh at servebyte dot com

However the problem is in PHP 5.4 too

#php -r "chroot();"
Fatal error: Call to undefined function chroot() in Command line code on line 1

PHP 5.4.17 (cli) (built: Jul 10 2013 17:36:53)

------------------------------------------------------------------------
[2013-07-10 16:00:25] josh at servebyte dot com

Seems to work fine with PHP 5.3


# php -r "chroot();"
Warning: chroot() expects exactly 1 parameter, 0 given in Command line code on 
line 1

PHP 5.3.26 (cli) (built: Jul 10 2013 16:52:53)

------------------------------------------------------------------------
[2013-07-09 14:37:59] josh at servebyte dot com

Description:
------------
PHP Fatal error:  Call to undefined function chroot() in Command line code on 
line 1

During the configure process it states that chroot is available: "checking for 
chroot... yes"

The php version: "PHP 5.5.0 (cli) (built: Jul  9 2013 15:30:23)"

The user is root.

As per the documentation, these are the only requirements. Perhaps I missing a 
configure variable? I have tested with just "./configure" with no params to 
ensure nothing else is interfering.

Thread safety is disabled: "checking whether to enable thread-safety... no"

Test script:
---------------
php -r "chroot('/var/chroot/');"

Expected result:
----------------
The chroot function should be available

Actual result:
--------------
The chroot function is excluded from the PHP build


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65226&edit=1

Reply via email to