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

tasso85's avatar

Max execution time exceeded on Laravel Bootcamp

I am trying to run the Laravel bootcamp for Livewire, and right after installation, I tried starting the development server with

php artisan serve

however, the first page load failed with

Fatal error: Maximum execution time of 30+2 seconds exceeded (terminated) in /root/chirper-livewire/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php on line 606

I then killed and restared the server, and I got to the homepage... As soon as I click "Register", once again I get

PHP Fatal error: Maximum execution time of 30 seconds exceeded in /root/chirper-livewire/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php on line 606 PHP Stack trace: PHP 1. {main}() /root/chirper-livewire/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php:0 PHP 2. require_once() /root/chirper-livewire/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php:16

No amount of killing and restarting the dev server seems to get me to the "register" page.

I am using PHP 8.3.7 on WSL on Windows 11, the PC itself should be pretty decent with an Intel i9-11900H CPU and 16 GB RAM, and half of these resources (4 cores and 8 GB RAM) are reserved for WSL.

I tried checking resource usage with top, and indeed as soon as I click "register", CPU kicks in to 100% for about 30 seconds, and then it just dies.

What can I check to make it work?

EDIT:

I have tried pushing the max_execution_time with 2x increments, up to 240 seconds, which is a ridiculously high limit, but I still hit the error

Fatal error: Maximum execution time of 240+2 seconds exceeded (terminated) in /root/chirper-livewire/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php on line 606

I tried also the version with standard HTML templates with blade, and the one with Inertia+React, and I didn't find such problems; it is incredibly frustrating when trying out new technologies and the tutorial itself doesn't work, since you being a newbie obviously have no idea what to do to fix it.

0 likes
13 replies
tykus's avatar

The register action should only be returning a view; and therefore, should be relatively quick. Can you share the code for your Route, Controller action and View template?

Snapey's avatar

Have you added something that does a Http request somewhere?

Your problem is symptomatic of using php artisan serve that is single threaded

tasso85's avatar

I hadn't still done anything aside from the first few parts of the Bootcamp tutorial for Livewire.

Basically, I created the new project, installed Breeze with Livewire, and went on trying it by doing

npm run dev

and in a separate console

php artisan serve

then I connected to localhost, and it took more than a few seconds just to load the homepage, and then I got the problem when going to "register" page.

I just reinstalled all from scratch in a new empty directory, this time I got to the register page, but could not register, the blue bar on top of the page would just stop almost at the end, and then nothing happens...

If I kill the artisan server, and then restart it, by reloading the main page I see that it did create the user and logged me, but again I cannot access the "dashboard" page, I get ERR_EMPTY_RESPONSE even though the artisan server log doesn't show anything.

EDIT: What I just noticed is that, when it tries to load the dashboard, the server logs do NOT show a max execution time error, it "just" fails to load.

After such failure, all subsequent requests to localhost will fail, until I kill and restart the artisan server.

EDIT 2: Just tried again, this time since the user already exists I went to the "log in" page, I added email and password, and about a minute after hitting submit I got

Fatal error: Maximum execution time of 60+2 seconds exceeded (terminated) in /root/livewire-chirper/vendor/livewire/livewire/src/Features/SupportMorphAwareIfStatement/SupportMorphAwareIfStatement.php on line 180

By looking at the process list, it seems that every time that the actual server process gets a similar fatal error, artisan starts a new one on the "next" port, as I verified by manually killing the php process a couple of times, and not it is running on port 8003 instead of 8000... If I restart artisan, it gets back to port 8000.

Snapey's avatar

open the browser network tools and see what is happening there.

Also make sure your app_url is the same as the url you use to reach the application

tasso85's avatar

I retried the login operation, looking at Chrome's dev tools, I just see the request being sent, and in the response section there is only

This request has no response data available

On the console, I got

Fatal error: Maximum execution time of 60+2 seconds exceeded (terminated) in /root/livewire-chirper/vendor/livewire/livewire/src/Features/SupportMorphAwareIfStatement/SupportMorphAwareIfStatement.php on line 180

tasso85's avatar

I tried also running it on a "real" webserver, so I tried Apache+FPM, but still no luck.

In this case, I see the PHP FPM process taking 100% CPU for some time, with RAM usage going up to 80% (that is about 6GB) before the OS decides to kill the process to reclaim memory.

I tried moving also the project with Inertia instead of Livewire, and that starts up pretty quickly, even though I have a different problem then, which is unrelated to this thread.

tasso85's avatar

@ogi84 In the end I abandoned Livewire and went with InertiaJS+React

Maybe I should try again now, just for curiosity.

ogi84's avatar

@tasso85 i did fixed the problem and i am fully enjoying livewire. These days network connectivity is so fast that the world needs things like livewire to use it. I have 15 years of experience doing carrier grade telecommunications.

ogi84's avatar

Couple of problems i fixed fighting this:

  1. On windows no matter what i do my web browser is forcing me from http -> https. Solution: i did create self-singed cert for using https.

  2. On windows the vite server 0.0.0.0 thingy did not resolve by any chance to 127.0.0.1 and it seems the only way to dockerize the nodejs, listen on the ip of the docker container and vite to generate proper uri for the assets due if docker network ip is not appropriate/visible. Solution: There is a browser extension called Reddirector - i did create https://0.0.0.0 -> https://localhost for the vite development server to work and be started by docker container (on windows).

  3. For the timeout on SupportMorphAwareIfStatement.php@180 - 100% you have a mistake in the syntax of your component, i did find and fixed mine. Post here maybe i can help

  4. Not so much realated to this topic but it worth mentioning - VMX need to be enabled in BIOS if you want to use docker on windows. The docker error consists kind of counter-intuitive message...

tasso85's avatar

@ogi84 thanks for your insight, regarding point 3, I didn't create any component, so if there was an error, it would be in the base project itself; anyway I'll give it a look.

About point 4, that's interesting but I am not using docker on windows, but rather I am using the WSL.

tasso85's avatar

So, in the end, I decided to completely scrap the previous test made 2 months ago, and create a clean install; this time it worked out-of-the-box.

Maybe there was something wrong in the previous version, I do not know, since also the last time I only installed the base livewire project and then tried it right away with the embedded server.

This time it "just worked".

swilla's avatar

I ran into this problem after dealing with some merge conflicts. It turned out that the error was related to a parse error in PHP within one of the blade files.

@if(str_contains($licenseValue, 'X))

This was causing the error because the string wasn't closed in this function call. Once I corrected that, it worked fine. Ideally, this should have given that parse error instead of the timeout.

The hint was the error message though which seemed like it was having issues parsing PHP:

vendor/livewire/livewire/src/Features/SupportMorphAwareIfStatement/SupportMorphAwareIfStatement.php: 180

protected static function hasEvenNumberOfParentheses(string $expression)

    {

        $tokens = token_get_all('<?php '.$expression);

Please or to participate in this conversation.