Heim  >  Artikel  >  php教程  >  在一个未知的CentOS服务器中如何加上PHP的openssl扩展

在一个未知的CentOS服务器中如何加上PHP的openssl扩展

WBOY
WBOYOriginal
2016-06-13 09:34:59999Durchsuche

1. 服务器是定制过的,不知对应的centos版本;

2. PHP是自己编译的,而且服务器上没有保留对应版本的源代码,通过/pathto/php -v 找出php版本号,然后wget去下载对应的php源码包;

3. 加压代码,到源码的ext/openssl目录下,使用phpize的方式进行编译环境的配置,大致步骤如下:

Cannot find config.m4.
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module

查看openssl目录下有个config.w32和config0.m4,把config0.m4改名为config.m4。

<span>mv</span> config0.m4 config.m4



执行:

/usr/local/bin/phpize


编译:

 
./configure --with-openssl --with-php-config=/usr/local/bin/php-<span>config
</span><span>make</span>;<span>make</span> <span>install</span>

 


提示成功后,在php.ini里加入extension = openssl.so
重启apache或php-fpm,完成.

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn