-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows installation #170
Comments
We run multiple workers on Windows machines (because of Adobe After Effect) and we need Horizon for monitoring our workers. Is there no other solution for running this on Windows? And yes, I agree this should be mentioned in the Laravel docs. |
In my tests there is no way to run horizon on windows there is a way to compile one of the dependencies but that didn't work for me.
…________________________________
From: Jeffrey van Hees <notifications@github.com>
Sent: Friday, November 24, 2017 9:54 AM
To: laravel/horizon
Cc: Nadin arturo; Author
Subject: Re: [laravel/horizon] Windows installation (#170)
We run multiple workers on Windows machines (because of Adobe After Effect) and we need Horizon for monitoring our workers. Is there no other solution for running this on Windows?
And yes, I agree this should be mentioned in the Laravel docs.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#170 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFTcs0klbu9PRMSz980UrGjJgVmKjfgpks5s5sqMgaJpZM4PpclK>.
|
Hey everyone. We'd be open to deprecate usage of pcntl and posix and make Horizon work on Windows if anyone can ever send in a PR to the next major version which would solve this in a clean way. |
@driesvints any update on getting horizon to work on windows? |
@tcope25 nope but we're open to pull requests. |
Why not use exec("kill -9 $pid"), which is available natively and can be switched out with the relevant windows kill command, depending on context? This would come with the added benefit that process workers need to be owned by the www user. Or am I missing something? |
At the moment we're not looking to implement Windows support for Horizon ourselves but we're open to PRs which implement this in a clean way. Although I have to say that the internals would need to be overhauled by a lot in order to do so. |
I've just run into this problem myself now, and I didn't want to open a new issue (so that the above context doesn't get lost). I mainly use Windows as my dev environment too, and I've just spent some time looking at the Horizon code. I get why it would be a big overhaul to get it to run in Windows, but it doesn't seem impossible: PHP has a built-in process control library that should work on Windows, and make it possible to spawn/kill worker threads from a supervisor: https://www.php.net/manual/en/book.exec.php The pcntl functions have to do with listening for and processing signals, but it should be possible to listen for the Windows equivalent of SIGKILL using https://www.php.net/manual/en/function.sapi-windows-set-ctrl-handler.php For the others (pause, continue, etc), a more universal solution might be to use a long-running PHP process bound to a socket (ReactPHP style) and have the artisan commands interact with that. Or if redis is a hard requirement, use that to manage process signals. I may well end up going down this path to get it to work, but before I do, I wanted to check if I wouldn't be duplicating any effort. |
I have no plans to support Windows on this library and recommend using WSL2 when developing on Windows. |
So this is definitely possible with PHP 7.4: https://vimeo.com/480989385 - I'm about halfway to a complete implementation. Most of it just involves checking against PHP_OS_FAMILY (since PHP 7.3) and running slightly different commands. The signals that use pcntl can also be implemented as a really tiny shared memory block. I'll probably finish this up by next week. If there's no plans to maintain this as an official part of Horizon, I have no problems maintaining my own fork - this solves a big problem for me :) |
@woganmay definitely feel free to publish a fork 👍 |
Any updates @woganmay ? |
@woganmay Any update on that? did you fork a version that will work on Windows? |
Hey @dorshiff - we ended up moving to Laravel Sail internally, which removed the need for running Horizon on Windows itself. It doesn't look like I published any of the code I wrote either, and this was almost 18 months ago! Is this something you're blocked on? |
Thanks for the reply
Actually I used WSL as Tylor recommended in one of the comments and it worked.
… On 11 Mar 2022, at 0:28, Wogan May ***@***.***> wrote:
Hey @dorshiff - we ended up moving to Laravel Sail internally, which removed the need for running Horizon on Windows itself. It doesn't look like I published any of the code I wrote either, and this was almost 18 months ago!
Is this something you're blocked on?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.
|
Hey @woganmay, any chance you still have that code at all? While Sail and Homestead are options, in the age of Herd, something like this could be very useful for making Horizon viable for Herd & Windows based devs. Might be a bit above my head but happy to take a look at reviving it? EDIT: Wogan DM'd me some of the idea, will look at perhaps reviving the idea for Windows Herd users... |
so if using Herd Pro on windows will not help, how can i get horizon whill developing on windows and still have the Herd Pro benifits? |
You can't, or at least the solution defeats the purpose of Herd: Just use a Docker container for PHP (in WSL or not) or use PHP in WSL directly. But if you're doing that, you can also just go ahead and install most of Herd's other tooling as well on your containerised setup or WSL and just not use Herd. Or just don't use Horizon on local at all. You basically have to decide if not using Horizon on local is a deal breaker for you. In the end I also just ditched Windows anyway instead of trying to develop a workaround. PS. Horizon isn't the only package affected by Windows-related PHP issues. Pail won't work, and any third party package using Prompts without a non-Prompts fallback won't work either. |
This is not really an issue the problem is the following
Many people like me develop their apps in windows platforms and the production servers runs in Forge with Ubuntu.
Since horizon requires PHP extensions that are not compatible with windows developers might get composer issues saying that ext-pcntl or ext-posix are missing so people are not able to install the package and they probably wont use horizon in their local development only on production environments
So I think we should mention this in the Laravel docs: That Horizon is not compatible with windows, however users can install it by running composer install with the option --ignore-platform-reqs
PS: I created a PR on Laravel docs for this (laravel/docs#3686)
The text was updated successfully, but these errors were encountered: