Methods that do not recompile PHP to add openssl modules to php

  • 2020-05-07 19:24:50
  • OfStack


yum -y install openssl 


/usr/local/bin/ is the installation directory for php
Switch to the etx/openssl directory in the php installation directory
cd /root/soft/php-5.2.8/ext/openssl
 
/usr/local/bin/phpize 

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

Check the openssl directory for config.w32 and config0.m4, rename config0.m4 to config.m4.
mv config0.m4 config.m4

Perform:
 
/usr/local/bin/phpize 

Compile:
 
./configure --with-openssl --with-php-config=/usr/local/bin/php-config 
make;make install 

When the prompt succeeds, add extension = openssl.so to php.ini
Restart apache or php-fpm and complete.

PS: why is config0.m4 in the directory instead of config.m4?
pcre, zlib and other modules are also config0.m4.

Related articles: