Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Eddy805's avatar

PHP 7.4 breaks Laravel 6

Hi, Upgrading to 7.4 broke my Laravel 6.x installation. 7.3 runs it fine though.

It looks like Monolog is under the impression that my filesystem is read only:

The stream or file "/usr/share/nginx/website/storage/logs/laravel-2019-12-13.log" 
could not be opened: failed to open stream: Read-only file system

in

Monolog\Handler\StreamHandler::write :111
vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:111

Obviously, this is false, as running php 7.3 runs flawless without any changes, but also (nginx is running as user http:http):

[edwin@kappa logs]$ ls -al
total 3380
drwxrwxr-x 2 edwin http   4096 Dec 13 12:35 .
drwxrwxr-x 5 edwin http   4096 Dec 13 12:35 ..
-rw-rw-r-- 1 edwin http  40354 Dec 13 12:35 laravel-2019-12-13.log

Is this a known issue?

0 likes
3 replies
Eddy805's avatar

Weirdly enough:

[edwin@kappa website]$ php artisan tinker
Psy Shell v0.9.12 (PHP 7.4.0 — cli) by Justin Hileman
>>> Log::info("Test");
=> null
>>> 
Exit:  Ctrl+D
[edwin@kappa website]$ cat storage/logs/laravel-2019-12-13.log 
[2019-12-13 12:57:24] local.INFO: Test
GeordieJackson's avatar

IIRC, if you update composer.json to include

"php": "^7.4" 

it will work.

Please or to participate in this conversation.