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

ukp890's avatar

php 8.1.17, laravel 10, nginx - Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length()

I am using php 8.1.17, laravel 10, and nginx 1.24 for web application, while accessing my application from browser i am getting error

"Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length()" At php.ini openssl is already enabled, below is my nginx configuration :

server { listen 8282 ssl; #server_name localhost; server_name abc.example.com:8282; client_max_body_size 11M; #more_clear_headers Server; server_tokens off;

    ssl_certificate      example_com.crt;
    ssl_certificate_key  private-key2022.key;

    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;
    
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;
    
    error_page 404 /html/404.html;
    location = /404.html {
    root /nginx-1.24.0/html;
    internal;
    }
    
    error_page 405 500 502 503 504 /500.html;
    location = /500.html {
    root /nginx-1.24.0/html;
    internal;
    }
    
    root "E:/project/public";
    index index.php;
    
    if ($request_method ~ ^(OPTIONS|HEAD)$ )
    {
        return 405;
    }
    
    location / {
    
    try_files $uri $uri/ /index.php$is_args$args;
    }
    
    location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param SCRIPT_NAME     $fastcgi_script_name;
    include fastcgi_params;
}
}

In my config/app.php, 'cipher' => 'AES-256-CBC',i used following command

php artisan key:generate

and browse my application still get :

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

In my config/app.php, i changed 'cipher' => 'AES-256-CBC' to 'AES-128-CBC' and run command

php artisan key:generate

Then i browse my application, this time error change to :

"Unsupported cipher or incorrect key length. Supported ciphers are: aes-128-cbc, aes-256-cbc, aes-128-gcm, aes-256-gcm."

Error screenshot below : https://i.stack.imgur.com/5fuua.png

nothing helps, can anyone help to solve this issue ?

0 likes
0 replies

Please or to participate in this conversation.