mac php5安装openssl扩展

  最近旧项目需要安装php5.3版本,安装完需要安装扩展,安装openssl扩展报错提示:

 configure: error: Cannot find OpenSSL's <evp.h>

安装步骤:
   1、进入安装包php-5.3.29/ext/openssl

   2、进行编译

       i:/usr/local/php5/bin/phpize

       ii:./configure --with-php-config=/usr/local/php5/bin/php-config --with-openssl=/usr/local/Cellar/openssl@1.0/1.0.2r

       注:之前执行./configure 步骤,报错configure: error: Cannot find OpenSSL's <evp.h>,加上 --with-openssl=/usr/local/Cellar/openssl@1.0/1.0.2r

      在执行就解决该问题,php5.3建议是openssl1.0版本左右的,php版本低对应的扩展版本也要低

       iii:make && make install  (界面输出以下就代表编译成功)

       Installing shared extensions:     /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/

   3、php.ini配置文件,并重启php服务,查看扩展是否安装成功

       i: 在对应的php.ini文件增加

      extension=openssl.so
      ii:重启php5服务
          lsof -i:9004   #设置的端口号是9004,9000用于php7版本
          kill -9 进程    #停掉php5运行进程

   /usr/local/php5/sbin/php-fpm.dSYM   #启动php5服务

         #查看openssl扩展模块是否安装成功,如无可在/usr/local/php5/etc目录下执行该命令,如果两个都没有,则安装扩展失败,反之成功

   /usr/local/php5/sbin/php-fpm.dSYM -m  |  grep openssl

 

 

  #无转载,自己遇到的实际工作问题

 

posted @ 2022-11-17 07:52  笨笨韩  阅读(337)  评论(0)    收藏  举报