PHP 错误记录


zizaco/entrust配置过程中出错
  • 错误详情:

    D:\xampp\htdocs\vitahomebackend>php artisan entrust:migration
    
        In BoundMethod.php line 135:
        
          Method Zizaco\Entrust\MigrationCommand::handle() does not exist
    
  • 错误原因:

    laravel 5.5中才遇到

  • 解决方法:

    参考:

    使用 Entrust 扩展包在 Laravel 5 中实现 RBAC 权限管理(一):安装配置篇
    中的评论

    vendor\zizaco\entrust\src\commands\目录下找到Zizaco\Entrust\MigrationCommand这个文件,然后里面又个fire方法改成handle方法


Linux下执行composer install报错
  • 错误详情:

    Failed to download xxx/xxx from dist: The zip extension and unzip command are both missing, skipping.
    The php.ini used by your command-line PHP is: /etc/php/7.1/cli/php.ini
        Now trying to download from source
    
  • 错误原因:

    缺少 zip unzip 包

  • 解决方法:

    参考:

    使用 Composer 遇到的坑

    apt-get install zip unzip
    

使用Cache时报错
  • 错误详情:

    BadMethodCallException: This cache store does not support tagging. 
    
  • 错误原因:

    .env 中的 CACHE_DRIVER未修改,CACHE_DRIVER值默认为file,而文件(file)和数据库驱动不支持标记(tagging)

  • 解决方法:

    参考:

    This cache store does not support tagging

    This cache store does not support tagging.

    CACHE_DRIVER=array
    


$table->timestamps();生成的created_atupdated_at时间错误
  • 错误详情:

    使用$table->timestamps();,插入到数据表中的created_atupdated_at字段值不正确,不是当前时间

  • 错误原因:未设置时区

  • 解决方法:

    Laravel工程目录下,修改app/config/app.php文件:

    // 默认为 'timezone'='UTC'
    'timezone'='Asia/Shanghai'
    

你可能感兴趣的:(PHP 错误记录)