Question

I needed to setup two completely separated cakePHP-Environments on my nginx-server (nginx 1.0.5, php5-fpm via fastcgi).

I created the following folder-structure:

/var/www
  /**virtual1**/
    /app
    /lib/Cake/..
  /**virtual2**/
    /app
    /lib/Cake/..

Now, when I call virtual1.mydomain.com I see my front-end-app and can use it. But, when I call virtual2.mydoamin.com I get strange errors (like when virtual2 includes some of the files of virtual1..) Virtual1 is working anyway.

Now I clear my browser cache & my cookies and reload virtual2.mydomain.com. Now I can use this app without any problems BUT virtual1.mydomain.com show strange errors.

Okay - Now I limited each host to his own directory using open_basedir. Result:

Warning: include(): open_basedir restriction in effect. File(/var/www/virtual1/lib/Cake/Cache/Engine/FileEngine.php) is not within the allowed path(s): (/var/www/taskees:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/virtual2/lib/Cake/Core/App.php on line 505

Warning: include(/var/www/virtual1/lib/Cake/Cache/Engine/FileEngine.php): failed to open stream: Operation not permitted in /var/www/virtual2/lib/Cake/Core/App.php on line 505

Warning: include(): Failed opening '/var/www/virtual1/lib/Cake/Cache/Engine/FileEngine.php' for inclusion (include_path='/var/www/virtual2/lib:.:/usr/share/php:/usr/share/pear') in /var/www/virtual2/lib/Cake/Core/App.php on line 505

Warning: include(): open_basedir restriction in effect. File(/var/www/virtual1/lib/Cake/Core/CakePlugin.php) is not within the allowed path(s): (/var/www/taskees:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/virtual2/lib/Cake/Core/App.php on line 505

Warning: include(/var/www/virtual1/lib/Cake/Core/CakePlugin.php): failed to open stream: Operation not permitted in /var/www/virtual2/lib/Cake/Core/App.php on line 505

Warning: include(): Failed opening '/var/www/virtual1/lib/Cake/Core/CakePlugin.php' for inclusion (include_path='/var/www/virtual2/lib:.:/usr/share/php:/usr/share/pear') in /var/www/virtual2/lib/Cake/Core/App.php on line 505 Fatal error: Class 'CakePlugin' not found in /var/www/virtual2/app/Config/bootstrap.php on line 67

Edit: I get the same errors when I call these pages from a different computer operating on a different internet-connection :(

okay - Why the hell do these cakePHP-Installations try to get files from the each time other installation

AND WHY DOES THIS CHANGE EVERYTIME AFTER CLEARING CACHE AND COOKIES?

Was it helpful?

Solution

Oooh, I have an idea. How is the cacheing being stored? Is it using a database, or is it storing to file. If you have multiple installs, but only one db, make sure the caches are storing to file.

As a debug measure, make two databases using mysqldump. Separate them in the config/database.php files for each install, then check the problem again. If it goes away, then something in the cacheing is being written to db (which you don't want).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top