Hello, I am trying to install octoberCMS on php 7.3 and I get the following error.
dev@server:~/apps/dev-oc/public$ php artisan october:install
[ErrorException]
Unparenthesized `a ? b : c ?: d` is deprecated. Use either `(a ? b : c) ?: d` or `a ? b : (c ?:
d)`
I find it weird because I have installed octoberCMS on this version of php many times.
@LucasZdv what plugins are you using and what build of October are you using?
I don't have plugins installed, I try to install it from the terminal.
curl https://octobercms.com/api/installer |php
The error appears when running php artisan october: install
@LucasZdv Are you sure you're using PHP 7.3? My understanding is that deprecation was done for 7.4.
@bennothommo We currently have php 7.3.12 installed, @LukeTowers, I think, you use serverpilot, this problem can be reproduced by installing a new server. Since all new serverpilot servers use this version of php.
@LucasZdv are you able to post a stack trace of the issue? It's kind of a pain for me to spin up a new SP app to test this there

can you check storage/log for the system log?
I did an extra test, I could install it from the wizard installation correctly.
@LukeTowers The error only occurs in the installation from the console.
#0 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/october/rain/src/Support/ClassLoader.php(91): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Unparenthesized...', '/srv/users/dev/...', 423, Array)
#1 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/october/rain/src/Support/ClassLoader.php(91): require_once()
#2 [internal function]: October\Rain\Support\ClassLoader->load('System\\Classes\\...')
#3 /srv/users/dev/apps/dev-bancodecomercio/public/modules/system/ServiceProvider.php(524): spl_autoload_call('System\\Classes\\...')
#4 /srv/users/dev/apps/dev-bancodecomercio/public/modules/system/ServiceProvider.php(55): System\ServiceProvider->registerAssetBundles()
#5 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(586): System\ServiceProvider->register()
#6 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(75): Illuminate\Foundation\Application->register(Object(System\ServiceProvider))
#7 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(561): Illuminate\Foundation\ProviderRepository->load(Array)
#8 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders()
#9 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(213): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(October\Rain\Foundation\Application))
#10 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(296): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(119): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 /srv/users/dev/apps/dev-bancodecomercio/public/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main}
I tried running php artisan october: fresh after installation from the wizard, and I also have the same problem, this is due to compatibility with php 7.3.12. I am worried that ServerPilot will update all the servers very soon to this version to the servers that were running an earlier version.
[2019-11-27 17:29:03] development.ERROR: ErrorException: Unparenthesized `a ? b : c ?: d` is deprecated. Use either `(a ? b : c) ?: d` or `a ? b : (c ?: d)` in /srv/users/dev/apps/dev-bancodecomercio/public/modules/system/classes/CombineAssets.php:423
Stack trace:
#0 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/october/rain/src/Support/ClassLoader.php(91): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Unparenthesized...', '/srv/users/dev/...', 423, Array)
#1 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/october/rain/src/Support/ClassLoader.php(91): require_once()
#2 [internal function]: October\Rain\Support\ClassLoader->load('System\\Classes\\...')
#3 /srv/users/dev/apps/dev-bancodecomercio/public/modules/system/ServiceProvider.php(524): spl_autoload_call('System\\Classes\\...')
#4 /srv/users/dev/apps/dev-bancodecomercio/public/modules/system/ServiceProvider.php(55): System\ServiceProvider->registerAssetBundles()
#5 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(586): System\ServiceProvider->register()
#6 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(75): Illuminate\Foundation\Application->register(Object(System\ServiceProvider))
#7 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(561): Illuminate\Foundation\ProviderRepository->load(Array)
#8 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders()
#9 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(213): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(October\Rain\Foundation\Application))
#10 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(296): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 /srv/users/dev/apps/dev-bancodecomercio/public/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(119): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 /srv/users/dev/apps/dev-bancodecomercio/public/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main}
@LucasZdv can you run php --version? The PHP CLI version is different from the application version you set in ServerPilot
dev@bancodecomercio:~$ php --version
PHP 7.4.0RC6 (cli) (built: Nov 11 2019 01:02:58) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v7.4.0RC6, Copyright (c), by Zend Technologies
@LucasZdv that would be why. Use php7.3-sp instead and it should work. @bennothommo we're going to need to make sure that October works for 7.4 soon.
Server pilot support says
Hi,
Thanks for getting in touch; I'd be happy to provide some assistance. It seems that all other servers that are under accounts with the domain mojito-soft.com are indeed using the previous version of PHP 7.3 (7.3.11) at this time. However, once automatic updates run on your other servers, which should be within the next 24 hours or less, then they will also be updated to version 7.3.12 (the most current PHP 7.3 version available). The error you provided indicates that the OctoberCMS code is using something that appears to have been deprecated in this version (7.3.12). So, I would recommend contacting their support team to make them aware of the issue, so they can eventually release an update that fixes the issue:
https://octobercms.com/support
In order to temporarily work around this issue, you can install PHP 7.3.11 on any servers that are currently using 7.3.12 by using the following command as the 'root' user via SSH:
sudo apt-get install sp-php7.3=7.3.11-1
This will downgrade the version to 7.3.11, but you will also want to 'hold' the package to prevent it from being updated by automatic updates going forward, which you can do by running the following command:
sudo apt-mark hold sp-php7.3
To prevent the other servers from updating that are still using 7.3.11, you will also want to run the above command.
Once you know that OctoberCMS has fixed the issue and you have updated your sites, then you can remove the hold on this package with the following command and it will allow it to be updated automatically again:
sudo apt-mark unhold sp-php7.3
Let us know if you have any questions, or if you need any further assistance.
@LucasZdv ignore what they said, 7.3.12 has no breaking changes from 7.3.11 that would cause this: https://www.php.net/ChangeLog-7.php#7.3.12.
My original comment is still correct, when you run just php artisan october:install on the server the default PHP CLI version used is 7.4 which is currently incompatible (will be fixed in a future update). So, for now just run any artisan commands with php7.3-sp instead.
@LucasZdv I've resolved the error you had encountered with e9abdf7783366be643be3c0023500bdc4a32d939, however, there's potentially more incompatibilities with PHP 7.4 at the moment, including some introduced from our vendors. I would recommend locking your PHP version down to 7.3 as @LukeTowers has suggested for now.
Update: 7.4 should be supported as of Build 461
Thank you very much now works great work!
Most helpful comment
@LucasZdv that would be why. Use
php7.3-spinstead and it should work. @bennothommo we're going to need to make sure that October works for 7.4 soon.