2012-03-20 1 views
2

나는 이미 모든 것을 시도했지만 .... 작동하지 않는다! System32 windows 폴더에 libeay32.dll과 ssleay32.dll을 넣었고 php.ini에서 php_openssl.dll 확장을 활성화했다. 그러나 다음 코드를 실행할 때 일부 오류가 발생 내에서 OpenSSL 버전은 1.0.0입니다 누구든지 나를 도울 수내 xampp (Windows)에서 OpenSSL 확장 작업을하려면 어떻게해야합니까? :

코드 :..?

$configargs = array(
    'config' => 'openssl.cnf', 
    'digest_alg' => 'md5', 
    'x509_extensions' => 'v3_ca', 
    'req_extensions' => 'v3_req', 
    'private_key_bits' => 666, 
    'private_key_type' => OPENSSL_KEYTYPE_RSA, 
    'encrypt_key' => false, 
    ); 

$dn = array(
    "countryName" => "DE", 
    "stateOrProvinceName" => "wubbla wubbla", 
    "localityName" => "wubbla", 
    "organizationName" => "Internet Widgits Pty Ltd", 
    "organizationalUnitName" => "Organizational Unit Name", 
    "commonName" => "example.com", 
    "emailAddress" => "Email Address" 
); 

$csr = openssl_csr_new($dn, $privkey, $configargs); 

// Show any errors that occurred here 
while (($e = openssl_error_string()) !== false) { 
    echo $e . "\n"; 
    } 

오류 :

error:02001003:system library:fopen:No such process 
error:2006D080:BIO routines:BIO_new_file:no such file 
error:0E064002:configuration file routines:CONF_load:system lib 
error:02001002:system library:fopen:No such file or directory 
error:2006D080:BIO routines:BIO_new_file:no such file 
error:0E064002:configuration file routines:CONF_load:system lib 
+0

php.ini를 변경 한 후 아파치를 다시 시작해 보셨습니까? –

+0

예! 나는 이것을 시도했다! –

답변

3

음, 오류 메시지에 따르면, 구성 파일을 fopen()하지 못했습니다 :

'config' => 'openssl.cnf', 

존재합니까? 절대 경로 또는 CWD를 기준으로 사용해보십시오.

+0

마침내 작동하지만 ... 이제 다른 문제가 생겼습니다 ... :(내가 openssl_pkey_get_details를 사용하여 생성 된 개인용 RSA 키에 대한 정보를 얻으려고 할 때, 즉, PHP 스크립트를 실행할 때 페이지가 연결을 다시 시작하고 실행하지 않습니다. 어떤 문제가 있습니까? –

+0

openssl.cnf를 사용하지 않고 개인 RSA 키를 생성 할 수 있습니까? –

관련 문제