Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cli archiving might not work when using litespeed #15285

Merged
merged 1 commit into from Dec 22, 2019
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Dec 18, 2019

replaces #15283

Noticed the user's instance was using listespeed https://www.php.net/manual/en/install.unix.litespeed.php which returned following

phpbinary: /usr/local/bin/lsphp
phpbindir: /opt/alt/php72/usr/bin
which php: /usr/local/bin/php

We would have used lsphp but this seems to print the hashbang and have other issues. see #15283

replaces #15283

Noticed the user's instance was using listespeed https://www.php.net/manual/en/install.unix.litespeed.php which returned following

``` 
phpbinary: /usr/local/bin/lsphp
phpbindir: /opt/alt/php72/usr/bin
which php: /usr/local/bin/php
```

We would have used lsphp but this seems to print the hashbang and have other issues. see #15283
@tsteur tsteur added the Needs Review PRs that need a code review label Dec 18, 2019
@tsteur tsteur added this to the 3.13.1 milestone Dec 18, 2019
@diosmosis diosmosis merged commit e8ed1b2 into 3.x-dev Dec 22, 2019
@diosmosis diosmosis deleted the lsphp branch December 22, 2019 06:41
@skizzerz
Copy link

skizzerz commented Feb 22, 2020

This change broke archiving on my matomo instance, because the path to my cli version of php is /usr/local/lsws/lsphp72/bin/php.

You really shouldn't be trying to guess what flavor of PHP is being used by testing what strings appear in the path. Instead, run /path/to/php -v and check that output. If it starts with PHP <version> (cli) then you're good to go. If it says anything else (such as PHP <version> (cgi) or PHP <version> (litespeed)) then it's the wrong binary.

For a common-case fast-path, you can run php_sapi_name() directly in the PHP_BINARY branch to see if the currently-running PHP is cli or not. If it is, you can use that without needing to call to shell_exec (which may be important for some customers that have the function disabled).

@tsteur
Copy link
Member Author

tsteur commented Feb 23, 2020

cheers @skizzerz created #15611

jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
replaces matomo-org#15283

Noticed the user's instance was using listespeed https://www.php.net/manual/en/install.unix.litespeed.php which returned following

``` 
phpbinary: /usr/local/bin/lsphp
phpbindir: /opt/alt/php72/usr/bin
which php: /usr/local/bin/php
```

We would have used lsphp but this seems to print the hashbang and have other issues. see matomo-org#15283
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
replaces matomo-org#15283

Noticed the user's instance was using listespeed https://www.php.net/manual/en/install.unix.litespeed.php which returned following

``` 
phpbinary: /usr/local/bin/lsphp
phpbindir: /opt/alt/php72/usr/bin
which php: /usr/local/bin/php
```

We would have used lsphp but this seems to print the hashbang and have other issues. see matomo-org#15283
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants