PHP拒绝找到ssh2_connect()函数 [英] php refusing to find ssh2_connect() function
问题描述
所使用的操作系统
Windows 7 - V 6.1
安装
阿帕奇
httpd-2.2.22-win32-x86-no_ssl.msi
我的httpd.conf
My httpd.conf
AddType application/x-httpd-php .php
LoadModule php5_module "X:/Program Files/PHP/php5apache2_2.dll"
安装的PHP版本
Version of php installed
php-5.3.16-Win32-VC9-x86.msi
我复制从pssed php_ssh2-0.11.2-5.3-nts-vc9-x86.zip uncom $ P $的php_ssh2.dll
I copied the php_ssh2.dll from php_ssh2-0.11.2-5.3-nts-vc9-x86.zip uncompressed
php_ssh2-0.11.2-5.3-nts-vc9-x86.zip
到
X:\Program Files\PHP\ext\php_ssh2.dll
我的php.ini
My php.ini
extension_dir="X:\Program Files\PHP\ext"
PHPIniDir "X:/Program Files/PHP"
[PHP_SSH2]
extension=php_ssh2.dll
了Apache配置具有php_ssh2.dll php.ini文件后将该文件复制到php_ssh2.dll下extension_dir之后已经重新启动 - 错误仍然存在。
Apache has been restarted after configuring php.ini with php_ssh2.dll and after copying the file php_ssh2.dll to extension_dir - error persists
Fatal error: Call to undefined function ssh2_connect() in X:\Program Files\Apache Software Foundation\Apache2.2\htdocs\index.php on line 4
用于测试code
code used to test
<?php
$connection = ssh2_connect("XXX.XXX.XXX.XXX", 22);
if(ssh2_auth_password($connection, "XXXXXX", "XXXXXX"))
printf("CONNECTED");
else
printf("ERROR");
?>
与phpinfo()函数的测试完全显示网页浏览器,因为PHP与在httpd.conf配置,但该参数extension_dir中显示为
A test with phpinfo() displays the page perfectly in the browser because php was configured with the httpd.conf but the parameter extension_dir appears as
extension_dir C:\php C:\php
但这种参数设置为X:\\ Program Files文件\\ PHP \\分机
but this parameter was set to "X:\Program Files\PHP\ext"
推荐答案
在您的ini文件你看到 ssh2.shell,ssh2.exec,ssh2.tunnel,ssh2.scp,ssh2.sftp
在注册PHP流
如果不是没有载入DLL。 Apache的重新启动可能是什么?
On your ini file do you see ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp
under Registered PHP Streams
if not dll is not loaded. Apache restart may be?
此外,我想你了。
PHPIniDir "X:/Program Files/PHP"
在的httpd.conf
不是的php.ini
这篇关于PHP拒绝找到ssh2_connect()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!