So I am have vagrant set up with virtual hosts on my development machine but when I try a very simple echo of 'hello world' it hangs for like 10 seconds before processing the file. HTML files render very quickly. Where do I even start to troubleshoot this?
After doing some research, others have complained of slow performance with php and virtualbox/vagrant. Many have claimed that the use of the shared folder between host/guest is the cause of this.
In each case I have re-provisioned the box but still get the same performance issues, at least a 10 second hang when hitting a simple php script in the web browser.
Other things I have tried:
This leads me to believe that the problem is somehow with the apache+php part of the stack.
Not sure what else to do.
I've just come across this issue too.
Following on from ivanicus, it's related to the xdebug configuration. It appears that the request is hanging while xdebug is trying to connect to a remote debugging client. I have been able to resolve the issue by setting...
xdebug.remote_connect_back=0
xdebug.remote_autostart=0
I have then set the xdebug.remote_host value to the IP of the host machine, you need to make sure your guest machine can connect to the host on the IP you set. This allows me to debug within PhpStorm still.
It doesnt look like you can currently set the xdebug.remote_connect_back option within the ini settings on https://www.puphpet.com/ so I had to manually alter it within the php.ini
After struggling with this same situation, removing the XDebug usage was the only "solution" I could find.
Taking into account a basic default Vagrant configuration from https://puphpet.com/ as the original poster:
Notes:
Hope this helps!
Many have claimed that the use of the shared folder between host/guest is the cause of this
I found this was definitely the issue in my case.
https://docs.vagrantup.com/v2/synced-folders/nfs.html
As I'm using windows, I wasn't able to use the NFS option either.
To test that this was the case, I moved all the SQLite files I was accessing onto the box using SFTP and the performance went back to the levels I was expecting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With