php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60832 run webserver in silent-mode for script
Submitted: 2012-01-21 16:56 UTC Modified: 2021-11-23 10:10 UTC
Votes:6
Avg. Score:3.0 ± 2.0
Reproduced:5 of 6 (83.3%)
Same Version:2 (40.0%)
Same OS:1 (20.0%)
From: info at jdhome dot net Assigned: cmb (profile)
Status: Wont fix Package: Built-in web server
PHP Version: 5.4.0RC6 OS: winXP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info at jdhome dot net
New email:
PHP Version: OS:

 

 [2012-01-21 16:56 UTC] info at jdhome dot net
Description:
------------
I want to run the built-in Webserver in silent Mode.
Why?
I love the ultramicro built-in-server to execute some scripts written in php by browsing an ultramicro-website or to generate file-overview to browse in.
The php-win isn't able to run that built-in server and so its not possible to run that server real quitly in background.
All i want is the built-in-server functions without that annoying cli-window :)
So please add the builtin-webserver in the php-win.exe!!


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-03 20:18 UTC] 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.
 [2013-05-15 15:28 UTC] 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

--------------------------
 [2013-11-28 14:46 UTC] 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-12-08 03:00 UTC] 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 !!
 [2015-01-29 06:34 UTC] 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
 [2021-11-23 10:10 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-11-23 10:10 UTC] cmb@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 00:01:30 2024 UTC