diff --git a/_cleanup.php b/_cleanup.php
index 64238c44d..b52960c18 100644
--- a/_cleanup.php
+++ b/_cleanup.php
@@ -13,7 +13,7 @@ if (!defined('BB_ROOT')) {
}
// Check CLI mode
-if (php_sapi_name() !== 'cli') {
+if (PHP_SAPI != 'cli') {
exit;
}
diff --git a/_release.php b/_release.php
index 2686e144c..1514275fe 100644
--- a/_release.php
+++ b/_release.php
@@ -11,7 +11,7 @@ define('BB_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
define('BB_PATH', BB_ROOT);
// Check CLI mode
-if (php_sapi_name() !== 'cli') {
+if (PHP_SAPI != 'cli') {
die('Please run php ' . basename(__FILE__) . '
in CLI mode');
}
diff --git a/install.php b/install.php
index 4f65f3418..084c3daab 100644
--- a/install.php
+++ b/install.php
@@ -11,7 +11,7 @@ define('BB_ROOT', __DIR__ . DIRECTORY_SEPARATOR);
define('BB_PATH', BB_ROOT);
// Check CLI mode
-if (php_sapi_name() !== 'cli') {
+if (PHP_SAPI != 'cli') {
die('Please run php ' . basename(__FILE__) . '
in CLI mode');
}