You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When trying to run php artisan optimize on PHP 8.2, the following error occurs:
Your configuration files are not serializable. This issue happens due to the use of closures in the configuration files, which are not serializable in PHP 8.2.
To Reproduce
Steps to reproduce the behavior:
Clone the NexoPOS repository.
Set up the environment (with PHP 8.2).
Run php artisan optimize
See the error:
Your configuration files are not serializable.
Expected behavior
The php artisan optimize command should run successfully without throwing any errors. The configuration files should be serializable in PHP 8.2.
Screenshots
NA
Solution
Replace the fn() closures in the config/accounting.php file with string-based labels or simple array values. Closures are not serializable in PHP 8.2, causing issues with configuration caching. By removing the closures and using direct values, the serialization issue is resolved.
Environment:
NexoPOS version: 5.3.1 (or the version you're using)
PHP version: 8.2
Premium Extensions: NA
The text was updated successfully, but these errors were encountered:
concetasolddev
changed the title
Error Running php artisan optimize in PHP 8.2: Configuration Files Not Serializable
[Issue] Running php artisan optimize in PHP 8.2: Configuration Files Not Serializable
Nov 15, 2024
Hi,
Indeed, with an anonymous function, it can't be serialized.
We'll consider a potential update there. we've used anonymous function to ensure translation are already loaded with it's called.
Describe the bug
When trying to run php artisan optimize on PHP 8.2, the following error occurs:
Your configuration files are not serializable. This issue happens due to the use of closures in the configuration files, which are not serializable in PHP 8.2.
To Reproduce
Steps to reproduce the behavior:
Clone the NexoPOS repository.
Set up the environment (with PHP 8.2).
Run php artisan optimize
See the error:
Your configuration files are not serializable.
Expected behavior
The php artisan optimize command should run successfully without throwing any errors. The configuration files should be serializable in PHP 8.2.
Screenshots
NA
Solution
Replace the fn() closures in the config/accounting.php file with string-based labels or simple array values. Closures are not serializable in PHP 8.2, causing issues with configuration caching. By removing the closures and using direct values, the serialization issue is resolved.
Environment:
NexoPOS version: 5.3.1 (or the version you're using)
PHP version: 8.2
Premium Extensions: NA
The text was updated successfully, but these errors were encountered: