Vagrant on Windows w / Precise64 runs php very slowly

So, I have a tramp configured with virtual hosts on my development machine, but when I try the very simple echo "hello world", it hangs like 10 seconds before processing the file. HTML files are displayed very quickly. Where do I even begin to fix this problem?

After some research, others complained about slow work with php and virtualbox / vagrant. Many argue that the reason for this is to use a shared folder between the host / guest.

  • I tried to change the location of the shared folder so that it does not point to / var / www /
  • I also tried to completely remove the public folder configuration by deleting the 'config.vm.synced_folder' statement

In each case, I re-provided the field, but still get the same performance issues, at least 10 seconds freezes when you click on a simple php script in a web browser.

Other things I've tried:

  • runs the same php script from the command line. It works great. The immediate answer.
  • Clicking an html page from a web browser. I also get a quick response.

This makes me think that the problem is somehow related to the apache + php stack part.

Not sure what else to do.

+6
source share
5 answers

After dealing with the same situation, uninstalling XDebug was the only โ€œsolutionโ€ I could find.

Given the default default Vagrant configuration from https://puphpet.com/ as the source poster:

  • Removed xdebug lines from "manifestests / default.pp"
  • Deleted folders "modules / xdebug /"
  • roving destroy
  • vagrant up

Notes:

  • I suppose that not including "xdebug" on the specified site would be the best solution, but I already had changes in my configuration of strollers.
  • Although this is not an ideal solution, it solves the indicated slowness and turns this problem into the question "how to properly enable and run xdebug on Windows hosts."

Hope this helps!

+4
source

I also ran into this problem.

Following ivanicus, it is associated with the xdebug configuration. It looks like the request is hanging, and xdebug is trying to connect to the remote debug client. I was able to solve the problem by installing ...

xdebug.remote_connect_back=0 xdebug.remote_autostart=0 

Then I set the xdebug.remote_host value to the IP address of the host machine, you need to make sure that your guest computer can connect to the host at the IP address you set. This allows me to debug in PhpStorm still.

It doesn't seem like you can set the xdebug.remote_connect_back parameter in the ini settings to https://www.puphpet.com/ , so I had to manually change it in php.ini

+7
source

Many have argued that using a shared folder between the host / guest is the reason for this.

I found that this is definitely a problem in my case.

https://docs.vagrantup.com/v2/synced-folders/nfs.html

Since I use windows, I also could not use the NFS option.

To verify that this is the case, I moved all the SQLite files that I was viewing using SFTP and the performance returned to the levels I was expecting.

+1
source

You can allocate more resources from the host using

 config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--memory", "3072", "--cpus", "2"] end 

I donโ€™t know if this will help at all, but itโ€™s good to know.

0
source

I created my Vagrant setup with https://puphpet.com/ and now use https://github.com/bryannielsen/Laravel4-Vagrant , which was much faster.

0
source

Source: https://habr.com/ru/post/945735/


All Articles