我需要使用PHP从服务器到另一个服务器(我自己都有)的文件。我有以下脚本:PHP Exec SCP不会将文件复制到远程服务器
我得到这个错误:
Disallowed system call: SYS_pipe
那是什么错误?我该如何解决它?
我需要使用PHP从服务器到另一个服务器(我自己都有)的文件。我有以下脚本:PHP Exec SCP不会将文件复制到远程服务器
我得到这个错误:
Disallowed system call: SYS_pipe
那是什么错误?我该如何解决它?
PHP环境不允许在您的服务器上运行。
,我该如何启用它?我需要更新apache吗?或PHP? –
如果它是你的服务器检查php.ini disable_functions ...如果它是一个托管服务器艰难noogies我敢打赌,我的养老金他们不会启用它。 – TigOldBitties
谢谢,我找到了 –
这是有点晚了,我知道,但你可能有更好的运气与phpseclib's pure PHP SCP implementation:如何使用它
https://raw.github.com/phpseclib/phpseclib/master/phpseclib/Net/SCP.php
例子:
<?php
include('Net/SCP.php');
include('Net/SSH2.php');
$ssh = new Net_SSH2('www.domain.tld');
if (!$ssh->login('username', 'password')) {
exit('bad login');
}
$scp = new Net_SCP($ssh);
$scp->put('abcd', str_repeat('x', 1024*1024));
?>
我讨厌当队长很明显这里,但是'SYS_pipe'不允许使用,为了解决这个错误,你需要允许它。 – Cyclone
谷歌首先命中是这个SO评论:http://stackoverflow.com/questions/3964766/ensuring-user-input-code-does-not-damage-server-when-executed - 所以它可能是一个被禁止的执行。顺便说一句,请参阅[ssh2_scp_send](http://php.net/manual/en/function.ssh2-scp-send.php)作为替代。 – mario
@Cyclone:在这里......你先生是个绅士和学者。我似乎是上尉明显:) – TigOldBitties