Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Call to undefined function Illuminate\\Encryption\\openssl_cipher_iv_length()

I am trying to send AJAX with jQuery but I get:

test.ERROR: Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length() {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length() at C:\inetpub\my-site\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:214)

I checked with phpinfo() and openssl shows there and enabled. the extension dll file exists in php/ext

I tried restarting the server.

I can't run composer comands (so will need to try do it manually if it can solve the issue)

This is how my AJAX look like (works on local dev pc):

        var jqxhr = $.ajax({
            method: "POST",
            url: "/my-site/post-url",
            data: data
        })
            .done(function (data) {
				alert('Success');
            })
            .fail(function () {
				 alert('Error');
            });

What could cause that?

0 likes
10 replies
Ligonsker's avatar

@Sinnbeck I saw this post but I am using IIS so it's different and we didn't update to php8. so I am not sure where it comes from

Sinnbeck's avatar

@Ligonsker Ah thats quite an important thing to tell. Very few use IIS to run php, so you will need to wait for someone that does or have knowledge about it,

1 like
Ligonsker's avatar

@Sinnbeck thanks, I edited my answer because I did find the actual php.ini in the specified location after all :/

and it does show that it has the openssl extension.

Could the issue be namespace related inside Laravel? Or you think it looks more related to the server configuration itself?

Sinnbeck's avatar

@Ligonsker Server configuration. It is down to it not being able to find some part of the openssl php module

1 like
Ligonsker's avatar

@sinnbeck if it matters, this error only shows up when sending the request from jQuerty ajax. When I use the same URL to submit via a regular HTML form, it work :/

Sinnbeck's avatar

@Ligonsker And the path is correct ? C:\inetpub\my-site

Do you see any difference in the url in the browser dev tools ? Like with or without www

1 like
Ligonsker's avatar

@sinnbeck yep the path seem to be correct

Edit: Even when I type:

echo openssl_cipher_iv_length('AES-128-CBC');

it outputs 16 and works

Sinnbeck's avatar

@Ligonsker Even if you call it from ajax ?

And

Do you see any difference in the url in the browser dev tools ? Like with or without www

Ligonsker's avatar

@Sinnbeck The difference was that one was PUT and one was POST, but I could swear I checked it multiple times that it's the same already.

Now the method in web.php is put, and the ajax is post and it works. So they don't match but that's the only combination it currently works (At least this way both the blade form and the ajax show the same method)

I hope that was the issue and not some random server issue.

Thank you!

Please or to participate in this conversation.