Req #60832 [Com]: run webserver in silent-mode for script

From: Date: Sun, 08 Dec 2013 03:00:37 +0000
Subject: Req #60832 [Com]: run webserver in silent-mode for script
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183195@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 Comment by: gabo dot acosta624 at gmail dot com Reported by: info at jdhome dot net Summary: run webserver in silent-mode for script Status: Open Type: Feature/Change Request Package: Built-in web server Operating System: winXP PHP Version: 5.4.0RC6 Block user comment: N Private report: N New Comment: 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 !! Previous Comments: ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ [2012-01-21 16:56:56] 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!! ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60832&edit=1

« previous php.bugs (#183195) next »