-1
I am using the pagseguro API to make purchases on my site, it was working very well, normally. Today when I went to use again began to present this error:
Not Found
The requested URL /admin/usuario/
Fatal error: Uncaught exception 'Exception' with message 'CURL can't connect: Protocol https not supported or disabled in libcurl' in /home/onecom/public_html/admin/PagSeguroLibrary/utils/PagSeguroHttpConnection.class.php:120Stack trace: was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
My configured Token and email are correct, but I don’t know what it can be. The code I’m using:
<?php
require_once "../PagSeguroLibrary/PagSeguroLibrary.php";
class CreatePaymentRequest
{
public static function main()
{
$paymentRequest = new PagSeguroPaymentRequest();
$paymentRequest->setCurrency("BRL");
$paymentRequest->addItem('0001', 'notebook', 2, 430.00);
$paymentRequest->addItem('0002', 'notebook 2', 2, 560.00);
$paymentRequest->setReference("REF123");
$paymentRequest->setRedirectUrl("http://www.lojamodelo.com.br");
try {
$credentials = new PagSeguroAccountCredentials("[email protected]","MEU-TOKEN");
$url = $paymentRequest->register($credentials);
self::printPaymentUrl($url);
} catch (PagSeguroServiceException $e) {
die($e->getMessage());
}
}
public static function printPaymentUrl($url)
{
if ($url) {
echo "<h2>Criando requisição de pagamento</h2>";
echo "<p>URL do pagamento: <strong>$url</strong></p>";
echo "<p><a title=\"URL do pagamento\" href=\"$url\">Ir para URL do pagamento.</a></p>";
}
}
}
CreatePaymentRequest::main();
?>
By phpinfo() for me to check if https is enabled? Because on the localhost I put a phpinfo() and on
Registered PHP Streams
appeared HTTPS. Now the web server does not appear– Alisson Acioli
Look in PHP info on your server for something about "Curl support" if you think is why it is installed.
– Marcos Peres
just access your php.ini file that usually sits inside your server’s php folder (yes, you need access to that file) and look for that line: ;Extension=php_curl.dll Now remove the semicolon(;) from the beginning of the line, restart your server and check that it is ok.
– Marcos Peres