简体   繁体   English

使用 PHP、Composer、NPM 通过 WSL 设置 LEMP 的网络问题

[英]Network Issues with LEMP set up through WSL using PHP, Composer, NPM

Hope everyone is well希望大家都好

I have set up a LEMP environment on Ubuntu 18.04 WSL.我已经在 Ubuntu 18.04 WSL 上设置了一个 LEMP 环境。 I am using PHP7.1-FPM, Composer and NPM for an application running from a webserver.我正在将 PHP7.1-FPM、Composer 和 NPM 用于从网络服务器运行的应用程序。

I have set up the virtual host file and can browse to the webpage and open the application and connect to the database over localhost:80.我已经设置了虚拟主机文件,可以浏览网页并打开应用程序并通过 localhost:80 连接到数据库。 But my issue is, it feels like there is almost a timeout on the LEMP setup.但我的问题是,感觉 LEMP 设置几乎超时。 On the application, there is a 60-second timer where it automatically refreshes and pulls updated information from the MySQL database.在应用程序上,有一个 60 秒的计时器,它会自动刷新并从 MySQL 数据库中提取更新的信息。 If I press the inbuilt button to refresh it, that seems to work fine, but the minute it tries to do an automatic refresh, it throws up an error saying:如果我按下内置按钮刷新它,这似乎工作正常,但是当它尝试进行自动刷新时,它会抛出一个错误说:

net::ERR_INCOMPLETE_CHUNKED_ENCODING Uncaught (in promise ) Error: Network Error at e.explorts at XMLHttpRequest.f.onerror net::ERR_INCOMPLETE_CHUNKED_ENCODING 未捕获(承诺)错误:XMLHttpRequest.f.onerror 处 e.explorts 的网络错误

I did try adding proxy buffers:我确实尝试添加代理缓冲区:

             proxy_buffers 8 1024k;
             proxy_buffer_size 1024k;

I feel as though Windows 10 is playing a part.我觉得好像 Windows 10 正在发挥作用。 from my knowlege, port 80 is in use on windows 10 from PID4 HTTP service which is used by the print spooler but when i set it to a different port, It does not even connect (1111).根据我的知识,端口 80 正在 Windows 10 上使用,来自打印后台处理程序使用的 PID4 HTTP 服务,但是当我将其设置为其他端口时,它甚至无法连接(1111)。

I am just starting out really with this.我才刚刚开始。 I have (basic compared to most of you guys) knowledge in troubleshooting but WSL and LEMP is a new frontier to me so any help woul be much appreciated.我(与你们中的大多数人相比)有故障排除方面的知识,但 WSL 和 LEMP 对我来说是一个新领域,所以任何帮助都将不胜感激。

Many thanks in advance.提前谢谢了。

I think I know what the issue is, we use allow override in our vhost but this is not available on Nginx.我想我知道问题是什么,我们在 vhost 中使用了允许覆盖,但这在 Nginx 上不可用。 It would mean me having to convert our vhosts file.这意味着我必须转换我们的 vhosts 文件。

If anyone can assist with this, I would be most great full.如果有人可以提供帮助,我会非常满意。 In the mean time, I went with apache2 in wsl.同时,我在 wsl 中使用了 apache2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM