Show HN: NativePHP Now Supports Windows

https://github.com/orgs/NativePHP/discussions/278

Following on from #271, I'm thrilled to be able to announce that...

  • NativePHP now supports Windows! πŸͺŸ
  • And, Windows builds are working πŸ‘·πŸ½β€β™€οΈ
  • Plus everyone gets new versions of PHP! πŸ”₯

Gimme gimme!

The easiest path to upgrade is to run composer require nativephp/electron in your app. This will grab the latest version of all the key dependencies.

If you bump into any problems, please raise an issue - but please: check to see if the same issue has already been reported!

Windows support

With nativephp/electron v0.6.0 (and a minor fix in nativephp/electron v0.6.1), plus the changes in nativephp/php-bin v0.4.0, Windows support has finally arrived.

I know many of you have been patiently waiting for this. Over the months, we've racked up quite a few issues as folks have attempted to find some way to get Windows builds working.

I totally get this enthusiasm, Windows support was always on the cards, but we stated early on that Windows support was going to take a while longer for one main reason: a lack of static builds of PHP for Windows with enough extensions baked in to support booting a Laravel application.

Believe me, this wasn't by choice. If we could have launched NativePHP with Windows support, we would have.

Why did it take so long? This is just something that no one has tackled before, until now. And it's not a particularly easy problem to solve.

I don't know if I'm more excited that we have Windows builds or that I was able to go through over half the open tickets and give people some good news.

It's largely thanks to @crazywhalecc and a flock of contributors who have all been working hard on the awesome static-php-cli project. Their efforts have really paid off. Please go and show them some support!

With that project making the 'building PHP' part easy, I was able to shift attention to making builds of your Electron apps work on Windows. This required some patching and fixing up and a lot of testing, but builds are working reliably enough for the alpha for me to be happy to try and move onto the next thing.

It did also push me to work through many of the tickets and PRs and I finally feel like I'm getting on top of that now.

Thanks for your patience everyone 😊

PHP versions aplenty

The other important piece here is wider support for multiple versions of PHP. This has become increasingly important as more and more of you are moving up from PHP 8.1.

Importantly, this enables full Laravel 11 support as you can now use PHP 8.2 or 8.3 to develop your applications.

I want NativePHP to make building distributable, desktop-calibre software using PHP a breeze, but there will always be some complexity here.

You see, the version of PHP you use to develop your application is the version that you should ship with your application. If they're not the same, you will get warnings from Composer and potential bugs in your application.

The good news is that you now have complete choice between PHP 8.1, 8.2 and 8.3 and you don't need to configure anything to make it work; whatever minor version of PHP you develop with, NativePHP will bundle that same minor version when building your apps.

So if you're building an app on your computer with PHP 8.3.3, NativePHP will select the PHP 8.3 binaries (currently on 8.3.6) to ship when building your app.

Updates to the NativePHP binaries will also happen more regularly.

A note on php-bin

The php-bin package houses the "official" builds of PHP that NativePHP supports. If you choose to build your own statically-compiled versions of PHP to ship with your apps and need a hand, you will need to pay for support.

The php-bin repo will not be accepting PRs containing PHP binaries. This is out of precaution for the safety of our ecosystem, as we don't have the time and resources to verify the safety and authenticity of such third-party builds.

As we start to move throught the final stages of the alpha towards the beta and general availability stages of NativePHP, we'll also be doing more work to help you verify the safety of the builds we provide. This will be for your benefit and that of your users.

Long term, I don't think we'll be shipping the PHP binaries via this Composer package, as with at least 12 different binaries now bundled in, this one package is becoming a bit of a beast: even zipped, it'll consume over 80MBs of disk space on each app in development.

Of course, when you build your app for distribution only a single one of these binaries is ever embedded inside. Unzipped, they're approx. 25MBs each.

During these early phases of NativePHP's life, this package will suffice, but I expect we'll need to move on from it at some point.

Super sponsors

While you're here, I want to take this opportunity to say another massive thanks to our sponsors. You've enabled me to spend this time bringing these advancements to everyone. πŸ™

But there's still a long long way to go. As I said back in January, I'm determined that we get NativePHP into a production-ready state in 2024. While I'm a little bit behind on my rather ambitious "next few weeks" for some of the things mentioned there, I believe we still have plenty of time.

Can you help bring NativePHP to life a little sooner? Please consider sponsoring - it doesn't need to be monthly!

And if you need consultancy or just want some faster support, my sponsorship tiers are a great way for you to get some hands-on help from one of the maintainers of NativePHP!


Thanks for coming along for the ride. Please give the latest version of NativePHP a go and report any issues you find.

Once the dust has settled on this release, I will be firing up Tauri again and should start to have some updates for sponsors to try out very soon.

Β‘Vamos!

