CakePHP 应用程序远程工作但不在本地计算机上

发布于 2024-11-16 16:21:13 字数 863 浏览 2 评论 0原文

我有一个 CakePHP 应用程序,我一直在远程服务器上开发它。远程服务器上一切正常。

我现在尝试将其安装在全新安装 XAMPP 的计算机上。蛋糕过期了。 Apache 正在工作 - 其他东西,例如 phpMyAdmin,工作正常。我通过端口 8000 运行 Apache,因为 IIS 使用端口 80。操作系统是 Windows Server 2003。

尝试访问应用程序时,它超时,并出现以下错误:

致命错误:最长执行时间为 30 秒超出了 C:\xampp\htdocs\cake\libs\debugger.php 第 247 行

我已经关闭了 URL 重写,但这并没有解决问题。

我一直试图通过回显内容然后退出蛋糕核心中的脚本来追踪问题的根源。我发现当组件尝试加载时脚本超时(出现相同的错误)。我在 app_controller 中注释掉了我的组件数组,并且脚本运行得更远一些。

现在,我已经追踪到这里了:

Dispatcher::dispatch();
Dispatcher::_invoke();
Controller::constructClasses();
Controller::loadModel();
ClassRegistry::init(); //called on line 635 of Controller in the "else" block of the if (PHP5) statement

在 ClassRegistry::init() 中,脚本在第 141 行超时,如下所示:

${$class} =& new $class($settings);

我不知道从这里到哪里去!非常感谢帮助。

I have a CakePHP app which I have been developing on a remote server. Everything is working fine on the remote server.

I'm now trying to install it on a machine with a fresh install of XAMPP. Cake is timing out. Apache is working - other things, such as phpMyAdmin, work fine. I am running Apache through port 8000, as IIS is using port 80. The OS is Windows Server 2003.

When trying to access the app, it times out, with the following error:

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\cake\libs\debugger.php on line 247

I have turned URL rewriting off, that hasn't solved the problem.

I have been trying to track down the source of the problem by echoing things and then exiting the script in the cake core. I found that the script was timing out (with the same error) when the components were trying to load. I commented out my components array in app_controller, and the script ran a little further.

Now, I have tracked it down this far:

Dispatcher::dispatch();
Dispatcher::_invoke();
Controller::constructClasses();
Controller::loadModel();
ClassRegistry::init(); //called on line 635 of Controller in the "else" block of the if (PHP5) statement

In ClassRegistry::init(), the script times out on line 141, whic is as follows:

${$class} =& new $class($settings);

I have no idea where to go from here! Help much appreciated.

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

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

发布评论

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

评论(2

燕归巢 2024-11-23 16:21:13

我明白你的问题了。

要解决这个问题,你应该做两件事。

1)尝试从配置adn更改core.php中的调试级别2,然后将其更改为0。
2) 请从配置中启用此行。
core.php 中的第 57 行。
配置::write('App.baseUrl', env('SCRIPT_NAME'));

问候,
建筑师。

I got your problem.

To solve this you should do tw0 things.

1) Try to change the debug level 2 in the core.php from the config adn then change it to 0.
2) plz enable this line from the config.
line number 57 in core.php.
Configure::write('App.baseUrl', env('SCRIPT_NAME'));

regards,
archit.

朱染 2024-11-23 16:21:13

好吧,在进一步关注这个问题之后,我发现问题出现在 Model::construct 中。原来我的database.php文件中的主机名是错误的!我预计会出现“无法连接到数据库...”错误。

Well, after following the problem a bit further, I found that the problem was coming up in Model::construct. It turns out that the hostname in my database.php file was wrong! I would have expected a "could not connect to the database..." error.

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