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

nishatmamun's avatar

PHP Artisan Serve command stucks!!!

Whenever I run php artisan serve command in vscode it stucks up there. I don't know why? I have tried almost everything to fix this thing but nothing worked.

0 likes
21 replies
MohamedTammam's avatar

Disable your anti-virus. and make sure you're not freezing the terminal.

And please share your machine specs.

nishatmamun's avatar

@MohamedTammam I am not using any anti-virus right now. My vscode terminal gets freezed when I run it but my server keeps running in browser though. If I press CTRL+C then things gets back to normal again. But why is it freezing idk. I am using win10 and my Machine specs: CPU: Core i5 (4th gen) Ram: 16GB ddr3 Had Disk: 2.5TB (2+500) No external GPU

FazalAbbas's avatar

@nishatmamun ONly your local server again run apache or mysql . i facing this issue because my mysql during working stop and php artisan serve command stuck

Sinnbeck's avatar

Do you mean it does not exit automatically? Try ctrl+c

Sinnbeck's avatar

@nishatmamun what do you mean by freeze? Its supposed to stay running until you exit it with ctrl+c. Otherwise you cannot use it for anything. It's how it works

nishatmamun's avatar

@Sinnbeck Well I attached a screenshot link here. You can see here it stuck up there. [postimg.cc/BPH8Dhc9]

Tray2's avatar

@nishatmamun You need to decide if you want to use xampp or php artisan serve, don't use both, they migth end up in conflict with eachother.

Of course it gets "stuck" that is the way the starting of the built in php server works. There isn't anything wrong. If you want to send the process to the background you try

nohup php artisan serve, but I don't see the need for it. The process is supposed to run in the foreground, so just open another terminal window.

nishatmamun's avatar

@Tray2 Yeah I can use it with these stuck but often this hang breaks with lots of error and this is so painful.

nishatmamun's avatar

@Sinnbeck yeah I can visit the site. But the problem is, it often throws bunch of error with server disconnection.

srushti_kansagara's avatar

@Tray2 can you explain to me what do you mean by we shouldn't user xampp and php artisan serve together ??? i have been doing that ... like i run the xampp (apache and MySQL ) and then php artisan serve in my vs code terminal... i am not wrong , am i ?

Tray2's avatar

@srushti_kansagara Not technically wrong, but you are using two webservers, Apache and the one built into php.

I suggest that you pick one and stick to it, and have both up and running at the same time.

I also would suggest switching Herd. https://herd.laravel.com

1 like
srushti_kansagara's avatar

@Tray2 my current project is on the laravel 10 and php 8.2 do don't know if herd will work with that i have never work with the herd and also if i stop the xampp then i am getting the error No connection could be made because the target machine actively refused it btw i am talking about development environment

Tray2's avatar

@srushti_kansagara Laravel 10 works just fine on Herd. The issue with the refusing of the connection is likely the database server that isn't running, but I would suggest using dbngin to handle the databases https://dbngin.com/

1 like
srushti_kansagara's avatar

@Snapey i know i am asking silly question but what is the actual use of herd.. like it is working without php artisan serve but i still need to use run the xampp right

Please or to participate in this conversation.