Req #60832 [Com]: run webserver in silent-mode for script
| From: | jakoch at web dot de | Date: | Thu, 28 Nov 2013 14:46:11 +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-182985@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: jakoch at web dot de
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:
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.
Previous Comments:
------------------------------------------------------------------------
[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