WebSite X5Help Center

 
Axel  
Axel  
User

Generic Error with e-Commerce by pressing buy button  fr

Author: Axel  
Visited 1622, Followers 1, Shared 0  

Hello Stefano,

On my localhost, I got this error this morning... But before not ????

Just when I click buy now into the cart.

I am running PHP 7.2.7

I have activated logs on my local web server and I got these lines into Apache error.logs

[Tue Aug 04 15:54:49.558865 2020] [php7:notice] [pid 12384:tid 1156] [client ::1:62287] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in E:\\uwamp\\www\\wsx5plugins\\res\\x5engine.php:6904\nStack trace:\n#0 E:\\uwamp\\www\\wsx5plugins\\cart\\x5cart.php(90): Notifier->sendNotification('ECOMMERCE_ORDER', '{ "orderNumber"...')\n#1 {main}\n thrown in E:\\uwamp\\www\\wsx5plugins\\res\\x5engine.php on line 6904, referer: http://localhost/wsx5plugins/cart/index.html
[Tue Aug 04 15:55:19.421554 2020] [php7:notice] [pid 12384:tid 1140] [client ::1:62323] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in E:\\uwamp\\www\\wsx5plugins\\res\\x5engine.php:6904\nStack trace:\n#0 E:\\uwamp\\www\\wsx5plugins\\cart\\x5cart.php(90): Notifier->sendNotification('ECOMMERCE_ORDER', '{ "orderNumber"...')\n#1 {main}\n thrown in E:\\uwamp\\www\\wsx5plugins\\res\\x5engine.php on line 6904, referer: http://localhost/wsx5plugins/cart/index.html
[Tue Aug 04 15:57:12.686770 2020] [php7:notice] [pid 12384:tid 1156] [client ::1:62410] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in E:\\uwamp\\www\\wsx5plugins\\res\\x5engine.php:6904\nStack trace:\n#0 E:\\uwamp\\www\\wsx5plugins\\cart\\x5cart.php(90): Notifier->sendNotification('ECOMMERCE_ORDER', '{ "orderNumber"...')\n#1 {main}\n thrown in E:\\uwamp\\www\\wsx5plugins\\res\\x5engine.php on line 6904, referer: http://localhost/wsx5plugins/cart/index.html

Into x5engine.php lin 6904 I have :

public function sendNotification($type, $extra)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->serverUrl . "notify");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Key: " . $this->signUrl("notify")));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // To avoid echoing the response
curl_setopt($ch, CURLOPT_POSTFIELDS, array(

My PHP config has not been changed since this morning when the error was not ????

And curl is activated..

Same issue into http or https

Idea about this error which is often a forum subject.

Axel

Posted on the
8 ANSWERS - 1 USEFUL
Axel  
Axel  
User
Author

Probably because cur.dll is not loaded ???

saw into the logs before the errors with the cart 

PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: E:/uwamp/bin/php/php-7.2.7/ext\\curl (Le module sp\xef\xbf\xbdcifi\xef\xbf\xbd est introuvable.), E:/uwamp/bin/php/php-7.2.7/ext\\php_curl.dll (La proc\xef\xbf\xbddure sp\xef\xbf\xbdcifi\xef\xbf\xbde est introuvable.)) in Unknown on line 0

idea ?

Read more
Posted on the from Axel  
Axel  
Axel  
User
Author

I have commented the code into res/x5engine.php like below

public function sendNotification($type, $extra)
{
/*
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->serverUrl . "notify");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Key: " . $this->signUrl("notify")));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // To avoid echoing the response
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"url" => $this->siteUrl,
"type" => $type,
"title" => $this->siteTitle,
"image" => $this->siteImage,
"extra" => $extra
));
curl_exec($ch);
curl_close($ch);
*/
}

And the error disappears.

What the role of this function ? notification to the server... to do what ?

Axel

Read more
Posted on the from Axel  
Incomedia
Stefano G.
Incomedia

Hello Axel

Unfortunately, I cannot specify exactly what that part of the code is for, but the issue is definitely with the CURL module.

Something probably isn't working right on the server and the curl extension cannot be loaded properly. This is the first time this error has been reported, so I strongly believe it has to be due to some kind of curl configuration error on the server.

Please double-check this with your hosting's support and let me know if they can fix this

Thank you

Stefano

Read more
Posted on the from Stefano G.
Axel  
Axel  
User
Author

Hello,

thanks Stefano, not really useful undecided

Does anyone knows why this fuc... curl library cannot be loaded ?

Saw to internet may be an issue with libeay32.dll and ssleay32.dll dependences. These 2 files are not into my PHP directory. 

Does anyone has these 2 files into your php 7.2.7 directory... can you share them please ...

Read more
Posted on the from Axel  
Axel  
Axel  
User
Author

Merci Jacques

Read more
Posted on the from Axel  
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Best User of the month ESBest User of the month PT

(It > Fr) ... au moins, vous devez faire une comparaison en exportant vers le réseau; ... si ça marche sur le net, alors ce n'est pas un problème avec le programme ...
... vous devez savoir comment configurer correctement votre serveur local ...

ciao

.

Read more
Posted on the from  ‪ KolAsim ‪ ‪
Axel  
Axel  
User
Author

Hey KolAsim,

It's not really an issue with the software... but with PHP librairies. I have identified the issue but I am not a PHP installation Guru ....

So I repeat my question because the issue seems about these 2 dll not present into my installation.

Does anyone has these 2 files into your php 7.2.7 directory... can you share them please ...

Axel

Read more
Posted on the from Axel