# weird issue with php81-intl



## r00ty (Dec 31, 2022)

Greetings,

I install everything from ports

This is what I have:

```
$ pkg info icu php81-intl
icu-72.1,1
php81-intl-8.1.13

$ php -i | grep -i intl
/usr/local/etc/php/ext-20-intl.ini,
intl
intl.default_locale => no value => no value
intl.error_level => 2 => 2
intl.use_exceptions => On => On
PWD => /usr/ports/devel/php81-intl

$ uname -a
FreeBSD rooty.aaa 12.3-RELEASE-p10 FreeBSD 12.3-RELEASE-p10 DREAM  amd64
```

Now, to test php81-intl I use the following

```
<?php
$checker = new Spoofchecker();
echo "works";
?>
```

When I run the script it throws me a weird error

```
$ php -d display_errors=on stan.php

Fatal error: Uncaught IntlException: Spoofchecker::__construct(): spoofchecker: unable to open ICU Spoof Checker in /usr/home/stan/del/stan.php:2
Stack trace:
#0 /usr/home/stan/del/stan.php(2): Spoofchecker->__construct()
#1 {main}

Next IntlException: spoofchecker: unable to open ICU Spoof Checker in /usr/home/stan/del/stan.php:2
Stack trace:
#0 /usr/home/stan/del/stan.php(2): Spoofchecker->__construct()
#1 {main}
  thrown in /usr/home/stan/del/stan.php on line 2
```

This is somehow related to the ports, I can't just figure out yet

Will appreciate any help


----------



## r00ty (Dec 31, 2022)

so far what I've found is I have

```
ICU Unicode version => 15.0
```
while on some Linux machines where it works (no errors) it's

```
ICU Unicode version => 14.0
```

So I'm wondering if *php81-intl* is not actually compatible with *15.0* but there's no dependency restriction defined in the ports so that's why it's broken


----------



## r00ty (Jan 1, 2023)

I was able to pinpoint this issue.
This is related to commit dfe25d73e7fdd333c59008a4ec1859c7f93dacd6 . I'm not sure if this is really related to ICU Unicode version, tho after reverting to commit fb16dfecae4a6efac9f3a78e0b759fb7a3c53de4 (the previous version of ICU package: "icu-71.1,1") installing the old package and recompiling every dependency - everything works again just fine. 
Now please note there's a lot of stuff using ICU. For my production system, the most critical daemons related to this are syslog-ng and postfix. I have no idea if this is broken for the packages as well. I can't confirm right now, didn't have time to check, but I feel like my python crashes once a day because of this issue. I am wondering if this bug affects more broad field of components.


----------



## CyberCr33p (Jan 1, 2023)

I test your code with PHP 8.1 and it shows "works".


----------



## r00ty (Jan 1, 2023)

CyberCr33p said:


> I test your code with PHP 8.1 and it shows "works".


Do you mind to copy-paste output for pkg info icu ? Also please confirm you installed it from ports


----------



## CyberCr33p (Jan 1, 2023)

```
pkg info icu php81-intl
icu-72.1,1
php81-intl-8.1.13

php -i | grep -i intl
/usr/local/etc/php/ext-20-intl.ini,
intl
intl.default_locale => no value => no value
intl.error_level => 0 => 0
intl.use_exceptions => Off => Off
```


----------



## r00ty (Jan 1, 2023)

CyberCr33p said:


> ```
> pkg info icu php81-intl
> icu-72.1,1
> php81-intl-8.1.13
> ...


Hmmmmm
php -i | grep -i icu ?


----------



## CyberCr33p (Jan 1, 2023)

```
php -i | grep -i icu
ICU version => 72.1
ICU Data version => 72.1
ICU Unicode version => 15.0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```


----------



## CyberCr33p (Jan 1, 2023)

Maybe rebuilding all ports that depend on icu helps?

`portmaster --no-confirm -f -D icu`


----------



## r00ty (Jan 1, 2023)

CyberCr33p said:


> Maybe rebuilding all ports that depend on icu helps?
> 
> `portmaster --no-confirm -f -D icu`


This was my first step when I got the issue. In fact I did it twice. Let me play with it more


----------

