mindong 发表于 2018-12-20 12:26:21

不重新编译PHP为php增加openssl.so模块

  首先查看php版本php -v
  可以使用php -m来查看是否存在此模块
  找到安装php的源文件    cd /home/admin/software/php-5.2.0/ext/openssl/
  openssl目录下有个config.w32和config0.m4,把config0.m4改名为config.m4
  
mv config0.m4 config.m4
  执行:/usr/local/bin/phpize
  如果出现告警:Cannot find autoconf.Please check your autoconf installationand the$PHP_AUTOCONF environment variable. Then, rerun this script
  解决办法:
  wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
  tar -zvxf m4-1.4.9.tar.gz
  cd m4-1.4.9/
  ./configure && make && make install
  cd ../


wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz

  tar -zvxf autoconf-2.62.tar.gz
  cd autoconf-2.62/
  ./configure && make && make install
  然后 cd /home/admin/software/php-5.2.0/ext/openssl/
  再执行:/usr/local/bin/phpize
  
./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config (此路径根据实际安装的情况而定)
make
make install
然后在/usr/local/lib/php.ini(或者 /usr/local/Zend/etc/php.ini 这两个文件是一样的) 加上一句:
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
extension = "openssl.so"
  使用php -m来查看是否存在此模块
  重启apache



页: [1]
查看完整版本: 不重新编译PHP为php增加openssl.so模块