PHP命令每次都打开另一个窗口 [英] PHP command is opening another window every time
问题描述
我在计算机上使用XAMPP.
I am using XAMPP in my computer.
我在路径中添加了xampp/php.
I have added xampp/php in my path.
现在,当我运行任何PHP命令时,它每次都会打开另一个窗口进行输出.
Now, when I run any PHP command, it opens another window for output every time.
当我运行"php -v"时,它将打开另一个窗口并立即关闭.
When I run "php -v" it opens another window and closes immediately.
推荐答案
案例1-权限:
我第一次遇到此错误,问题是当我将权限更改为:读写php可以正常工作时,我的php文件夹仅具有读取权限.
The first time I had this error, the problem was that my php folder only had read permissions, when I changed the permissions to: read and write php worked correctly.
案例2-病毒:
第二次出现此错误,是因为有两个程序(病毒)被称为:explorer.exe和svchost.exe.在这种情况下,最好的解决方案是:格式化PC或尝试防病毒(Windows防御程序无法检测到它们).
The second time I had this error, it was because of two programs (virus) called: explorer.exe and svchost.exe. In this case, the best solutions are: format the PC or try an antivirus (the Windows defender does not detect them).
我手动解决了该问题,如果您也想解决此问题,请在此处详细说明步骤:
I fix the problem manually, if you also want to do it I detail the steps here:
重要提示:
1):检查您的问题是否相同:打开任务管理器",然后在启动"和进程"选项卡中查找这些问题.
1) Check if your problem is the same: Open the "Task Manager" and look for these in the "Startup" and "Processes" tab.
- explorer.exe(与Windows资源管理器不同)
- svchost.exe(在进程"选项卡中不带名称的情况下出现)
如果您的情况并非如此,则该步骤将无效,很可能是另一种病毒引起了问题.
If this is not your case, the steps will not work, it is possible that another virus is causing the problem.
2)进行备份,以防万一出现问题并且必须格式化计算机.
2) Make a backup, in case something goes wrong and you have to format your computer.
指南:
步骤1:打开任务管理器",单击启动"选项卡,查找名称:explorer.exe和svchost.exe,将它们标记为已禁用,然后重新启动计算机.
Step 1: Open the "Task Manager", click on the "startup" tab, look for the names: explorer.exe and svchost.exe, mark them as disabled and restart the computer.
步骤2:在文件资源管理器中,打开窗口:文件夹选项",单击视图"选项卡,启用选项:显示隐藏的文件和文件夹",并在下面禁用选项:隐藏受保护的操作系统文件",然后单击应用"按钮并关闭窗口.
Step 2: In a file explorer, open the window: "Folder options", click on the "view" tab, enable the option: "Show hidden files and folders" and below disable the option: "Hide protected operating system files", then click the Apply button and close the window.
步骤3::查找并删除这些文件,如果系统不允许您删除它们,则必须更改文件的所有者:
Step 3: Find these files and delete them, if the system does not let you delete them you will have to change the owner of the files:
如果您对这些文件有疑问,可以在Internet上搜索它们.这些文件不应位于该文件夹中.
If you have doubts about these files you can search them on the internet. These files should not be in that folder.
C:\Windows\System\cmsys.cmn
C:\Windows\System\explorer.exe
C:\Windows\System\spoolv.exe
C:\Windows\System\svchost.exe
C:\Users\%username%\AppData\Roaming\mrsys.exe
第4步::建议替换您的PHP文件夹并重新配置(在我执行PHP的情况下,病毒已重新生成,因此我必须再次执行所有步骤)
Step 4: It is recommended to replace your PHP folder and reconfigure it (In my case when executing PHP the virus was re-generated and I had to follow all the steps again).
步骤5::重新启动计算机,打开命令提示符,然后尝试"php -v"命令.不要忘记在文件夹选项"中启用隐藏受保护的操作系统文件"选项.
Step 5: Restart the computer, open the command prompt and try the "php -v" command. Don't forget to enable "Hide protected operating system files" option in "Folder options".
完成这些步骤后,PHP可以正常工作.
After these steps PHP worked correctly.
我希望这会有所帮助.
这篇关于PHP命令每次都打开另一个窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!