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
{{ message }}
Repository navigation
Incompatibility with PHP 7.4 line 52 src/Util/Str.php #507
Oh, crap. Thanks for pointing this out, introduced in #501. This happens when decoding fails. I'll adjust the code so the proper error is bubbled up for you. I think the change you made will instead result in the .env file being thrown away.
You could try installing ext-mbstring. We use a symfony provided polyfill if the extension is missing, which may contain bugs. Using the extension may fix this issue for you.
I found the php7-mbstring package for Alpine Linux, 3.15.0 which is what I am building for my lightweight Nginx + PHP-FPM container which my application runs in.
I've gone ahead and added the Alpine php7-mbstring package so now that core function made available.
After doing this, the problem went away. This is not a bug in your software. This was the lack of the proper core PHP function being available after upgrading my container to PHP 7.4.
I am also getting Internal Server Error when trying to load dotenv in a production server.
If I comment out the following two lines, the internal server error goes away, so I know it has to do with dotenv
Activity
GrahamCampbell commentedon Dec 18, 2021
Oh, crap. Thanks for pointing this out, introduced in #501. This happens when decoding fails. I'll adjust the code so the proper error is bubbled up for you. I think the change you made will instead result in the .env file being thrown away.
maietta commentedon Dec 18, 2021
Thank you!
GrahamCampbell commentedon Dec 18, 2021
What encoding were you trying to use btw? My "fix" will just make your app crash with an error saying "UTF-8 decoding failed." instead.
maietta commentedon Dec 18, 2021
Not sure, just plain text I suppose. I know it's UTF-8 though. No weird characters or BOM's introduced.
GrahamCampbell commentedon Dec 18, 2021
What's happening is
mb_convert_encoding($input, 'UTF-8')is returning false on your machine.GrahamCampbell commentedon Dec 18, 2021
You could try installing
ext-mbstring. We use a symfony provided polyfill if the extension is missing, which may contain bugs. Using the extension may fix this issue for you.maietta commentedon Dec 18, 2021
I ran composer require ext-mbstring and that installed fine. Same error.
My .env file looks like this:
Don't know if that helps.
The PHP loader looks like this:
GrahamCampbell commentedon Dec 18, 2021
It is not possible to install PHP extensions using composer. It's likely the extension is still not installed.
Can you run this code on your server:
maietta commentedon Dec 18, 2021
I found the php7-mbstring package for Alpine Linux, 3.15.0 which is what I am building for my lightweight Nginx + PHP-FPM container which my application runs in.
I've gone ahead and added the Alpine php7-mbstring package so now that core function made available.
After doing this, the problem went away. This is not a bug in your software. This was the lack of the proper core PHP function being available after upgrading my container to PHP 7.4.
Thank you for helping me pinpoint this.
eduardomart commentedon Oct 22, 2022
I am also getting Internal Server Error when trying to load dotenv in a production server.
If I comment out the following two lines, the internal server error goes away, so I know it has to do with
dotenvI tried your suggestion and ran
var_dump(function_exists('mb_convert_encoding'));and I get:bool(true)also tried maietta's suggestion in the first post, but it made no difference in my case.
I am running the same php version locally and on my production server (7.4.32)