繁体   English   中英

Ubuntu中的PHP openssl

[英]PHP openssl in Ubuntu

我创建了一个Web应用程序,该应用程序使用PHPMailer进行邮件发送,并且可以在我的本地服务器(Windows OS)上正常工作。 但是,当我将其上传到生产服务器(Ubuntu 14.04.4)时,它返回一个错误,提示“无法发送消息。邮件错误:扩展名丢失:openssl” 。我尝试寻找解决方案,但无济于事。 无论如何,我正在使用PHP5.3.6。 我希望你们能帮助我。

您可以编译openssl扩展。

第一步 :下载所使用版本的php源代码。

然后运行命令

tar zxvf php-yourphpversion.tar.gz
cd php-yourphpversion/ext/openssl/

#notice if you have error  "cannot find config.m4" when run phpize , you   
#should   rename the file "config0.m4" to "config.m4" by command
#"mv config0.m4 config.m4"


/usr/local/php/bin/phpize     #here is your php location have install 
                              #in my computer ,the php is location in 
                              # /usr/local/php/ so the phpize is in
                              # /usr/local/php/bin/phpize


                                             #(your php location)/bin/php-config                                        
./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config
make
sudo make install

然后openssl将安装并在我的计算机中返回一个path ,它返回/usr/local/php/lib/php/extensions/debug-zts-20160303/

最后修改php.ini并重新启动php-fpm

extension_dir = "the path return after install"   #you should add the return path here
extension=openssl.so

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM