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

kirankumar467's avatar

make php artisan serve multi threaded

I am running production environment with php artisan serve, but i am unable to handle multiple requests at the same time. Please suggest what has to be done. I need to handle 500 requests at the same time. Thanks in advance.

0 likes
16 replies
SaeedPrez's avatar

You need to use a real web server in production, that's what has to be done..

Apache, nginx, IIS, etc..

(Edit: Warning sign is for @zachleigh's PHP documentation quote)

1 like
zachleigh's avatar

Artisan serve uses the built in php server, which is only for development purposes. See the note in the php documentation about it: http://php.net/manual/en/features.commandline.webserver.php

This web server was designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. It should not be used on a public network.

Do what @SaeedPrez said and get a real server up and running. Apache or nginx are going to be your best options.

Edit: I see SaeedPrex has beat me to the documentation warning... :(

1 like
SaeedPrez's avatar

@zachleigh sounds like you've had too little coffee today. Don't worry, I added a warning sign for you.

1 like
zachleigh's avatar

@SaeedPrez Lol. Thanks, its just what my inadequate post needs. (Yeah, don't think I can get enough coffee today..)

1 like
kirankumar467's avatar

@SaeedPerz @zachleigh Thank you so much for the information.

But if i am using WAMP server (Apache web server), if multiple requests are hitting at the same time, i am getting whoops looks like something went wrong error. Please help me. Thanks in advance.

kirankumar467's avatar

@SaeedPrez I am getting following error in my log.

[2017-04-23 09:35:20] production.ERROR: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. in C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:43 Stack trace: #0 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php(27): Illuminate\Encryption\Encrypter->__construct('', 'AES-256-CBC') #1 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(746): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption{closure}(Object(Illuminate\Foundation\Application), Array) #2 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(644): Illuminate\Container\Container->build(Object(Closure), Array) #3 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(709): Illuminate\Container\Container->make('encrypter', Array) #4 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(864): Illuminate\Foundation\Application->make('encrypter') #5 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(819): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #6 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(788): Illuminate\Container\Container->getDependencies(Array, Array) #7 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(644): Illuminate\Container\Container->build('App\Http\Middle...', Array) #8 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(709): Illuminate\Container\Container->make('App\Http\Middle...', Array) #9 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(127): Illuminate\Foundation\Application->make('App\Http\Middle...') #10 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #11 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #12 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Routing\Router.php(655): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #13 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Routing\Router.php(629): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #14 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Routing\Router.php(607): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #15 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(268): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #16 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(53): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request)) #17 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #18 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(137): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #19 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #20 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #21 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(150): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #22 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(117): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #23 C:\wamp64\www\GoAP\public\index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #24 C:\wamp64\www\GoAP\index.php(21): require_once('C:\wamp64\www\G...') #25 {main} [2017-04-23 09:35:20] production.ERROR: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. in C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:43 Stack trace: #0 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php(27): Illuminate\Encryption\Encrypter->__construct('', 'AES-256-CBC') #1 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(746): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption{closure}(Object(Illuminate\Foundation\Application), Array) #2 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(644): Illuminate\Container\Container->build(Object(Closure), Array) #3 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(709): Illuminate\Container\Container->make('encrypter', Array) #4 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(864): Illuminate\Foundation\Application->make('encrypter') #5 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(819): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #6 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(788): Illuminate\Container\Container->getDependencies(Array, Array) #7 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Container\Container.php(644): Illuminate\Container\Container->build('App\Http\Middle...', Array) #8 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(709): Illuminate\Container\Container->make('App\Http\Middle...', Array) #9 C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(174): Illuminate\Foundation\Application->make('App\Http\Middle...') #10 C:\wamp64\www\GoAP\public\index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response)) #11 C:\wamp64\www\GoAP\index.php(21): require_once('C:\wamp64\www\G...') #12 {main}

willvincent's avatar

[2017-04-23 09:35:20] production.ERROR: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. in C:\wamp64\www\GoAP\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:43

You need to ensure you have the mcrypt extension installed and enabled. Check your wamp php config.

SaeedPrez's avatar

@kirankumar467 In addition to all suggested solutions, also make sure APP_KEY is set in your .env file.

You can run php artisan key:generate to generate a new key.

kirankumar467's avatar

@SaeedPrez @jimmck i tried with all the suggestions finally it worked with the below options.

php artisan config:clear then php artisan config:cache

SaeedPrez's avatar

@kirankumar467 Ahh, great that you got it working..

For future reference though, if it's not production, don't use php artisan config:cache as it's a boost for the live server but can cause headaches in development since changes to the config won't take place until you clear the cache.

1 like

Please or to participate in this conversation.