nginx/php-fpm 服务器上的两个干扰 cakePHP-安装

发布于 2024-12-19 19:50:45 字数 2257 浏览 1 评论 0原文

我需要在我的 nginx 服务器上设置两个完全独立的 cakePHP 环境(nginx 1.0.5,通过 fastcgi 的 php5-fpm)。

我创建了以下文件夹结构:

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

现在,当我调用 virtual1.mydomain.com 时,我会看到我的前端应用程序并且可以使用它。 但是,当我调用 virtual2.mydoamin.com 时,我收到奇怪的错误(例如当 virtual2 包含 virtual1 的一些文件时......) Virtual1 无论如何都在工作。

现在我清除浏览器缓存&我的 cookies 并重新加载 virtual2.mydomain.com。现在我可以毫无问题地使用这个应用程序,但 virtual1.mydomain.com 显示奇怪的错误。

好的 - 现在我使用 open_basedir 将每个主机限制在他自己的目录中。结果:

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

编辑:当我从在不同互​​联网连接上运行的另一台计算机调用这些页面时,我得到了相同的错误:(

好吧 - 为什么这些 cakePHP 安装尝试从每次其他安装时

,为什么每次清除缓存和 COOKIES 后都会发生变化?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云巢 2024-12-26 19:50:45

哦,我有一个主意。缓存是如何存储的?是使用数据库,还是存储到文件中。如果您有多个安装,但只有一个数据库,请确保缓存存储到文件中。

作为调试措施,使用 mysqldump 创建两个数据库。在每次安装的 config/database.php 文件中将它们分开,然后再次检查问题。如果它消失,则说明缓存中的某些内容正在写入数据库(您不希望这样做)。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文