We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Strange view collision with multi apps on vagrant with VHosts

Been trying to track this down for half the day and I'm now loosing the will to live!

I have a vagrant box setup running apache with VHosts setup for multiple domains and sub domains. I have multiple apps that I'm developing brom a skeleton app. VHosts work fine. The skeleton app works fine. The problem I am getting is when I have more than one app running on Vagrant. Despite the fact each app has it's own domain and document route, intermitantly, one app will try to load a corresponding view from another app and break. You can clearly see the view is from the wrong app, and there will be errors saying things like Undefined variable: $config->wrong->app->item which will be a variable from the config.ini of the other app. This will keep happening for a while, then both apps will be fine again.

At first I thought this was some kind of namespace collision, because all the apps are based on the same skeleton app and all the generic classes have the same namespace. It seemed that when you navigated the browser to a part of an app that has a unique namespace, the problem wouldn't happen.

So then I decided a namespace collision could not be possible accross domains and document routes. So I started investigating .htaccess, Apache and the VHosts. I couldn't find any issues with those.

Now I am back to poking about in my apps. And what it seems like, is that the DI is escaping some how, or getting stuck in the server's memory. For example, when I get the issue and var_dump($view) the view path I see is for the other app!

Running Phalcon 2.0.5 with PHP5.5.9 on Ubuntu Trusty 64 with Apache2. Anyone know what the hell is going on and how I can fix it?

strange , i use wamp with the same setup basicly , a lot of domains with diffrent applications with the same structure ,can you show your virtual host file ?