PhpStorm 2016.2 + Laravel5.3 + Command Line Tool - Artisan
为情所困
为情所困 2017-05-16 16:51:14
0
1
593

Configuration according to this

http://confluence.jetbrains.c...

When using the old version of Phpstrom, when using laravel5.2, it is correct and easy to use.

When I changed to phpstrom2016.2 laravel5.3, an error was reported during configuration. Anyone know the reason?

The question link on stackoverflow.com is:
http://stackoverflow.com/ques...

Error message:

为情所困
为情所困

reply all(1)
巴扎黑

Thanks for the invitation. But I have never used PHPStorm, it is too expensive and I can’t afford it...

Looking at your error log, it should not be a problem with PHPStorm. You executed it php artisan list --xml 这个命令,而 --xml 是不被支持的,应该是 php artisan list --format=xml

Maybe this parameter was not written by you. Looking at your screenshot, where Symfony is selected, it should be automatically called by PHPStorm --xml.

I searched and found that many people have encountered this problem. The most commonly used solution is to modify the artisan problem to support the --xml 参数。编辑项目根目录下的 artisan 文件,在 <?php parameter. Edit the artisan file in the project root directory and add a piece of code after <?php:

if (isset($argv[1], $argv[2]) &&
    $argv[1] === 'list' &&
    $argv[2] === '--xml'
) {
    $argv[2] = '--format=xml';
    $_SERVER['argv'] = $argv;
}

Source:
https://laracasts.com/discuss...
http://stackoverflow.com/a/34...

Some people in the PHPStore forum also gave other solutions, you can refer to https://youtrack.jetbrains.co...

--- update:

I just installed PHPStorm and tried it, and it works normally.
The version I installed:

PhpStorm 2016.2.1
Build #PS-162.1889.1, built on August 23, 2016

Add command step:

  1. Enter Settings Preferences | Tools | Command Line Tool Support

  2. Click to add a command. Select Tool based on Symfony Console and click OK

  3. Enter the command code name, select Symfony version 3.*.*, select the php path, and enter the artisan file path of the project. Then click OK and a pop-up message will appear indicating that 59 commands have been found.

  4. Test: Select the menu Tools | Run Command and enter artisan , artisan list , artisan make:controller TestController, both are normal.

Notes:

  • When creating a new command, select the Symfony 3 version

  • Path to PHP executable To select the php location being used on your system, you can use which php in the system terminal to get it. which php 得到。
    PHPStorm 这里的选择框应该会把你系统使用的所有 PHP 版本列出来。我这边是两个,第一个 php 是 macoOS 自带的,版本是 5.5.36,而 Laravel 5.3 最低要求 PHP 版本是 5.6.4 。 你截图的那个错误就是这个原因,Laravel 5.3 helpers.php PHPStorm The selection box here should list all PHP versions used on your system. I have two here. The first php comes with macoOS and its version is 5.5.36. The minimum required PHP version of Laravel 5.3 is 5.6.4. This is the reason for the error in your screenshot. There is a syntax in Laravel 5.3 helpers.php that PHP 5.5 does not support.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template