Windows composer install issue - php

I'm trying to install composer via the composer-setup.exe from http://getcomposer.org/download/ and I'm getting the following error:
Connection Error [ERR_CONNECTION]: Unable to connect to getcomposer.org
Request to https://getcomposer.org/installer failed with errors: SSL:
The operation completed successfully. . Send of 25 bytes failed with
errno=10054 An existing connection was forcibly closed by the remote
host. . Send of 23 bytes failed with errno=10054 An existing
connection was forcibly closed by the remote host. . Send of 2 bytes
failed with errno=10054 An existing connection was forcibly closed by
the remote host. . Failed to open stream: HTTP request failed!
I tried disabling my antivirus/firewall but I keep on getting the same error. I searched google but couldn't resolve this. Any help here? Thanks.

Is SSL enabled in the correct php.ini?
If the installation approach via the windows executable fails,
you might switch to just downloading the composer.phar to your PHP dir, e.g. C:\php\composer.phar.
Then add composer.bat file inside the C:\php folder which forwards commands to the PHAR file:
#ECHO OFF
php "%~dp0composer.phar" %*
Also add the path to your php directory (e.g. C:\php) to the Path in your System variables. This result in a global installaton of composer. You can call composer on any project path.

Related

How to configure openssl to work with file_get_contents

We run an apache2 server and want to use google recaptcha due to high volume of bots on our newsletter.
Therefore I implemented some lines of developers php-code which in general should work ... but not on my server.
I investigated further and found that the function file_get_contents() ends with an SSL error.
file_get_contents(self::SITE_VERIFY_URL, false, $context)
Below you can find an extract from the servers log file.
PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in /var/www/html/app/lib/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php on line 68
PHP Warning: file_get_contents(): Failed to enable crypto in /var/www/html/app/lib/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php on line 68
PHP Warning: file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: operation failed in /var/www/html/app/lib/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php on line 68
This brought me to the conclusion that Openssl is misconfigured.
So I:
reinstalled ca-certificates with apt-get purge ca-certificate
Also downloaded the cacert.pem and linked it in the php.ini
checked if curl works properly, but it doesnt (every call of curl ends with curl: (60) SSL certificate problem: unable to get local issuer certificate
checked openssl.cnf which looks ok to me.
Any ideas how to solve this would be great.
So I found the problem:
First I changed the filepath according to the comment by drew010.
Then I fixed issues on my server with file permissions of /etc/ssl/certs according to this post: https://askubuntu.com/a/636979
Now file_get_contents does not invoke any errors and recaptcha runs smoothly.

Installing CodeIgniter 4 on Amazon AWS Cloud 9 server

This question is about CodeIgniter 4, please do not mark my question as already answered with questions related to CodeIgniter 3. Thank you.
I try to make a fresh install of CodeIgniter 4 on an Amazon AWS EC2 Cloud 9 server.
I encountered some problems.
First, I configured the Apache server on port 8080 as explained on this page : https://lucidar.me/en/aws-cloud9/how-to-...d9-server/
The, I install CodeIgniter 4 with composer and configure it following this instructions: https://codeigniter4.github.io/userguide...ith-apache
My first problem is that I do not have a apache2/conf/httpd.conf file. Is it the /etc/apache2/sites-enabled/000-default.conf ? Any way, I think the rewrite module is natively enable on my server.
The Apache server works but not CodeIgniter. I got the following errors:
Warning:
require(/home/ubuntu/environment/app/Config/../../vendor/codeigniter4/framework/system/bootstrap.php):
failed to open stream: No such file or directory in
/home/ubuntu/environment/public/index.php on line 37
Fatal error: require(): Failed opening required
'/home/ubuntu/environment/app/Config/../../vendor/codeigniter4/framework/system/bootstrap.php'
(include_path='.:/usr/share/php') in
/home/ubuntu/environment/public/index.php on line 37
I do not have vendor/codeigniter4/framework/system/bootstrap.php files in the Config folder.
Any idea about what I missed?

Cannot install Composer on Windowsn 10 Pro build 1809: SSL operation failed with code 1

I tried to install Composer on a fresh newly installed Windows 10 Pro build 1809 and I got this error message.
The Composer installer script was not successful [exit code 1].
OpenSSL failed with a 'certificate verify failed' error. This
indicates a problem with the Certificate Authority file(s) on your
system, which may be out of date.
Certificate location [from openssl.cafile ini setting]:
D:\xampp\apache\bin\curl-ca-bundle.crt
The php.ini used by your command-line PHP is: D:\xampp\php\php.ini
Script Output:
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
I've tried to replace the "curl-ca-bundle.crt" with "cacert.pem" from http://curl.haxx.se/ca/cacert or with "ca-bundle.crt" but it's nothing, the error messages still happened.
Can anyone help me to fix this problem?
Finally, I solved this problem. Because my company's blocked something on the network. Then I try to switched to the other network, then It's succuessfully installed!

Composer-setup : Connection Error [ERR_CONNECTION]: Unable to connect to getcomposer.org

We are getting following error while installing composer-setup.exe:
Connection Error [ERR_CONNECTION]: Unable to connect to getcomposer.org
Proxy http://proxy.mycompany.com:1234 [from Internet Settings] failed with errors:
Failed to open stream: HTTP request failed! HTTP/1.0 407 Proxy Authorization Required
Request to http://getcomposer.org/installer failed with errors:
Failed to open stream: No connection could be made because the target machine actively refused it.
My Project Environment details are
Windows 7
Apache v2.2.22
PHP v5.4.3
php.ini:
php_curl enabled
php_openssl enabled
Please help us to installing Composer-Setup.exe for Laravel Framework.
Env
xampp
php 5.6.3
windows 7 64bit
Solution
save ca-bundle.crt to your local path(eg.d:/download/ca-bundle.crt);
double click ca-bundler.crt to import it;
add the two line to php.ini
curl.cainfo=d:/download/ca-bundle.crt
openssl.cafile=d:/download/ca-bundle.crt
try to install Composer-Setup.exe again.
refer to:https://github.com/composer/composer/issues/2798

Installing Laravel resulted in unable to find the socket transport ssl

Hi I am trying to install laravel on my server.This is what I did.First I installed composer and tryed running this command in cmd:
composer create-project laravel/laravel RestPHP
After running it I got this this message:
I tryed googeling about this error but could not find anything concrete regarding this error I am very new to php.
After this I tryed a more manual approach.I downloaded laravel and put it in my htdocs folder , then I tryed openning it like this:
http://localhost:8585/laravel/public/
But I got this message:
Warning: require(E:\Projects
IDE\PHPStorm\xampp\htdocs\laravel\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in E:\Projects
IDE\PHPStorm\xampp\htdocs\laravel\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'E:\Projects
IDE\PHPStorm\xampp\htdocs\laravel\bootstrap/../vendor/autoload.php'
(include_path='.;E:\Projects IDE\PHPStorm\xampp\php\PEAR') in
E:\Projects IDE\PHPStorm\xampp\htdocs\laravel\bootstrap\autoload.php
on line 17
I have my htdocs route at:
E:\Projects IDE\PHPStorm\xampp\htdocs
Both cases seem to be some for of php configuration problem , since I have 0 knowledge of that I could not find a solution.
Could someone please provided me with a step by step solution?
UPDATE
I managed to enable socket transparency ssl and after trying to run the command I get this:
I have also installed git but I still get the same error.What can I do?
Try enabling php_sockets and open_ssl in your php ini

Categories