问题
I'm trying to install memcached from: http://blog.elijaa.org/index.php?post/2010/10/15/Memcached-for-Windows&similar
When I try to run it with the -d command line option I get the following error:
Failed to ignore SIGHUP: No error
failed to daemon() in order to daemonize
When I run it without -d it appears to run normally, but I need -d to install it as a service...
I've tried the following tutorials but they don't explain how to solve this.
http://shiki.me/blog/installing-memcached-for-php-5-3-on-windows-7/
http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/
http://zurmo.org/wiki/installing-memcache-on-windows
How to install and use memcached in Windows for PHP?
I've tried both the 32 and 64 bit versions but it didn't make a difference. I also tried the version from: http://code.jellycan.com/files/memcached-1.2.6-win32-bin.zip
Which does not give this error but still doesn't create the service.
Anyone know how to get this working?
回答1:
Petesh's answer from the below helped me.
sc create "Memcached11211" binPath= "C:\memcached\memcached.exe -d runservice -p 11211" DisplayName= "Memcached11211" start= auto
https://stackoverflow.com/a/18228391/3998308
回答2:
I usually run this:
c:\memcached\memcached.exe -vv start
to have it as verbose as possible.
You could try:
schtasks /create /sc onstart /tn memcached /tr "'c:\memcached\memcached.exe' -m 512"
as it says here.
来源:https://stackoverflow.com/questions/27732696/memcached-on-windows-failed-to-ignore-sighup-no-error-failed-to-daemon-in-ord