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

Esirei's avatar

Laravel 8 with PHP 8.1 on Apache server

Hey, has anyone gotten Laravel 8 to work with the newly released PHP 8.1 on windows using an apache webserver? I use windows 11 with laragon, when I tried it, I kept getting connection reset errors, but it works using the "artisan serve" command or an Nginx server.

0 likes
10 replies
Esirei's avatar

@Tray2 I believe sail uses the "artisan serve" command for it's webserver, which as I said, does work.

Tray2's avatar

@Esirei Sail uses docker containers running a LEMP stack.

1 like
Tray2's avatar

@Esirei Yes.

Taken from the documentation on sail

Laravel Sail is a light-weight command-line interface for interacting with Laravel's default Docker development environment. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience.

At its heart, Sail is the docker-compose.yml file and the sail script that is stored at the root of your project. The sail script provides a CLI with convenient methods for interacting with the Docker containers defined by the docker-compose.yml file.

Laravel Sail is supported on macOS, Linux, and Windows (via WSL2).

php artisan serve is basically a wrapper for php serve.

From running this command `php artisan help serve``

Description: Serve the application on the PHP development server

Usage:
  serve [options]

Options:
      --host[=HOST]     The host address to serve the application on [default: "127.0.0.1"]
      --port[=PORT]     The port to serve the application on
      --tries[=TRIES]   The max number of ports to attempt to serve from [default: 10]
      --no-reload       Do not reload the development server on .env file changes
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --env[=ENV]       The environment the command should run under
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Koossay's avatar
Koossay
Best Answer
Level 1

I just had your issue on Windows 10 with PHP 8.1 and Apache 2.4.51 Please verify if you have this error in your Apache errors.log

AH00428: Parent: child process 1440 exited with status 3221225725 -- Restarting.

The problem is in Apache with Windows, it allocates 1 MB of stack trace, unlike Linux/Unix system which is 8 MB If it's the case, you have to add this code to your httpd.conf

<IfModule mpm_winnt_module>
   ThreadStackSize 8888888
</IfModule>

And everything is working

4 likes
techtailor's avatar

@Koossay I've spent the last 1 hour trying every which way to figure out why I cant make laravel work with php 8.1 on laragon...... this fix needs to be ranked higher up in the search results. @esirei mark this as the best answer pls (provided it worked for u aswell).

1 like
Esirei's avatar

@Koossay Took a while to try it out as I have moved to Nginx, but it does work perfectly! Thanks!!

Please or to participate in this conversation.