PHP Artisan command does not work

1

There was a demand at work where I had to get a Laravel 5 project from a client and start changing it. I had some problems at the time of putting it to run, but now it is going, except for the artisan command, which does not work even when I type php artisan .

I need to make some changes, such as creating models and controllers, but it simply always gives the error

  Call-time pass-by-reference has been removed

[Symfony \ Component \ Debug \ Exception \ FatalErrorException]

I'm running the command in the project folder.

    
asked by anonymous 21.01.2016 / 19:03

1 answer

4

Understand the problem:

<?php 

function spam(&$arg) {
    print $arg . "\n";
}

$var = 'PHP';

spam(&$var); # Causa erro
spam($var); # Okay!

I do not think this error is in the Laravel framework itself - because someone else would already have detected it - but in some specific part of the application such as controllers, models, services etc.

All you have to do now is look for (with help from your code editor, IDE, or LINUX command-line tools) by some standard like this: " &$ " in function calls ( but not in definitions ) of the source code. This is because the error derives from some function call where some parameter is passed with " & " in front of the variable / parameter. Find these occurrences and you will be solved.

In the sublimetext editor there is a tool called Find in files, the menu is: Find - > Find in Files ... (Shift + Ctrl + F):

EDIT

I noticed that you posted only part of the error. I'm pretty sure if you post the rest of the message or StackTrace (better) there will be the line where the error is and then you will not even have to search the entire source code, just go on the line pointed at the bug and make the adjustment. Please paste the error stacktrace.
It is expected that a typical error like this will return something like this:

  

PHP Fatal error: Call-time pass-by-reference has been removed in   /home/martins/teste.php on line 10

     

Fatal error: Call-time pass-by-reference has been removed in   /home/martins/teste.php on line 10

    
21.01.2016 / 19:40