epik
July 31, 2023, 3:19pm
1
CMS Version
CMS 4.0.0-beta released
Installation Method
Custom install
Operating System
Windows 11
Issue
I’m trying to install cms v4 beta. Not sure if the problem is caused by misconfiguration.
My installation is as below:
Apache httpd-2.4.57-win64-VS16
Mysql-8.0.34-winx64
php-8.1.17-Win32-vs16-x64 (also tried with php-8.1.20-Win32-vs16-x64, php-8.2.7-Win32-vs16-x64, and php-8.1.0-Win32-vs16-x64)
php-zmq release from → Release zmq 4.3.4 - prebuilt Windows php extension binaries · stijnvdb88/php-zmq · GitHub
No problem with CMS logon, API request and I’m able to load zmq extension in php, but when I try to run “php xmr.phar” in command prompt, there was an error:
Fatal error: Unparenthesized a ? b : c ? d : e
is not supported. Use either (a ? b : c) ? d : e
or a ? b : (c ? d : e)
in phar://C:/Server/www/xibo/vendor/xibosignage/xibo-xmr/bin/xmr.phar/index.php on line 204
Any idea what might be the cause?
epik
August 1, 2023, 11:29am
2
I am able to run xmr.phar by using php 7. Assuming xmr.phar are not built for php 8. Only the CMS requirement is php 8.
dan
August 1, 2023, 4:33pm
3
Ah interesting! We have updated XMR for PHP 8.1, but it looks like we didn’t rebuild the PHAR file. I’ll see if we can get that updated for you.
EDIT: you could try grabbing xmr.phar from here: https://github.com/xibosignage/xibo-xmr/raw/87d1540d3cb73f6ef55287b4dcb666d5692c11d2/bin/xmr.phar
epik
August 1, 2023, 4:56pm
4
Actually I also tried to extract the phar file and modify the php code in index.php, then rebuilt the phar file again. Unparenthesized problem solved, but another error cause by deprecated monolog code appears. Looking forward for updated phar file from your team. Thanks Dan…
dan
August 1, 2023, 4:57pm
5
Is that using the PHAR I linked above? If yes, what are the monolog errors please?
epik
August 1, 2023, 5:14pm
6
I tried to replace phar file from the link above. Got a new error
PHP Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, bool given in phar://C:/Server/www/xibo/vendor/xibosignage/xibo-xmr/bin/xmr.phar/.box/src/Terminal.php:60
Stack trace:
#0 phar://C:/Server/www/xibo/vendor/xibosignage/xibo-xmr/bin/xmr.phar/.box/src/Terminal.php(60): trim(false)
#1 phar://C:/Server/www/xibo/vendor/xibosignage/xibo-xmr/bin/xmr.phar/.box/src/Terminal.php(31): HumbugBox436\KevinGH\RequirementChecker\Terminal::initDimensions()
#2 phar://C:/Server/www/xibo/vendor/xibosignage/xibo-xmr/bin/xmr.phar/.box/src/Printer.php(28): HumbugBox436\KevinGH\RequirementChecker\Terminal->getWidth()
#3 phar://C:/Server/www/xibo/vendor/xibosignage/xibo-xmr/bin/xmr.phar/.box/src/Checker.php(17): HumbugBox436\KevinGH\RequirementChecker\Printer->__construct(32, true)
#4 phar://C:/Server/www/xibo/vendor/xibosignage/xibo-xmr/bin/xmr.phar/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
#5 C:\Server\www\xibo\vendor\xibosignage\xibo-xmr\bin\xmr.phar(12): require('phar://C:/Serve...')
#6 C:\Server\www\xibo\vendor\bin\xmr.phar(119): include('C:\\Server\\www\\x...')
#7 {main}
thrown in phar://C:/Server/www/xibo/vendor/xibosignage/xibo-xmr/bin/xmr.phar/.box/src/Terminal.php on line 60
dan
August 1, 2023, 5:23pm
7
Ah ok, that looks like a know issue in the PHAR packager
opened 06:34PM - 22 Jun 23 UTC
## Bug report
| Question | Answer
| ------------| ---------------
| Box … version | 4.3.8
| PHP version | 8.1.20
| Platform with version | Windows
| Github Repo | https://github.com/TheDragonCode/codestyler
I am using Laravel Zero which contains the Box binary.
Yesterday they updated the framework version with Box file version 4.3.8. Previously version 4.2.0 was used.
There are no problems with version 4.2.0, but in 4.3.8 they appeared and manifest themselves as follows:
1) Compilation of the phar file happens without errors, BUT:
2) When I try to call a phar file from the console, I get an error;
3) When I try to get the `box` version of the file, I get the same error.
With all this, the error is displayed only under Windows. There are no problems when running inside Ubuntu.
<details>
<summary>box.json.dist</summary>
```json
{
"chmod": "0755",
"directories": [
"app",
"bootstrap",
"config",
"resources",
"vendor",
"modules/laravel/pint/app",
"modules/laravel/pint/resources/views"
],
"files": [
".editorconfig",
"composer.json",
"The_Dragon_Code_phpStorm.xml"
],
"exclude-composer-files": false,
"exclude-dev-files": false,
"compression": "GZ",
"compactors": [
"KevinGH\\Box\\Compactor\\Php",
"KevinGH\\Box\\Compactor\\Json"
]
}
```
</details>
<details>
<summary>Output</summary>
```bash
$ ./vendor/laravel-zero/framework/bin/box --version
PHP Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, bool given in phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Terminal.php:60
Stack trace:
#0 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Terminal.php(60): trim(false)
#1 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Terminal.php(31): HumbugBox436\KevinGH\RequirementChecker\Terminal::initDimensions()
#2 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Printer.php(28): HumbugBox436\KevinGH\RequirementChecker\Terminal->getWidth()
#3 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Checker.php(17): HumbugBox436\KevinGH\RequirementChecker\Printer->__construct(32, true)
#4 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
#5 D:\domains\dragon-code\codestyler\vendor\laravel-zero\framework\bin\box(16): require('phar://D:/domai...')
#6 {main}
thrown in phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Terminal.php on line 60
Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, bool given in phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Terminal.php:60
Stack trace:
#0 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Terminal.php(60): trim(false)
#1 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Terminal.php(31): HumbugBox436\KevinGH\RequirementChecker\Terminal::initDimensions()
#2 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Printer.php(28): HumbugBox436\KevinGH\RequirementChecker\Terminal->getWidth()
#3 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Checker.php(17): HumbugBox436\KevinGH\RequirementChecker\Printer->__construct(32, true)
#4 phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
#5 D:\domains\dragon-code\codestyler\vendor\laravel-zero\framework\bin\box(16): require('phar://D:/domai...')
#6 {main}
thrown in phar://D:/domains/dragon-code/codestyler/vendor/laravel-zero/framework/bin/box/.box/src/Terminal.php on line 60
```
</details>
On execution, the error points to the code [`trim(getenv('ANSICON'))`](https://github.com/box-project/box/blob/main/requirement-checker/src/Terminal.php#L99)
I also downloaded the phar file from the [latest release](https://github.com/box-project/box/releases/tag/4.3.8) and also got an error:
<details>
<summary>Output</summary>
```bash
$ ./box.phar --version
PHP Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, bool given in phar://D:/domains/box.phar/.box/src/Terminal.php:60
Stack trace:
#0 phar://D:/domains/box.phar/.box/src/Terminal.php(60): trim(false)
#1 phar://D:/domains/box.phar/.box/src/Terminal.php(31): HumbugBox436\KevinGH\RequirementChecker\Terminal::initDimensions()
#2 phar://D:/domains/box.phar/.box/src/Printer.php(28): HumbugBox436\KevinGH\RequirementChecker\Terminal->getWidth()
#3 phar://D:/domains/box.phar/.box/src/Checker.php(17): HumbugBox436\KevinGH\RequirementChecker\Printer->__construct(32, true)
#4 phar://D:/domains/box.phar/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
#5 D:\domains\box.phar(16): require('phar://D:/domai...')
#6 {main}
thrown in phar://D:/domains/box.phar/.box/src/Terminal.php on line 60
Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, bool given in phar://D:/domains/box.phar/.box/src/Terminal.php:60
Stack trace:
#0 phar://D:/domains/box.phar/.box/src/Terminal.php(60): trim(false)
#1 phar://D:/domains/box.phar/.box/src/Terminal.php(31): HumbugBox436\KevinGH\RequirementChecker\Terminal::initDimensions()
#2 phar://D:/domains/box.phar/.box/src/Printer.php(28): HumbugBox436\KevinGH\RequirementChecker\Terminal->getWidth()
#3 phar://D:/domains/box.phar/.box/src/Checker.php(17): HumbugBox436\KevinGH\RequirementChecker\Printer->__construct(32, true)
#4 phar://D:/domains/box.phar/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
#5 D:\domains\box.phar(16): require('phar://D:/domai...')
#6 {main}
thrown in phar://D:/domains/box.phar/.box/src/Terminal.php on line 60
```
</details>
The suggestion is that we revert back to 4.2.0, so I have tried that:
https://github.com/xibosignage/xibo-xmr/raw/df815b1d629f0cb4479ea59f5a0487249b1cd3f6/bin/xmr.phar
Sorry for the trial and error - I don’t have a windows PHP installation to try it on.
epik
August 1, 2023, 5:29pm
8
Now it works ! Thanks Dan
1 Like
dan
August 1, 2023, 6:08pm
9
Fantastic, thanks for confirming! We will get that released with the rc1 coming soon.
system
Closed
November 1, 2023, 12:08am
10
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.