Reputation: 5899
I tried to use idn_to_ascii()
function with the pre installed PHP instance of Max OSX 10.9.4 (which is 5.4.24).
I read through lot of Stackoverflow questions and in the most of them they say: intl is precompiled since PHP 5.3 and you don't need an extension and it works out of the box.
But why are the intl functions not available in this PHP instance then? I just get a
Fatal error: Call to undefined function idn_to_ascii() in /path/test.php on line 3
Also I tried it with XAMPP 1.8.3-4 on OSX 10.9 with PHP 5.5.x and I also get
Fatal error: Call to undefined function idn_to_ascii() in /Applications/XAMPP/xamppfiles/htdocs/test.php on line 3
Is this a problem with OSX or are there problems with both instances of PHP?
Upvotes: 1
Views: 1273
Reputation: 12276
I had the same issue on my servers. Unlike the proposed solution here, I had PHP version 7. So I had to install the corresponding intl packages:
For PHP 7.1:
sudo apt-get install php7.1-intl
For PHP 7.0
sudo apt-get install php7.0-intl
Upvotes: 0
Reputation: 1272
The problem also occures on Debian 7.9 too and you can install php5-intl package with apt-get to solve it.
Upvotes: 0
Reputation: 522402
intl is bundled with the PHP source code, but must be enabled using the --enable-intl
compile-time option. This is apparently not the case for those two PHP installations. You can check using php -i | grep intl
. You'll probably have to go with the PECL installation method. Alternatively I'd recommend maintaining your own flexible PHP installation with homebrew's homebrew-php tap.
Upvotes: 1