Why the server.php given by laravel is being deleted when i exit the terminal in VS code or in CMD i currrently using
xampp
php v8.2.12
composer v2.7.6
laravel framework v11.21.0
i try to uninstall and reinstall the php, composer, and laravel multiple times
2
Answers
I think this issue can often be attributed to interference from antivirus software.
Maybe you should check antivirus settings:Review your antivirus logs to see if server.php is being flagged or deleted.And add an exception for the Laravel project folder or specifically for the
server.php
file in your antivirus settings.Or if the file is missing, you can manually recreate it by copying the server.php file from a new Laravel installation into your existing project.
Another way is to use Built-in PHP Server, using the command:
php -S localhost:8000 -t public
.This command serves your application without relying on php artisan serve, which may help avoid the deletion issue
These are all the aspects I can consider.Hope i can help you :>
server.php
has been moved inside the framework in Laravel 9.It is correct that it does not exist.
https://github.com/laravel/framework/pull/40034
https://github.com/laravel/laravel/pull/5747