【问题标题】:Symfony 1.4 Fatal error Class 'myUser' not foundSymfony 1.4 致命错误找不到类“myUser”
【发布时间】:2014-08-29 11:59:49
【问题描述】:

在错误日志中我看到:

Fatal error: Class 'myUser' not found in /usr/share/nginx/www/services/cache/frontend/dev/config/config_factories.yml.php on line 120

什么会导致这个问题?

Nginx 配置:

server {
        listen   80;

        root /usr/share/nginx/www/services/web;
        index index.php index.html index.htm;
        access_log /usr/share/nginx/www/log/access.log;
        error_log  /usr/share/nginx/www/log/error.log;
        server_name server.lap;


        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
              root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;

        }

    location / {
        index index.php;
        try_files $uri /index.php?$args;
    }

}

            location ~ \.php$ {
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_index index.php;
                    include fastcgi_params;
            }

              location ~ ^/(index|frontend|frontend_dev|backend|backend_dev)\.php$ {
                    include fastcgi_params;
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    fastcgi_param PATH_INFO $fastcgi_path_info;
                    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
                    fastcgi_param HTTPS off;
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
      }

    }

【问题讨论】:

    标签: php nginx symfony-1.4


    【解决方案1】:

    查看应用程序的 lib 文件夹中是否有 myUser.class.php 文件。如果没有创建一个并在其中添加:

    <?php
    
    class myUser extends sfBasicSecurityUser
    {
    }
    
    ?>
    

    或者,如果您使用的是 sfGuardPlugin:

    <?php
    
    class myUser extends sfGuardSecurityUser
    {
    }
    
    ?>
    

    然后清除缓存。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-10-21
      • 2014-10-03
      • 2014-12-27
      • 1970-01-01
      • 1970-01-01
      • 2011-09-08
      • 2011-12-17
      相关资源
      最近更新 更多