简体   繁体   English

在PHP 5.4.9(x64)上安装libssh2-php

[英]Install libssh2-php on PHP 5.4.9 (x64)

I have a problem with the update on php 5.4.9 (i install it with the ppa "ppa:ondrej/php5") 我有关于PHP 5.4.9更新的问题(我用ppa“ppa:ondrej / php5”安装它)

Now i have the problem that i can't install libssh2-php (which is required on my project) 现在我有一个问题,我无法安装libssh2-php(这在我的项目中是必需的)

I found some .deb files, but it's only for 32-bit systems. 我找到了一些.deb文件,但它只适用于32位系统。

So when i'm trying to install libssh2-php i have a collision with "libssh2-php:i386" and i have the following dependiesmessage: 因此,当我尝试安装libssh2-php时,我与“libssh2-php:i386”发生冲突,我有以下依赖消息:

ucf:i386 libc6:i386 (>= 2.4) libssh2-1:i386 (>= 1.0) and phpapi-20090626+lfs:i386

System: Ubuntu Server 12.04 LTS x64 | 系统: Ubuntu Server 12.04 LTS x64 | PHP 5.4.9 PHP 5.4.9

I also got a warning on running "php -v" 关于运行“php -v”我也收到了警告

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/ssh2.so' - /usr/lib/php5/20100525/ssh2.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP警告:PHP启动:无法加载动态库'/usr/lib/php5/20100525/ssh2.so' - /usr/lib/php5/20100525/ssh2.so:无法打开共享对象文件:没有这样的文件或目录在第0行的未知中

问题在于,对于PHP5.4.x和x64系统,libssh2是不可行的。

I have the same problem trying to use ondrej's ppa for ubuntu 10.04 LTS. 我有同样的问题试图使用ondrej的ppa为ubuntu 10.04 LTS。 It seams that he didn't include the sssh extension. 它接缝表明他没有包括sssh扩展名。

Apt-get tries to install the version from default package which runs into conflict (depends phpapi-20090626+lfs) with current installed version, isn't it? Apt-get尝试从默认包安装版本,该版本与当前安装的版本发生冲突(取决于phpapi-20090626 + lfs),不是吗?

Only my backup php cli script needs this extension to run. 只有我的备份php cli脚本才需要运行此扩展。 After trying to solve dependencies witout success, I switched to a shell_exec('ssh ...@...') solution as workaround. 在尝试解决依赖关系成功之后,我切换到shell_exec('ssh ... @ ...')解决方案作为解决方法。

I am only a developer with advanced admin knowledge, no apt-get or linux packaging admin professional. 我只是一名具有高级管理知识,没有apt-get或linux打包管理专业人员的开发人员。 There maybe other solution to fix this via packaging management or maybe building the needed version from source? 可能还有其他解决方案可以通过打包管理或从源代码构建所需的版本来解决这个问题?

EDIT: There will be another nicer solution :-) you can use pecl to install / build the extension, here is what i have done: 编辑:将有另一个更好的解决方案:-)你可以使用pecl来安装/构建扩展,这是我做的:

$ sudo pecl install ssh2
Failed to download pecl/ssh2 within preferred state "stable", latest release is version 0.12, stability "beta", use "channel://pecl.php.net/ssh2-0.12" to install
install failed

$ sudo pecl install channel://pecl.php.net/ssh2-0.12
downloading ssh2-0.12.tgz ...
Starting to download ssh2-0.12.tgz (26,223 bytes)
[...]
Build process completed successfully
Installing '/usr/lib/php5/20100525+lfs/ssh2.so'
install ok: channel://pecl.php.net/ssh2-0.12
configuration option "php_ini" is not set to php.ini location
You should add "extension=ssh2.so" to php.ini

Afterwards I add extension=/usr/lib/php5/20100525+lfs/ssh2.so to php config. 之后我将扩展名= / usr / lib / php5 / 20100525 + lfs / ssh2.so添加到php配置中。

Just do: 做就是了:

sudo aptitude purge php5-suhosin

It's described in detail here: bugs.debian.org 它在这里详细描述: bugs.debian.org

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

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