|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74849 Process is started as interactive shell in PhpStorm
Submitted: 2017-07-03 16:31 UTC Modified: 2017-07-24 09:40 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: svetlana dot zemlyanskaya at jetbrains dot com Assigned: ab (profile)
Status: Closed Package: CGI/CLI related
PHP Version: 7.2.0alpha2 OS: Windows 10
Private report: No CVE-ID: None
 [2017-07-03 16:31 UTC] svetlana dot zemlyanskaya at jetbrains dot com
1) Configure PHP 7.2 alpha 2 ( as PHP Interpreter in PhpStorm.
2) Create hello_world.php script.
3) Execute script with PHP Script run-configuration, i.e. 'C:\absolute\path\to\php\php.exe C:\absolute\path\to\script\hello_world.php'

I think the problem is in commit: e5c273dc0ea4cb0e0583af9b4c5889a8c431264f
PHP process executed by PhpStorm is treated as cli binary was clicked in filemanager.
Here's related PhpStorm issue:

Test script:

echo "Hello World!";

Expected result:
The script is executed and "Hello World!" is printed.

Actual result:
The script prints message "Interactive shell" and keeps running util manually canceled.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-03 17:57 UTC]
-Status: Open +Status: Feedback
 [2017-07-03 17:57 UTC]
Thanks for the report. I'd willing to fix this, but I'm not using PhpStorm, not even talking about how to configure it. Could you provide more details on the configuration part, especially if i fetch the trial version - would it suffice for a repro?

Or maybe there simpler way to reproduce the issue?

 [2017-07-03 20:03 UTC]
Automatic comment on behalf of ab
Log: Fixed bug #74849 Process is started as interactive shell in PhpStorm
 [2017-07-03 20:03 UTC]
-Status: Feedback +Status: Closed
 [2017-07-03 20:13 UTC]
AB, if you log in to the wiki we have licenses for this kind of thing: wiki.php.net_licenses_jetbrains
 [2017-07-04 09:26 UTC] svetlana dot zemlyanskaya at jetbrains dot com
You don't need a license to reproduce, trial version would work fine.

In PhpStorm process is created by `ProcessBuilder` ( but I think any programmatically created process will reproduce the issue. It's important to start a php process without corresponding console process.

In PhpStorm you can reproduce the issue with these steps:
1) Open a folder with a PHP script in PhpStorm.
2) Open Settings page by "File | Settings" for Windows.
3) Configure PHP Interpreter in "Language & Frameworks | PHP" inside setting.
4) Navigate to a PHP script and invoke the context menu.
5) Select "Run" option and then the one which contains "php" in its icon.
 [2017-07-04 11:30 UTC]
-Status: Closed +Status: Feedback
 [2017-07-04 11:30 UTC]
@danack, oh, good to know, thanks :)

Thanks for the further info, svetlana dot zemlyanskaya at jetbrains dot com. I've found a better way to achieve automatic interactive console activation and pushed a fix yesterday. Could you please check the latest master snapshots ?

About the programmatic process creation - nope, seems PhpStorm is doing something a bit different. Fe all our test suite uses proc_open to invoke a test. And also there was no fails with other use cases. A child process always will have its own console, and that console gets destroyed at the process end.

 [2017-07-04 12:08 UTC] svetlana dot zemlyanskaya at jetbrains dot com
-Status: Feedback +Status: Open
 [2017-07-04 12:08 UTC] svetlana dot zemlyanskaya at jetbrains dot com
Great, thank you! Build from master (Revision: r10dbc0b (July 04 2017, 13:03:13)) works perfectly.
 [2017-07-04 12:23 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2017-07-04 12:23 UTC]
Many thanks for checking. The fix is included with the upcoming alpha3 this week.

 [2017-07-24 09:26 UTC] piven dot m at gmail dot com
OS: Win7 (x64)
PHP: 7.2.0 beta 1

This is not PhpStorm bug - i reproduce it in simple windows batch file with this content:

@echo off
d:\web\php7.2.0b1\php.exe -f "d:\php\test.php"

If i delete first line (@echo off) or execute second line (d:\web\php7.2.0b1\php.exe -f "d:\php\test.php") from windows shell - all is ok, i'we got "Hello World!" from script output.

After several tests, I realized that the problem in the line (@echo off).
 [2017-07-24 09:40 UTC]
@piven dot m at gmail dot com thanks for the message. 

I don't reproduce this, see below. From the description also, it doesn't seem like same issue. If you still think it's related to php, please gather more info and file a separate ticket.

$ type bugs\bug74849\x.bat
@echo off
x64\Release_TS\php.exe -n -f "bugs\bug74849\x.php"

$ type bugs\bug74849\x.php

echo "hello\n";

$ bugs\bug74849\x.bat
Press any key to continue . . .

PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC