Add intl
extension
#292
Replies: 17 comments 18 replies
-
Fixed it requiring |
Beta Was this translation helpful? Give feedback.
-
Hi @MarceauKa, could you please elaborate required step to solve this issue? Thank you |
Beta Was this translation helpful? Give feedback.
-
Hi I did a lot of research and this is the closest I got to an solution for this exact problem. Im trying to pack a filamenphp laravel webapp into a desktop programm with the help of nativePHP and I just cant find a way to remove the error „php extension intl not found“ @MarceauKa could you please just quickly tell us in which file (and maybe how) you fixed this? Kind regards |
Beta Was this translation helpful? Give feedback.
-
This is because the I also noticed that it's apparently not available for Windows yet. I will test and see what needs doing to get this in place on the binary side so we don't need to mess around with polyfills. |
Beta Was this translation helpful? Give feedback.
-
Thanks for this quick response! In the meantime I tried to build the php binaries manually with this approach:
I then (Im on MacOS) right clicked the php bin and compressed it to a .zip file and renamed and replaced the supposingly old php bins at But I stillt get the same error. (with Did I miss something when replacing the php binary or is it just not that simple? Kind regards. |
Beta Was this translation helpful? Give feedback.
-
In theory, what you've done is correct... What version of PHP are you running locally? |
Beta Was this translation helpful? Give feedback.
-
maybe I should zip it using a cli tool? |
Beta Was this translation helpful? Give feedback.
-
So the thing to check is if the PHP you've built actually includes So you can check the PHP8.3 binary you generated:
|
Beta Was this translation helpful? Give feedback.
-
I get following (I cant interpret if this is sufficient)
Output:
|
Beta Was this translation helpful? Give feedback.
-
That means intl extension is enabled and working |
Beta Was this translation helpful? Give feedback.
-
It's possible that even after copying it into the vendor folder it gets wiped away Can you also check the version that gets built into the app? |
Beta Was this translation helpful? Give feedback.
-
Im having trouble finding a way to check that - in the developer tools I cant find the php version. Im also unable to build php-8.1. |
Beta Was this translation helpful? Give feedback.
-
There are some instructions in the docs |
Beta Was this translation helpful? Give feedback.
-
I was able to solve this issue 🚀with following steps thanks to the very helpful and kind person @simonhamp - many thanks!! (I will list all above discussed steps again so people stumbeling over it with the same issue have a better overview: DISCLAIMER:
Setup:
Problem:
Cause:the static php binaries currently used by nativePHP dont include this extension (yet) Solution:
How I did this:1. building php binary
2. move php binary to nativePHP
copy the newly built php binary from 3. build with nativePHP
i: Interestingly, it seems like the php binary gets copied from the dev to the prod build at dist so it seems to work. verifying the build worked:checking newly build php bin:
checking after 'php artisan native:build` run
Helpful link to debug nativePHP related stuff: https://nativephp.com/docs/1/getting-started/debugging#check-your-app-and-php |
Beta Was this translation helpful? Give feedback.
-
I was excited to discover this tool, but the PHP development experience on Windows is far from ideal. It's not just the "intl" extension that's essential for PHP development—other critical extensions like PCNTL, which is used in Horizon, Octane, and Laravel's concurrency features, are also unavailable on Windows. Unfortunately, I don’t see any support or implementation for these extensions coming anytime soon. |
Beta Was this translation helpful? Give feedback.
-
Workaround to Bypass the Intl Extension Check in Laravel Number Helper (For Windows Users) For anyone facing this issue on Windows, I came up with a (call it "bad but working") way to bypass the intl extension check used in Laravel's Number Helper. This helper was added to Laravel starting from version 10.33.0, so if you are using that version or higher, you might not face this problem. In this temporary workaround, we trick the PHP interpreter into assuming that the intl extension is loaded! This method could potentially harm your application and introduce risks, so use it only if you 100% understand what you're doing. By bypassing this check, you are essentially telling the application that the intl extension is available, even if it isn't, which can lead to unexpected behavior in other parts of the framework or packages that rely on it. Here's how it works: Create an Override for the extension_loaded function: We define a custom version of the extension_loaded function inside the Illuminate\Support namespace, which forces it to always return true when checking for the intl extension. Load the Override Before Laravel's Core: The trick is to load this override file before Laravel’s autoloader. This ensures that whenever the Number Helper (or any other part of Laravel) checks if intl is loaded, our custom function is used. Test Carefully: The Override Code:
Then, in your public/index.php, include this file before Laravel's autoloader:
Final Thoughts:
|
Beta Was this translation helpful? Give feedback.
-
I just saw this comment in the |
Beta Was this translation helpful? Give feedback.
-
This code won't run as expected.
Beta Was this translation helpful? Give feedback.
All reactions