Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67711 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67687 invoked from network); 17 Jun 2013 09:04:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2013 09:04:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=aaron@alphageeks.cc; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=aaron@alphageeks.cc; sender-id=unknown Received-SPF: error (pb1.pair.com: domain alphageeks.cc from 8.23.224.60 cause and error) X-PHP-List-Original-Sender: aaron@alphageeks.cc X-Host-Fingerprint: 8.23.224.60 out.smtp-auth.no-ip.com Received: from [8.23.224.60] ([8.23.224.60:13518] helo=out.smtp-auth.no-ip.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/20-00903-711DEB15 for ; Mon, 17 Jun 2013 05:04:24 -0400 X-No-IP: alphageeks.cc@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from Aaron.local (unknown [79.97.220.116]) (Authenticated sender: alphageeks.cc@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 3AFB44002E5 for ; Mon, 17 Jun 2013 02:04:21 -0700 (PDT) Message-ID: <51BED113.5000305@alphageeks.cc> Date: Mon, 17 Jun 2013 10:04:19 +0100 User-Agent: Postbox 3.0.8 (Macintosh/20130427) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: multipart/alternative; boundary="------------040807090609060201040108" Subject: Enabling the chroot() function in PHP 5.4 From: aaron@alphageeks.cc (Aaron Stephens) --------------040807090609060201040108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi All, 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. Thanks in advance. -- - Aaron --------------040807090609060201040108--