php - php工匠无法正常工作(laravel 5.1)

原文 标签 php laravel laravel-5 laravel-5.1 artisan

Php artisan not working (laravel 5.1)

Suddenly when i type php artisan or any artisan command i seen this message

[ErrorException]
Trying to get property of non-object

I tried the following

1- php artisan clear-compiled

2- To delete vendor directory and use composer install Or composer update

3- clone a standard Laravel app and put my files app dir and my config and use composer commands but with step the error has changed to be

[ErrorException]
Trying to get property of non-object

Script php artisan clear-compiled handling the post-install-cmd event returned with an error

[RuntimeException]
Error Output:

Any Suggestions ?

Thanks

Answer

If I understand well, you have this issue when you use your app files. It probably means that you have some problem in constructor - you try to run function and the object is not initialized. You should not set up things in constructors (look for example at your controllers) or you will get some "strange" errors and your artisan won't work

翻译

突然我输入php artisan或任何工匠命令时
我看过这则讯息


  [ErrorException]
    试图获取非对象的属性


我尝试了以下

1- php artisan clear-compiled

2-删除vendor目录并使用composer installcomposer update

3-克隆一个标准的Laravel应用程序并将我的文件app dir和我的配置
 并使用composer命令,但是随着步骤的更改,错误已变为


  [ErrorException]
    试图获取非对象的属性
  
  脚本php artisan进行了明确编译,处理了返回错误的post-install-cmd事件
  
  [RuntimeException]
    错误输出:


有什么建议 ?

谢谢
最佳答案
据我了解,使用应用程序文件时会出现此问题。这可能意味着您在构造函数中遇到了一些问题-您尝试运行函数并且该对象未初始化。您不应该在构造函数中进行设置(例如在控制器上查看),否则会出现一些“奇怪的”错误,并且您的技术人员无法使用
相关推荐

php - preg_match_all()不匹配所有可能的出现

php - 在本地数据库中存储Amazon API数据

php - PHP表格检查数组mysql中的复选框值时查询?

php - 无法从数组获取正确的值

php - cakePHP在模型中使用请求/身份验证数据的3个最佳实践(基于帐户的云服务)

php - 什么数据类型可用于在mysql中放置标志(布尔值)?

javascript - 尝试将数据从.php文件传递到.js文件

php - 更改子菜单时如何更改网页背景?

php - Symfony2:如何避免数据库中已经存在重复的实体?

php - Eclipse中的PHP 7调试器设置