php 致命错误:调用未定义的函数 ssh2_connect() - Redhat OS
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22006310/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Fatal error: Call to undefined function ssh2_connect() - Redhat OS
提问by Mr. Black
I installed required libraries for enabling ssh2 extension. I just followed this guide to install the php ssh2 extension. And it got enabled in my phpinfo page. But, still I'm not able to use ssh2_connection function within my php file. It says the following error message.
我安装了启用 ssh2 扩展所需的库。我只是按照本指南安装了 php ssh2 扩展。它在我的 phpinfo 页面中启用。但是,我仍然无法在我的 php 文件中使用 ssh2_connection 函数。它说以下错误消息。
Please help to resolve this issue. Fatal error: Call to undefined function ssh2_connect()
请帮助解决此问题。致命错误:调用未定义的函数 ssh2_connect()
Note: I'm using Redhat 6.3 Linux and I don't want any alternate library for this.
注意:我使用的是 Redhat 6.3 Linux,我不想要任何替代库。
http://www.experts-exchange.com/OS/Linux/Q_27883937.html
http://www.experts-exchange.com/OS/Linux/Q_27883937.html


采纳答案by Mr. Black
Fixed: There are two php.ini files in the server, those are below. The second one will be placed depends on your server OS. Just look out what are the location for php.ini (locate php.ini) and add the extension in the local.
修正:服务器中有两个 php.ini 文件,分别如下。第二个将被放置取决于您的服务器操作系统。看看php.ini ( locate php.ini)的位置是什么,然后在本地添加扩展名。
/etc/php.ini
/usr/local/lib/php.ini
回答by wclark
Try pecl install -f ssh2 Then make sure "extension=ssh2.so" is in your php.ini/
尝试 pecl install -f ssh2 然后确保“extension=ssh2.so”在你的 php.ini/ 中

