composer fails to install slim api framework - php

Hey guys trying to install the slim php api framework locally via composer but everytime I try to run
composer require slim/slim "^3.0"
the following error happens:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
I am doing all of this on my mac running macOS and have no idea how to solve this issue can anyone help me

It's an OpenSSL issue. You can download root certificates with
wget https://curl.haxx.se/ca/cacert.pem
then edit openssl.cafile parameter in your php.ini configuration file:
openssl.cafile=/path/to/cacert.pem
If you aren't able to do it you can use composer's disable-tls option.
composer config -g -- disable-tls true
Enabling this is a security risk and is NOT recommended.

Related

Symfony project

Tried to create a symfony project and got an error.
So I entered in the console:
composer create-project symfony/website-skeleton my-project
console output:
You are running Composer with SSL/TLS protection disabled.
Your configuration does not allow connections to http://packagist.org/packages.json. See https://getcomposer.org/doc/06-
config.md#secure-http for details.
http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of da
te
[Composer\Downloader\TransportException]
The "https://packagist.org/p/symfony/website-skeleton%24e4840857811b44fdd2effbe71a2cd41d6c17c10fe4f92248daacc2c4e0c
ecd67.json" file could not be downloaded: Unable to find the wrapper "https" - did you forget to enable it when you
configured PHP?
failed to open stream: No such file or directory
Take a look at this solution, it might help you:
Installing Composer for Windows - unable to find wrapper "https"
It seems that you do not have openssl enabled in your php

Laravel, Installer Not works

After Laravel released new version (5.7) of this framework, i cant create new project and its commands not work
i did this works:
1) use laravel new MyProject with this error :
[GuzzleHttp\Exception\RequestException] Error creating resource: [message]
fopen(http://cabinet.laravel.com/latest.zip): failed to open stream: A
connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond.[file]
C:\Users\Saeid\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\
Handler\StreamHandler.php[line] 324
2) use composer create-project --prefer-dist laravel/laravel MyProject with this error :
[Composer\Downloader\TransportException] The "https://repo.packagist.org/packages.json" file could not be downloaded: failed to open stream: No connection could be made because the target machine actively refused it.
3) update composer by composer selfupdate with this error :
[Composer\Downloader\TransportException] The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: No connection could be made because the target machine actively refused it.
4) update laravel instller by composer global require "laravel/installer"
[Composer\Downloader\TransportException] The "https://repo.packagist.org/packages.json" file could not be downloaded: failed to open stream: No connection could be made because the target machine actively refused it.
Notice: in all of steps all links work on google chrome!!!! but it said "No connection could be made because the target machine actively refused it."
Notice: my composer version (1.7.2)
Notice: my Laravel installer version is (2.0.1)
Finally I found the problem ...
that's "Composer Proxy Setting"
because damned Filtering in Iran we must use proxy based programs for bypass the filtering.
last time i installed the composer the proxy based anti filter app (freegate) was running and composer get the local proxy address "127.0.0.1:8580" and all of the problems started...
today when the freegate was running i saw everything is OK!!!
some body know how to change the composer proxy setting???
i removed the composer and install it again but the installer automatically use this proxy address and disable the checkbox that use to select the proxy setting.
that means i cant disable proxy setting or change it.... :(
first download the composer the open your IDE the execute composer create-project "laravel/laravel" project-name

composer error when install package

I have a problem with composer.
when I want install a php package with composer on my project, I see this mess :
You are running Composer with SSL/TLS protection disabled.
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be
downloaded: fai led to open stream: Connection refused
please help me ...
how can i ok this problem ?
Thanks in advance

Installing Laravel on Mac

I have been trying to install Laravel (Latest version) on my Mac machine. I have all prerequisites such as php, composer. Just tried to execute below commands but it is giving errors.
/Applications/XAMPP/xamppfiles/bin/php composer.phar create-project laravel/laravel {directory} 4.2 --prefer-dist
Where,
-- /Applications/XAMPP/xamppfiles/bin/php - Mac php path
-- composer.phar - Composer file
After executing the above command, I am getting error like below. I am using my office network, could that cause a firewall issue?
Error:
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
About my Mac:
OS X EI Captain (Version 10.11.6)
In this case my suggestion is using Laravel Valet - never had issues with it. It will save you tones of time after you will start using it.
https://laravel.com/docs/5.4/valet
Also try to use global composer and clean composer's cache before doing that.
I think it was temporary issue.

drush failing with autoload.php failed to open stream

I searched the whole drupal directory but I didn't find the autoload.php file. I see the error when enabling modules using drush on the command line.
Here is the exact error
include(sites/all/modules/contrib/guzzle/vendor/autoload.php): failed to open stream: No such file or directory composer_autoload.module:24 [warning]
include(): Failed opening 'sites/all/modules/contrib/guzzle/vendor/autoload.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') [warning]
composer_autoload.module:24
I haven't seen this error before, but I think it's telling you that you have to install composer, which is now a requirement for Drush. See the installation instructions for Drush: http://docs.drush.org/en/master/install/#composer-one-drush-for-all-projects.
I got it fixed by installing composer binary, rerunning drush dl composer and drush dl guzzle then went inside guzzle and ran ./composer.phar install

Categories