From b4e044b19922a7c85a92a46224a538bd423705fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Sun, 11 Oct 2020 02:09:04 +0300 Subject: [PATCH] added cpanel support --- .../symfony/process/PhpExecutableFinder.php | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/overrides/symfony/process/PhpExecutableFinder.php b/overrides/symfony/process/PhpExecutableFinder.php index b8a7b1071..a6ce5c636 100644 --- a/overrides/symfony/process/PhpExecutableFinder.php +++ b/overrides/symfony/process/PhpExecutableFinder.php @@ -27,6 +27,21 @@ class PhpExecutableFinder //$this->executableFinder = new ExecutableFinder(); } + public function isCpanel() + { + return is_dir('/usr/local/cpanel'); + } + + public function isPlesk() + { + return is_dir('/usr/local/psa'); + } + + public function isVirtualmin() + { + return is_dir('/usr/share/webmin'); + } + /** * Finds The PHP executable. * @@ -36,7 +51,11 @@ class PhpExecutableFinder { # @override // Not working on shared hosting due to "open_basedir" restriction applied by cPanel/Plesk - return 'php'; + if ($this->isCpanel()) { + return '/usr/local/bin/php'; + } else { + return 'php'; + } if ($php = getenv('PHP_BINARY')) { if (!is_executable($php)) {