安装symfony 2时出错

时间:2016-03-22 21:03:52

标签: php symfony

我正在尝试安装simfony 2(使用php 5.6.15),但是我收到了这个错误:

C:\Users\Murilo\Desktop\teste>php -r "readfile('https://symfony.com/installer');
" > symfony

C:\Users\Murilo\Desktop\teste>php symfony

Warning: readfile(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify faile
d in Command line code on line 1

Warning: readfile(): Failed to enable crypto in Command line code on line 1

Warning: readfile(https://symfony.com/installer): failed to open stream: operati
on failed in Command line code on line 1

听php模块:

C:\Users\Murilo\Desktop\teste>php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
intl
json
ldap
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
odbc
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]

这是我使用PHP的第一天,我不知道如何解决这个问题。

2 个答案:

答案 0 :(得分:1)

您似乎不是cert.pem文件。打开控制台并运行

php -r "var_dump(openssl_get_cert_locations());"
PHP 5.6中提供了

openssl_get_cert_locations,它可以检索可用的证书位置。在我的Fedora上我得到这样的东西:

array(8) {
  ["default_cert_file"]=>
  string(21) "/etc/pki/tls/cert.pem"
  ["default_cert_file_env"]=>
  string(13) "SSL_CERT_FILE"
  ["default_cert_dir"]=>
  string(18) "/etc/pki/tls/certs"
  ["default_cert_dir_env"]=>
  string(12) "SSL_CERT_DIR"
  ["default_private_dir"]=>
  string(20) "/etc/pki/tls/private"
  ["default_default_cert_area"]=>
  string(12) "/etc/pki/tls"
  ["ini_cafile"]=>
  string(0) ""
  ["ini_capath"]=>
  string(0) ""
}

您可能需要检查default_cert_file文件(在我的情况下为/etc/pki/tls/cert.pem)是否存在。如果没有,您可以使用this

答案 1 :(得分:0)

这绝对与Symfony无关。对我来说,通过在系统的SSL配置上禁用SSLv2和SSLv3来解决相关问题。见http://disablessl3.com/