Support the ongoing development of Laravel.io →
Database

Can somebody help me to solve this problem ! When I try to access data from a web service using curl json, I got this error !

  • mcrypt_encrypt(): Key of size 51 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported -

To solve this error, what should I do ! Didn't work php artisan key:generate

this is my code snippet I used to retrieve data !

  • public function getallItems() { $url = "http://localhost/WebService/public/category/getcategories"; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $url); //curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_TIMEOUT,3); $response = curl_exec($ch); curl_close($ch); echo $response;

    }

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.