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


#1

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?


#2

Which PHP version are you using on the server?


#3

This is the PHP Version 7.1.10


#4

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.


#5

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


#6

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.


#7

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?

#8

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.


#9

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.


#10

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


#11

I tested with 2.5.5 and everything seems to work fine.


#12

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

I will keep the older version for now.

Danke @texnixe


#13

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?


#14

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.


#15

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

Where can I download older Kirby versions from?


#16

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.


#17

Ok, Kirby 2.5.6 also works fine in my case.


#18

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.


#19

Strato uses the PHP version 7.1.10


#20

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.