Error: idn_to_ascii() expects at most 2 parameters, 3 given

I created a multilanguage site and when I upload it to the remote server I get this error:

Whoops \ Exception \ ErrorException (E_WARNING)
idn_to_ascii() expects at most 2 parameters, 3 given

If I deactivate the automatic language detection, it works fine on live.

Any idea on how to fix it?

Which PHP version are you using on the server?

This is the PHP Version 7.1.10

I’m getting the same error when I try to send a contact form.

And I can’t get the panel, when I write mydomain/panel the url change to https://panel/login.

What Kirby version is that? And the error only appears on the remote server, not on localhost?

Yes, on localhost works fine and I’m using Kirby 2.5.7.

I have uploaded langkit to the same remote server to test and I didn’t get the error.

Hm, I have no idea.

  • do you use a second config.php for the remote server? If so, is there anything in there that might be causing this?
  • maybe related to use of https on the remote host? Not forcing https properly?

That error message can only really be caused by an outdated version of the PHP intl extension. But if you are really using PHP 7.1, this can’t be the case. Also strange that it doesn’t happen with the langkit.

Ok @texnixe, if I force SSL and deactivate language detection, the error doesn’t appear, excepting when I send the contact form.

The strange thing is that is not necessary to do it with langkit on the same server. It seems as something is not fine in my code but I don’t find it.

Moreover, I can’t access the panel, both with my site and langkit, it redirects me to https://panel/login. It’s the first time I see this problem.

Do you get the same issue with a prior Kirby version, like 2.5.6 or 2.5.5?

I tested with 2.5.5 and everything seems to work fine.

This is what has kept me entertained most of the day.

I will keep the older version for now.

Danke @texnixe

2 Likes

The problem is that without knowing what might be causing this issue it might not get fixed. Have you tried or could you try with version 2.5.6 as well?

Also, what plugins are you using?

Hello, I discovered the same error when I updated from 2.5.6 to 2.5.7. The PHP version at our webhoster Strato is set to 7 but at the moment I don’t know which version is exactly used.
In version 2.5.6 the error doesn’t appear.

I also use Strato as web hosting. And Kirby Uniform plugin.

Where can I download older Kirby versions from?

You can download particular releases on GitHub:

Kirby: https://github.com/getkirby/kirby/releases
Panel: https://github.com/getkirby/panel/releases

Or download a Starterkit release: https://github.com/getkirby/starterkit/releases

If you are using Git, you can check out a particular release using the -b (–branch) option.

Ok, Kirby 2.5.6 also works fine in my case.

Ok, then we have at least narrowed it down to a version :slightly_smiling_face:

You can check which PHP version is actually used by putting a file with

phpinfo();

into your webroot.

Strato uses the PHP version 7.1.10

According to the error message, this last fix, which introduced use of the third parameter, now causes this issue. I don’t quite get it though, because as far as I can see, the third (and fourth) parameters were introduced in PHP 5.4 and do not require any PECL extensions.