Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2020-02-26 11:08:21 +0300
committerGitHub <noreply@github.com>2020-02-26 11:08:21 +0300
commit35467f54cd3e1dae889d88ae4f80d4626f9127ed (patch)
tree068e05fda3646eabb1f35549c20f1f07e9aaaeee
parentf2c0c903a549069b1876dd24f27d87d88a95b982 (diff)
Only detect php type based on file name (#15611)
* only detect php type based on file name * add config entry * tweak docs * fix ui test * Update screenshot Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
-rwxr-xr-xconfig/global.ini.php5
-rw-r--r--core/CliMulti/CliPhp.php14
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png4
3 files changed, 19 insertions, 4 deletions
diff --git a/config/global.ini.php b/config/global.ini.php
index f4b364da08..04485db61a 100755
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -664,6 +664,11 @@ absolute_chroot_path =
; Defaults to ./tmp (the tmp/ folder inside the Matomo directory)
tmp_path = "/tmp"
+; The absolute path to a PHP binary file in case Matomo cannot detect your PHP binary. If async CLI archiving cannot be
+; used on your server this may make it work. Ensure the configured PHP binary is of type CLI and not for example cgi or
+; litespeed. To find out the type of interface for a PHP binary execute this command: php -r "echo php_sapi_name();"
+php_binary_path = ""
+
; In some rare cases it may be useful to explicitely tell Matomo not to use LOAD DATA INFILE
; This may for example be useful when doing Mysql AWS replication
enable_load_data_infile = 1
diff --git a/core/CliMulti/CliPhp.php b/core/CliMulti/CliPhp.php
index 3b1661510e..25c9206ebc 100644
--- a/core/CliMulti/CliPhp.php
+++ b/core/CliMulti/CliPhp.php
@@ -8,12 +8,18 @@
namespace Piwik\CliMulti;
use Piwik\Common;
+use Piwik\Config;
class CliPhp
{
public function findPhpBinary()
{
+ $general = Config::getInstance()->General;
+ if (!empty($general['php_binary_path']) && file_exists($general['php_binary_path'])) {
+ return $general['php_binary_path'];
+ }
+
if (defined('PHP_BINARY')) {
if ($this->isHhvmBinary(PHP_BINARY)) {
return PHP_BINARY . ' --php';
@@ -77,8 +83,12 @@ class CliPhp
private function isValidPhpType($path)
{
- return !empty($path)
- && false === strpos($path, 'fpm')
+ if (empty($path)) {
+ return false;
+ }
+ $path = basename($path);
+
+ return false === strpos($path, 'fpm')
&& false === strpos($path, 'cgi')
&& false === strpos($path, 'phpunit')
&& false === strpos($path, 'lsphp');
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png
index 7829e627f9..f90818653d 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:535244c8abfac5d2f253bcae54a728015d723c4611824882059e31a7f4f96392
-size 4195487
+oid sha256:87360f5222f27304819732abfe576f4a67fd9b51828199bc2256488496e6813c
+size 4224996