brefphp / laravel-bridge

Package to use Laravel on AWS Lambda with Bref
https://bref.sh/docs/frameworks/laravel.html
MIT License
314 stars 63 forks source link

fix: updated the layer version of php #76

Closed SanthoshSiddegowda closed 1 year ago

SanthoshSiddegowda commented 1 year ago

Issue: By default, we are configuration copied from this file path, when I run the php artisan vendor:publish --tag=serverless-config and deploy I am getting this below error

{"message":"Internal Server Error"}

Reason : As I checked the cloud watch log, I found below issue

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.24. in /var/task/vendor/composer/platform_check.php on line 24  


Fix: Updated the layer to php-81-fpm from php-80-fpm to support current laravel version dependencies

Attachments: Screenshot 2022-10-28 at 12 56 22 PM Screenshot 2022-10-28 at 12 56 40 PM

mnapoli commented 1 year ago

Thanks! I'm not sure we want to upgrade all projects to PHP 8.1 by default 🤔

Most users are still on PHP 8.0: https://packagist.org/packages/bref/laravel-bridge/php-stats#1

Is the latest version of Laravel PHP 8.1 only?

SanthoshSiddegowda commented 1 year ago

@mnapoli Apologies, There is a misunderstanding on my end

In my local setup, the PHP version is 8.1

PHP 8.1.11 (cli) (built: Sep 29 2022 20:02:53) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.11, Copyright (c) Zend Technologies with Zend OPcache v8.1.11, Copyright (c), by Zend Technologies

Since I am using composer(v2), we have Platform Check. so basically while making serverless files I unknowingly made the minimum version 8.1,

So technically, the layer version should be identical to the PHP version of which you are using

Since most of the users are still in PHP 8.0 no need for any change.

Closing the PR

Reference: https://php.watch/articles/composer-platform-check

Also useful: https://github.com/composer/composer/issues/10282 https://github.com/composer/composer/issues/10282

mnapoli commented 1 year ago

Got it, thanks for the details!