|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74979 Interactive shell opening instead of script execution with -f flag
Submitted: 2017-07-24 10:38 UTC Modified: 2017-07-24 16:11 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: piven dot m at gmail dot com Assigned: ab (profile)
Status: Closed Package: CGI/CLI related
PHP Version: 7.2.0beta1 OS: Win7 (x64), WinSrv2012 R2 Std
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
49 - 26 = ?
Subscribe to this entry?

 [2017-07-24 10:38 UTC] piven dot m at gmail dot com
If I try to execute simple script from windows batch file (see code below), i get php interactive shell instead of result.

@echo off
php.exe -n -f test.php

If I delete the first line (@echo off) - the script runs successfully.

In this bug AB pushed a patch, that was applied to PHP 7.2.0 alpha 3, but both alpha 3 and beta 1 still has that issue.

Test script:
echo "hello world\n";

Expected result:
hello world

Actual result:
Interactive shell

php >


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-24 10:59 UTC]
Thanks for going for a separate ticket. As mentioned in bug #74849, i couldn't repro it, it was Windows 10. I've just tested same on Server 2012 build 9200, but still the result is correct. Have you met this issue before alpha3? Seems there's some difference on the environment or whatsoever, that doesn't show the bug on my side :(

 [2017-07-24 12:11 UTC] piven dot m at gmail dot com
I have a clean OS Windows Server 2012 R2.

PHP 7.1.7 - have no bug;
PHP 7.2.0 alpha 1 - have no bug;
PHP 7.2.0 alpha 2 - have no bug;
PHP 7.2.0 alpha 3 - have bug;
PHP 7.2.0 beta 1 - have bug.

It does not matter x64 or x86 platform and TS or NTS version of PHP.
 [2017-07-24 14:19 UTC]
-Status: Open +Status: Feedback
 [2017-07-24 14:19 UTC]
Please check some latest master snapshot

Also, was this reproducible under windows 10? If you have some.

 [2017-07-24 14:38 UTC] piven dot m at gmail dot com
Yes, everything works fine in Windows 7 and Server 2012.
I can test Windows 10 and leave a comment, but later.
The main problem is fixed, thanks a lot!
 [2017-07-24 16:11 UTC]
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: ab
 [2017-07-24 16:11 UTC]
Great, thanks for the quick checks! There seem to be additional tricky thinks on different OSes and envs. Both bugs should be fixed now. The actual fix is 8a6afbef3f003e8faaeb560f9a7dbfbf7a8b1568, so it is going to be included into the next beta.

 [2017-07-24 19:24 UTC] piven dot m at gmail dot com
Yeap, Windows 10 have same problem that win7 and win2012. Your patch 8a6afbef3f003e8faaeb560f9a7dbfbf7a8b1568 fixed it. Thanks!
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 09:01:28 2024 UTC