PhpStorm automatically stops Symfony server and deletes router.php
Hi!
I'm a new user of PhpStorm and Symfony and I've been experiencing some issues with the software. When I try to test my Symfony project by using the "php bin/console server:run" command everything works fine for about a minute then the server automatically stops and deletes router.php from projectfolder\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle\Resources. When I restart the server, I obviously get an error indicating the missing file. I tried to manually place the file there but for some reason Windows tells me I have no permission to create router.php in that location even though I'm an admin on this computer.
The weird thing is that sometimes everything works fine with a new project, other times this happens and I have no clue what I can do. I tried different versions of PhpStorm, tried reinstalling, tried resetting configuration and I also activated an education license but the issue remains.
Here's the complete error message my browser says when I try to navigate to my routed page in my Symfony app:
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'E:\Projects\PHP\reinstalltest\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle/Resources/router.php' (include_path='E:\Software\XAMPP\php\PEAR') in Unknown on line 0
Any help would be greatly appreciated.
Thank you in advance!
请先登录再写评论。
Hi there,
1) Check idea.log for any possible hints (Help | Show Log in...)
2) Based by the path to that file ... it's a composer-controlled file (so it's technically a "library" in IDE eyes) so IDE should not be even touching it at all.
I may suggest to get Process Monitor (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) and see what process will be deleting that file etc. It's extremely unlikely that IDE will be doing that (never heard of such cases)
P.S. I assume that you are not editing that router.php file yourself...
Sorry for not answering sooner, haven't been able to test this until now. So I disabled all the background processes I have on my computer and the problem hasn't occured since then, I'll just have to track down the software that causes the issue.
Thank you for the help!
Hello,
the issue is still opened for me. I have 2 projects. The first one is OK. The second one doesn't work due to this same issue.
@Bench1947 , how did you disable the background processes?
Then, I wonder how to work on 2 projects in parrallel with phpstorm.
If someone has some good advices, it would be very helpful!
Thank you in advance!
If you have the same issue as described in the original post then Procmon should help to understand why files are being removed and what process is in charge of that. Please read the comment from Andriy Bazanov for details.
Problem solved,
The antivirus deleted automatically the file! Thanks!