Saturday, November 22, 2025
HomeLanguagesPHP openssl_get_cert_locations() Function

PHP openssl_get_cert_locations() Function

The openssl_get_cert_locations() function is an in-built function in PHP which is used to get certificate location. This function returns an array with information about the available certificate locations that will be searched for SSL certificates.

Syntax:

array openssl_get_cert_locations( void )

Parameters: This function does not accept any parameter.

Return Value: This function returns an array with the available certificate locations.

Below program illustrates the openssl_get_cert_locations() function in PHP:

Example:

PHP




<?php
  
var_dump(openssl_get_cert_locations());
  
// openssl get cert location represent in array
return openssl_get_cert_locations();
  
?>


Output:

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

Reference: https://www.php.net/manual/en/function.openssl-get-cert-locations.php

RELATED ARTICLES

Most Popular

Dominic
32407 POSTS0 COMMENTS
Milvus
97 POSTS0 COMMENTS
Nango Kala
6784 POSTS0 COMMENTS
Nicole Veronica
11931 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11999 POSTS0 COMMENTS
Shaida Kate Naidoo
6907 POSTS0 COMMENTS
Ted Musemwa
7168 POSTS0 COMMENTS
Thapelo Manthata
6863 POSTS0 COMMENTS
Umr Jansen
6848 POSTS0 COMMENTS