X-Git-Url: http://git.php.net/?p=php-src.git;a=blobdiff_plain;f=ext%2Fstandard%2Fconfig.m4;h=c1f5aff7c25b15fab9d19defac65b007d15b709b;hp=c33ae1e05c897262f57500c1293ba1a7e92bc896;hb=2acc38627092123ac462f3a23780bf887bf69286;hpb=96f77f845a91858021a4e339d356ee5f734883ed

diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index c33ae1e..c1f5aff 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -358,7 +358,29 @@ else
   AC_MSG_RESULT(no)
 fi
 
-if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "cli" || test "$PHP_SAPI" = "embed"; then
+PHP_ENABLE_CHROOT_FUNC=no
+case "$PHP_SAPI" in
+  embed)
+    PHP_ENABLE_CHROOT_FUNC=yes
+  ;;
+
+  none)
+    for PROG in $PHP_BINARIES; do
+      case "$PROG" in
+        cgi|cli)
+          PHP_ENABLE_CHROOT_FUNC=yes
+        ;;
+
+        *)
+          PHP_ENABLE_CHROOT_FUNC=no
+          break
+        ;;
+      esac
+   done
+  ;;
+esac
+
+if test "$PHP_ENABLE_CHROOT_FUNC" = "yes"; then
   AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function])
 fi