Req #60832 [Opn->Wfx]: run webserver in silent-mode for script
| From: | cmb@php.net | Date: | Tue, 23 Nov 2021 10:10:38 +0000 |
| Subject: | Req #60832 [Opn->Wfx]: run webserver in silent-mode for script | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-237935@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60832&edit=1
ID: 60832
Updated by: cmb@php.net
Reported by: info at jdhome dot net
Summary: run webserver in silent-mode for script
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
Package: Built-in web server
Operating System: winXP
PHP Version: 5.4.0RC6
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I agree that it may make sense to be able to run the built-in
server in some kind of silent mode, but that is already requested
as feature request #61931. However, running the server via
php-win.exe does not make much sense to me, since you wouldn't be
able to stop the server (except with taskkill etc.), and as others
commented, running without showing the console is already possible
by using third-party tools, so I'm closing this ticket as WONTFIX.
Previous Comments:
------------------------------------------------------------------------
[2015-01-29 06:34:01] mbrevda at gmail dot com
+1 for this request. It's really frustrating when running tests to have all that output, which
for some weird reason is all redirected to stderr. I would recommend having just errors sent to
stderr and all the other debug sent to stdout. This way, we can redirect stdout if were dont want
all the bloat.
Obviously, adding a quite switch, which would hide everything except errors, would be good, too
------------------------------------------------------------------------
[2013-12-08 03:00:36] gabo dot acosta624 at gmail dot com
Hello, I'm commenting here because I'm adapting Laravel command line server which runs a
php webserver. I'm working with Ruby rake an automation tool to run Cucumber which is a BDD
framework http://cukes.info/
So baiscally I run a web server to run acceptance tests and I've made it usable but I get all
the output form the webserver which ruins the usability of the test framework, being able to just
mute the server would achieve incredible succes, I hope you can help !!
------------------------------------------------------------------------
[2013-11-28 14:46:10] jakoch at web dot de
You might use RunHiddenConsole for this.
You may find it at
https://github.com/WPN-XM/WPN-XM/tree/master/bin/hideconsole
CLI
RunHiddenConsole.exe php.exe -S 127.0.0.1:12345 -t c:\www
I consider this not a bug.
------------------------------------------------------------------------
[2013-05-15 15:28:48] daniel at danielpage dot com
Hi,
This is my quick and dirty workaround for the same problem. The window is not removed, but it just
displays a status message and nothing else, and looks cleaner...
I use certain web processing scripts, but cannot install a full webserver. To work around this sort
of problem, I have a CMD batch file that does some creative processing, the code is supplied below.
The
cmd file needs to be placed in the same directory as php.exe
The code echos a notification string to a temporary CMD, then echos the php.exe startup command to
the temp CMD file, redirecting all output to nul (replace nul with a text file if you need to log),
then
using the windows start command, execute the temporary CMD file and call the window
"LocalWebApp". This window will open, and just display the text "Local Web App
Server. Close this window to stop using
any Local Web Apps". The dev server will then be started silently in the window with no visible
output. The script will then start your default browser and send you to the homepage of the dev
server.
The script will then pause for one second (the ping is just because there is not a sleep command
under windows and this simulates this), then delete the temporary file (in my full script I also
have
automatic random port generation and this is just cleanup).
--------------------------
echo @echo Local Web App Server. Close this window to stop using any Local Web Apps >>
startLocalWebApp12345.cmd
echo @php.exe -S 127.0.0.1:12345 -t c:\path\to\local\php\files\ ^> nul 2^>^&^1 >>
startLocalWebApp12345.cmd
start "LocalWebApp" startLocalWebApp12345.cmd
start http://127.0.0.1:12345
ping -n 2 127.0.0.1 >nul
del startLocalWebApp12345.cmd
--------------------------
------------------------------------------------------------------------
[2012-05-03 20:18:56] roberts at x0 dot lv
It is not the purpose of built-in web server to be used in "silent mode" like
that, therefore this is not a problem of PHP itself.
You could use some server manager or other 3rd party tools, e.g LIT Porter of
mine, to start PHP process and then You can close control center window.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=60832
--
Edit this bug report at https://bugs.php.net/bug.php?id=60832&edit=1