PHP Amazon webservice uncaught curl exception - php

I am trying to make a website to manage some files and links through amazon web service. I am new to this service and are having some problems at the moment. I am trying to setup my environment, but after reassuring all extension are enabled on my web server (curl, and all the others from http://aws.amazon.com/articles/4261?_encoding=UTF8&jiveRedirect=1#configurecredentials) I still get an error in my apache error log:
PHP Fatal error: Uncaught exception 'cURL_Exception' with message 'cURL resource: Resource id #10; cURL error: SSL certificate problem, verify that the CA cert is OK. Details:\nerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (cURL error code 60). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes.' in C:\\www\\thorastrup\\client_app\\sdk-1.5.14\\lib\\requestcore\\requestcore.class.php:829\nStack trace:\n#0 C:\\www\\thorastrup\\client_app\\sdk-1.5.14\\services\\s3.class.php(910): RequestCore->send_request()\n#1 C:\\www\\thorastrup\\client_app\\sdk-1.5.14\\services\\s3.class.php(1147): AmazonS3->authenticate('php-sdk-getting...', Array)\n#2 C:\\www\\thorastrup\\client_app\\sdk-1.5.14\\_samples\\cli-s3_get_urls_for_uploads.php(60): AmazonS3->create_bucket('php-sdk-getting...', 's3-us-west-1.am...')\n#3 {main}\n thrown in C:\\www\\thorastrup\\client_app\\sdk-1.5.14\\lib\\requestcore\\requestcore.class.php on line 829
I simply don't understand this error and would be glad if anyone could tell me with was wrong? (I am running apache on Windows 7 with php-5)

See http://engin.bzzzt.biz/2012/02/02/windows-php-curl-ssl-certificate-problem/
As for the CA-bundle file, you can follow those instructions or just download it from http://curl.haxx.se/ca/cacert.pem

Related

Unable to Launch Octane RoadRunner Server for PHP 8.0

Octane is installed with roadrunner while following the official guide, on the Ubuntu 18.04 server. Each step works as expected until the server is started:
php artisan octane:start --server=roadrunner --port=8181
Then, an error is received and the command exits. The complete stacktrace is attached:
INFO Server running…
Local: http://127.0.0.1:8181
Press Ctrl+C to stop the server
INFO [INFO] RoadRunner server started; version: 2.6.3, buildtime: 2021-12-03T11:37:00+0000
PHP Warning: require(/path/vendor/bin/bootstrap.php): Failed to open stream: No such file or directory in /path/vendor/bin/roadrunner-worker on line 18
PHP Fatal error: Uncaught Error: Failed opening required '/path/vendor/bin/bootstrap.php' (include_path='.:/usr/share/php') in /path/vendor/bin/roadrunner-worker:18
Stack trace:
#0 {main}
thrown in /path/vendor/bin/roadrunner-worker on line 18
INFO error occurred: WorkerAllocate:
INFO goridge_frame_receive: EOF, plugin: http.Plugin
ERROR 2021-12-07T12:01:53.048Z ERROR container/poller.go:16 vertex got an error {"id": "http.Plugin", "error": "WorkerAllocate:\n\tgoridge_frame_receive: EOF"}
ERROR github.com/spiral/endure/pkg/container.(*Endure).poll.func1
ERROR github.com/spiral/endure#v1.0.10/pkg/container/poller.go:16
ERROR handle_serve_command: WorkerAllocate:
ERROR goridge_frame_receive: EOF
Since roadrunner is based on go, I don't have much insights on how to navigate through the error. Please let me know if anyone has solved this issue before, thanks.
You should fix all warnings like this one: PHP Warning: require(/path/vendor/bin/bootstrap.php): Failed to open stream: No such file or directory in /path/vendor/bin/roadrunner-worker on line 18
These warnings appear in the stdout, but stdout is used as a process fd to communicate with the RR. That means if some data is sent to the stdout (like PHP warning) before RR initializes all processes (aka worker), RR will stop allocating the workers and exit with code 1.

I can't load a complete url image with Imagick (error ssl)

I have several sites on a debian 8 with php 5.6 that load external photos using the Imagick library
I have this error that appeared today when i load a photo whith
<?php $image = new Imagick('https://monsite.com') ?>
PHP Fatal error: Uncaught exception 'ImagickException' with message 'Imagick::__construct(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed' in
Thank you in advance for your help

apns not connecting in php

i am new to push notifications and tried following to fix this but it still gives same error.
added C:\PHP\ext to the Windows path
added libeay32.dll and ssleay32.dll to C:\WINDOWS\system32\inetsrv
rebooted the server
first error:-
Fatal error: Uncaught exception 'ApnsPHP_Exception' with message 'Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (0)' in C:\wamp\www\ApnsPHP-master\ApnsPHP\Abstract.php on line 396
second error:-
ApnsPHP_Exception: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (0) in C:\wamp\www\ApnsPHP-master\ApnsPHP\Abstract.php on line 396
i am using a .pem file which was used before somewhere else
and also i am trying to run my file on localhost, does it matter ?
if someone knows something that what should i do to fix this error, then please help me !
and thanx in advance
You should look if SSL is enabled in your configuration.
To display your configuration simply copy/paste the following in some php file and browse to it with a browser:
<?php
phpInfo();
?>

Amazon S3 on wamp localhost SSL error

I'm trying to test in PHP Amazon S3 on my localhost but keep getting the same error:
Fatal error: Uncaught exception 'cURL_Exception' with message 'cURL
resource: Resource id #69; cURL error: SSL certificate problem, verify
that the CA cert is OK. Details: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (cURL
error code 60). See http://curl.haxx.se/libcurl/c/libcurl-errors.html
for an explanation of error codes.' in
C:\wamp\www\mysite\application\libraries\awsphp\lib\requestcore\requestcore.class.php:829
Stack trace: #0
C:\wamp\www\mysite\application\libraries\awsphp\sdk.class.php(1034):
RequestCore->send_request() #1
C:\wamp\www\mysite\application\libraries\awsphp\services\sqs.class.php(250):
CFRuntime->authenticate('ListQueues', Array) #2
C:\wamp\www\mysite\application\libraries\awsphp\services\sqs.class.php(582):
AmazonSQS->authenticate('ListQueues', Array) #3
C:\wamp\www\mysite\application\controllers\uploads.php(33):
AmazonSQS->list_queues() #4 [internal function]: Uploads->aw3() #5
C:\wamp\www\mysite\system\core\CodeIgniter.php(359): call_user_func
in
C:\wamp\www\mysite\application\libraries\awsphp\lib\requestcore\requestcore.class.php
on line 829
Test code:
$sqs = new AmazonSQS();
$response = $sqs->list_queues();
var_dump($response->isOK());
I properly installed the AWS SDK to php files and enabled CURL and SSL on me local server. What can I do to make this work? I can't find any help online. I'm using wamp.
Get this file and save it to your hard drive. Call it cacert.pem.
Configure curl.cainfo in php.ini with the full path to the file downloaded in step 1.
Restart Apache.
I'll leave it as an exercise for the reader to find out why this fixes it, all the information you need can be found in the links above.
Are you running on Windows?
Did you take the time to run the SDK Compatibility Test that comes bundled with the SDK?
According to this post you can't work with Amazon AWS on localhost..

Library conflict with OpenSSL and PHP 5.3.3?

I am trying to implement a PHP SOAP based web service into my web application. I am getting a series of errors which seem to point to a conflict of libraries with regard to OpenSSL (or Curl, etc.), this I have understood by searching the internet for similar errors, but thought a general consensus that libraries are the issue, there is no solution that I can find.
Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: SSL operation failed with code 1. OpenSSL Error messages:
error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message [CORE/vendors/Startrack/WSSecurity.php, line 110]
Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: Failed to enable crypto [CORE/vendors/Startrack/WSSecurity.php, line 110]
Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: connect() failed: Unspecified error [CORE/vendors/Startrack/WSSecurity.php, line 110]
Notice (8): Undefined property: SoapFault::$detail [APP/controllers/startrack_controller.php, line 38]
Notice (8): Trying to get property of non-object [APP/controllers/startrack_controller.php, line 38]
Could not connect to host
This is being served from a Mac OSX Lion server. PHP 5.3.3 is installed, and the extensions for OpenSSL, Curl and SOAP are enabled. This is being built within CakePHP which explains the syntax of the error messages above. I am using a PHP Web Service bundle already provided. The above works when hosted via MAMP, but I am hoping to not have to rely on MAMP.
The only incompatibility I can find is between the OpenSSL headers and library versions, but from what I know this ought not be a problem?
OpenSSL Library Version OpenSSL 0.9.8r 8 Feb 2011
OpenSSL Header Version OpenSSL 0.9.8l 5 Nov 2009
I am trying to understand if the assumed 'conflict' is between my server and the remote server? The WSDL file is included in the Web Service API, as they hope to avoid any issues, and it works through a MAMP install on the same computer. So I think it is a setup issue between Apache/PHP and Curl/OpenSSL.
Any pointers to how to establish the actual issue, and rectify it would be appreciated.
This could be because you are trying to connect with an SSL 3 enabled server, that may (?) have SSL 2 disabled.
Try connecting to the server like this on the command line:
openssl s_client -connect {SERVER NAME OR IP}:443 -state
If that does not work, then try connecting like this:
openssl s_client -ssl3 -connect {SERVER NAME OR IP}:443 -state
If that does work, then try creating a wrapper class, similar to this one found in the PHP documentation.
You should add a line similar to:
curl_setopt($handle, CURLOPT_SSLVERSION, 3);
inside the callCurl function to force SOAP to connect over version three of ssl.

Categories