{
"by": "simonhamp",
"descendants": 0,
"id": 40225430,
"score": 4,
"time": 1714580590,
"title": "Show HN: NativePHP Now Supports Windows",
"type": "story",
"url": "https://github.com/orgs/NativePHP/discussions/278"
}
{
"author": "simonhamp",
"date": "2024-05-01T12:00:00.000Z",
"description": "Following on from #271, I’m thrilled to be able to announce that... NativePHP now supports Windows! πŸͺŸ And, Windows builds are working πŸ‘·πŸ½β€β™€οΈ Plus everyone gets new versions of PHP! πŸ”₯ Gimme gimme! Th…",
"image": "https://opengraph.githubassets.com/6d5049cbedb492a7d24f51d4d894cf8e25d9d063a77f5daf733c6a1fdb1d7735/orgs/NativePHP/discussions/278",
"logo": "https://logo.clearbit.com/github.com",
"publisher": "GitHub",
"title": "Windows builds are here! πŸ”₯ Β· NativePHP Β· Discussion #278",
"url": "https://github.com/orgs/NativePHP/discussions/278"
}
{
"url": "https://github.com/orgs/NativePHP/discussions/278",
"title": "Windows builds are here! πŸ”₯ Β· NativePHP Β· Discussion #278",
"description": "Following on from #271, I'm thrilled to be able to announce that... NativePHP now supports Windows! πŸͺŸ And, Windows builds are working πŸ‘·πŸ½β€β™€οΈ Plus everyone gets new versions of PHP! πŸ”₯ Gimme gimme! Th...",
"links": [
"https://github.com/orgs/NativePHP/discussions/278"
],
"image": "https://opengraph.githubassets.com/6d5049cbedb492a7d24f51d4d894cf8e25d9d063a77f5daf733c6a1fdb1d7735/orgs/NativePHP/discussions/278",
"content": "<div>\n <tbody>\n <tr>\n <td>\n <p>Following on from <a target=\"_blank\" href=\"https://github.com/orgs/NativePHP/discussions/271\">#271</a>, I'm thrilled to be able to announce that...</p>\n<ul>\n<li>NativePHP now supports Windows! πŸͺŸ</li>\n<li>And, Windows builds are working πŸ‘·πŸ½β€β™€οΈ</li>\n<li>Plus <em>everyone</em> gets new versions of PHP! πŸ”₯</li>\n</ul>\n<p><a target=\"_blank\" href=\"https://camo.githubusercontent.com/8da5a98debd087f21dca68d4164e8387163c2342be7053346e6247af9bffd885/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f76312e59326c6b505463354d4749334e6a45784d473930596d6c6d4f58637959336c6e593341355a47566c646a5a72627a46734d325a3264475270626e4d77616e707a4e57353165435a6c634431324d563970626e526c636d35686246396e61575a66596e6c666157516d593351395a772f5730426a64726d476a593261444c794275772f67697068792d646f776e73697a65642e676966\"><img src=\"https://camo.githubusercontent.com/8da5a98debd087f21dca68d4164e8387163c2342be7053346e6247af9bffd885/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f76312e59326c6b505463354d4749334e6a45784d473930596d6c6d4f58637959336c6e593341355a47566c646a5a72627a46734d325a3264475270626e4d77616e707a4e57353165435a6c634431324d563970626e526c636d35686246396e61575a66596e6c666157516d593351395a772f5730426a64726d476a593261444c794275772f67697068792d646f776e73697a65642e676966\" /></a></p>\n<h2>Gimme gimme!</h2>\n<p>The easiest path to upgrade is to run <code>composer require nativephp/electron</code> in your app. This will grab the latest version of all the key dependencies.</p>\n<p>If you bump into any problems, <a target=\"_blank\" href=\"https://github.com/nativephp/laravel/issues\">please raise an issue</a> - but please: <strong>check to see if the same issue has already been reported!</strong></p>\n<h2>Windows support</h2>\n<p>With <a target=\"_blank\" href=\"https://github.com/NativePHP/electron/releases/tag/0.6.0\"><code>nativephp/electron</code> v0.6.0</a> (and a minor fix in <a target=\"_blank\" href=\"https://github.com/NativePHP/electron/releases/tag/0.6.1\"><code>nativephp/electron</code> v0.6.1</a>), plus the changes in <a target=\"_blank\" href=\"https://github.com/NativePHP/php-bin/releases/tag/0.4.0\"><code>nativephp/php-bin</code> v0.4.0</a>, Windows support has <em>finally</em> arrived.</p>\n<p>I know many of you have been patiently waiting for this. Over the months, we've racked up quite a few issues as folks have attempted to find some way to get Windows builds working.</p>\n<p>I totally get this enthusiasm, Windows support was always on the cards, but we stated early on that Windows support was going to take a while longer for one main reason: a lack of static builds of PHP for Windows with enough extensions baked in to support booting a Laravel application.</p>\n<p>Believe me, this wasn't by choice. If we could have launched NativePHP with Windows support, we would have.</p>\n<p>Why did it take so long? This is just something that no one has tackled before, until now. And it's not a particularly easy problem to solve.</p>\n<p>I don't know if I'm more excited that we have Windows builds or that I was able to go through over half the open tickets and give people some good news.</p>\n<p>It's largely thanks to <a target=\"_blank\" href=\"https://github.com/crazywhalecc\">@crazywhalecc</a> and a flock of contributors who have all been working hard on the awesome <a target=\"_blank\" href=\"https://github.com/crazywhalecc/static-php-cli\"><code>static-php-cli</code></a> project. <a target=\"_blank\" href=\"https://github.com/crazywhalecc/static-php-cli/pulls?q=is%3Apr+label%3Aos%2Fwindows+is%3Aclosed\">Their efforts</a> have really paid off. Please go and show them some support!</p>\n<p>With that project making the 'building PHP' part easy, I was able to shift attention to making builds of your Electron apps work on Windows. This required some patching and fixing up and <em>a lot</em> of testing, but builds are working reliably enough for the alpha for me to be happy to try and move onto the next thing.</p>\n<p>It did also push me to work through many of the tickets and PRs and I finally feel like I'm getting on top of that now.</p>\n<p>Thanks for your patience everyone 😊</p>\n<h2>PHP versions aplenty</h2>\n<p>The other important piece here is wider support for multiple versions of PHP. This has become increasingly important as more and more of you are moving up from PHP 8.1.</p>\n<p><strong>Importantly, this enables full Laravel 11 support as you can now use PHP 8.2 or 8.3 to develop your applications.</strong></p>\n<p>I want NativePHP to make building distributable, desktop-calibre software using PHP a breeze, but there will always be some complexity here.</p>\n<p>You see, the version of PHP you use to <em>develop</em> your application is the version that you should <em>ship</em> with your application. If they're not the same, you will get warnings from Composer and potential bugs in your application.</p>\n<p>The good news is that you now have complete choice between PHP 8.1, 8.2 and 8.3 and <strong>you don't need to configure anything to make it work</strong>; whatever <em>minor</em> version of PHP you develop with, NativePHP will bundle that same minor version when building your apps.</p>\n<p>So if you're building an app on your computer with PHP 8.3.3, NativePHP will select the PHP 8.3 binaries (currently on 8.3.6) to ship when building your app.</p>\n<p>Updates to the NativePHP binaries will also happen more regularly.</p>\n<h3>A note on <code>php-bin</code></h3>\n<p>The <a target=\"_blank\" href=\"https://github.com/NativePHP/php-bin\"><code>php-bin</code></a> package houses the \"official\" builds of PHP that NativePHP supports. If you choose to build your own statically-compiled versions of PHP to ship with your apps and need a hand, you will need to pay for support.</p>\n<p><strong>The <code>php-bin</code> repo will not be accepting PRs containing PHP binaries.</strong> This is out of precaution for the safety of our ecosystem, as we don't have the time and resources to verify the safety and authenticity of such third-party builds.</p>\n<p>As we start to move throught the final stages of the alpha towards the beta and general availability stages of NativePHP, we'll also be doing more work to help you verify the safety of the builds <em>we</em> provide. This will be for your benefit and that of your users.</p>\n<p>Long term, I don't think we'll be shipping the PHP binaries via this Composer package, as with at least 12 different binaries now bundled in, this one package is becoming a bit of a beast: even zipped, it'll consume over 80MBs of disk space on <em>each</em> app in development.</p>\n<p>Of course, when you build your app for distribution only a single one of these binaries is ever embedded inside. Unzipped, they're approx. 25MBs each.</p>\n<p>During these early phases of NativePHP's life, this package will suffice, but I expect we'll need to move on from it at some point.</p>\n<h2>Super sponsors</h2>\n<p>While you're here, I want to take this opportunity to say another massive thanks to <a target=\"_blank\" href=\"https://github.com/sponsors/simonhamp\">our sponsors</a>. You've enabled me to spend this time bringing these advancements to everyone. πŸ™</p>\n<p>But there's still a long long way to go. <a target=\"_blank\" href=\"https://github.com/orgs/NativePHP/discussions/248\">As I said back in January</a>, I'm determined that we get NativePHP into a production-ready state in 2024. While I'm a little bit behind on my rather ambitious \"next few weeks\" for some of the things mentioned there, I believe we still have plenty of time.</p>\n<p>Can you help bring NativePHP to life a little sooner? Please consider <a target=\"_blank\" href=\"https://github.com/sponsors/simonhamp\">sponsoring</a> - <strong>it doesn't need to be monthly!</strong></p>\n<p>And if you need consultancy or just want some faster support, my sponsorship tiers are a great way for you to get some hands-on help from one of the maintainers of NativePHP!</p>\n<hr />\n<p>Thanks for coming along for the ride. Please give the latest version of NativePHP a go and report any issues you find.</p>\n<p>Once the dust has settled on this release, I will be firing up Tauri again and should start to have some updates for sponsors to try out very soon.</p>\n<p>Β‘Vamos!</p>\n </td>\n </tr>\n </tbody>\n </div>",
"author": "",
"favicon": "https://github.githubassets.com/favicons/favicon.svg",
"source": "github.com",
"published": "",
"ttr": 202,
"type": "object"
}