PHP代码在windows上工作,但在linux上卡住了


PHP Code working on windows but got stuck on linux

我正在使用mysql数据库的php web应用程序。

我使用Windows作为开发环境,现在当我试图将应用程序移动到生产级别(CentOS 7)时,我遇到了一些问题。

总之,问题如下:

我的主页是登录页面,表单的动作在一些叫做login-action.php的页面:

login-action.php

[Some Code]
echo 'before user model';
include_once 'user.class.php'
echo 'after user model';
header ('Location: index.php');
[Some Code]

user.class.php

[Some includes]
echo '  before User Class';
class AppUserModel {
...
...
}
echo 'after User Class';

在我的开发环境中一切都很好,但在CentOS上,我试图登录,但我被困在login-action.php响应:

before user model  before User Class

问题是什么

到目前为止我尝试过的事情:

  • 设置最大执行时间为无限值。(请求响应时间太长)。
  • 我不认为这个问题与mysql有关,因为应用程序在执行任何mysql查询甚至连接到数据库之前被卡住了。
  • 我启用了所有错误(E_ALL),但我没有得到任何错误。
  • 我不能写任何东西在类(作为echo),因为它不是语法正确的。
  • 我不认为DIRECTORY_SEPERATOR可能是问题,因为它正确加载login-action.phpuser.class.php

可能是什么问题,或者我如何解决它?

    检查centOS服务器上的错误日志。
  1. 如果您没有访问错误日志的权限,请尝试使用这3行来显示错误

    error_reporting(E_ALL);
    ini_set('display_errors', TRUE);
    ini_set('scream.enabled', TRUE);
    

请记住,Linux是区分大小写的,而不是windows,在90%的情况下,这是主要问题。检查正确的错误将帮助您识别问题

相关文章: