Home > php教程 > php手册 > php提示Fatal error: Call to undefined function openssl_x509_parse()

php提示Fatal error: Call to undefined function openssl_x509_parse()

WBOY
Release: 2016-05-26 08:20:31
Original
2085 people have browsed it

在安装一个网站时提示Fatal error: Call to undefined function openssl_x509_parse函数了,而函数openssl_x509_read是一个php内置的函数,这个函数像curl需要组件支持,我们需要在php.ini中打开相关配置即可.

网站提示 Fatal error: Call to undefined function openssl_x509_parse()  ......

解决办法

打开php.ini,找到这一行 ;extension=php_openssl.dll,将前面的“;”去掉,再重启apache或者iis即可.

再打开网站错误不提示了,为了证明是openssl.dll没开启的原因我们可以运行如下代码:

<?php 
	$data = openssl_x509_parse(file_get_contents(&#39;/path/to/cert.crt&#39;)); 
	$validFrom = date(&#39;Y-m-d H:i:s&#39;, $data[&#39;validFrom_time_t&#39;]); 
	$validTo ) date(&#39;Y-m-d H:i:s&#39;, $data[&#39;validTo_time_t&#39;]); 
	echo $validFrom . " ";  
	echo $validTo . " "; 
	 
Copy after login

这函数看看是不是没有问题.

文章网址:

随意转载^^但请附上教程地址。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template