Linux
PHP Composer 설치시 오류
Rootrator
2022. 3. 10. 14:19
[서버 환경]
CentOS 7.2
리눅스에서 PHP Composer 설치는 아래와 같이 curl, 혹은 php -r 옵션을 이용해 설치가 가능하다.
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin/
php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/local/bin/
설치후 symbolic link
sudo ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
하지만 아래와 같은 오류가 나는 경우가 있는데
PHP Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in Command line code on line 1 PHP Warning: copy(): Failed to enable crypto in Command line code on line 1 PHP Warning: copy(https://install.phpcomposer.com/installer): failed to open stream: operation failed in Command line code on line 1
아래와 같이 해결 가능하다.
wget http://curl.haxx.se/ca/cacert.pem
php.ini에서 편집
openssl.cafile=저장경로/cacert.pem
반응형