I installed WAMP on my local machine. My PHP version is 5.3.3 in phpinfo()
but that extension doesn't exist! :(
How can I install this extension without compiling it? Here is just source of it.
I installed WAMP on my local machine. My PHP version is 5.3.3 in phpinfo()
but that extension doesn't exist! :(
How can I install this extension without compiling it? Here is just source of it.
The extension was there! All you need to do is clearing the comment(;) before this line in php.ini
file:
;extension=php_intl.dll
to
extension=php_intl.dll
;extension=intl
to
extension=intl
Then restart apache2 or php-fpm if you are using it.
If it does not work, then you probably need to change it in the php.ini of the CLI version. First check your version with php --version
though, so that you change the right php.ini file, it might be different from your php fpm version.
It also might be enough to just install the package e.g. for php 8.2: sudo apt install php8.2-intl
if you see this on Debian / other Linux platforms.
sudo apt-get install php5-intl
- for PHP 5.6
sudo apt-get install php7.0-intl
- PHP 7+
Amazon Linux
sudo yum install php70-intl
After that restart Apache services.
sudo service apache2 restart
restart apache to get the changes.
in wamp or xampp open php.ini
file and find the below line, then remove comment (;
) at first of it:
;extension=php_intl.dll
if you did not find the line, add it in the php.ini
file:
extension=php_intl.dll
It may be because of Apache. Restart Apache by following command
service httpd restart
and try again.
If you added extension=php_intl.dll
in your php.ini
and it didn't work you can copy icu****.dll
files (about five of them) from PHP folder to Apache /bin
folder then restart Apache and try again.
The following command works like a charm:
sudo apt install php8.2-intl
sudo /etc/init.d/apache2 restart
If you are creating a software package for deployment on systems you don't manage, there is an alternative to editing php.ini. You can use the Symfony version of IntlDateFormatter
. With some editing, this can be modified to run in your application.
Note: this solution only makes sense if you cannot edit php.ini (and if necessary copy the ICU files into Apache). Otherwise, the "with some editing" portion of this makes the whole thing more complicated than just enabling intl. Putting this answer here, as this is the earliest question asking about the relevant error.
People who find this useful should upvote this answer to How to use IntlDateFormatter
in Symfony?. That provided an important missing step.
© 2022 - 2024 — McMap. All rights reserved.