Does anybody know how to enable the chroot() function in PHP 5.4?
It was easy in PHP 5.3 as long as you were building the CLI by itself.
In the PHP 5.4 configure script there is a new PHP_BINARIES variable
being used instead of setting PHP_SAPI=cli and thus the "#define
ENABLE_CHROOT_FUNC 1" is never written to the output file. I have been
able to manually enable it by adding the define to the main/php_config.h
after running configure. The issue seems to be a line: if test
"program" = "program". This comparison being true is what causes the
configure script to add "cli" to the PHP_BINARIES variable instead of
setting the PHP_SAPI variable. The other prerequisites (HAVE_CHROOT and
ZTS) are all at the required settings. It is only the
ENABLE_CHROOT_FUNC which is causing the function to not be compiled into
the resulting binary. Any information or explanation would be very helpful.
For the record, I know what the chroot() function does and does not
do. I am experimenting with using chroot() to isolate an already
running script to a particular subset of the filesystem for file operations.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php