如何安装phpseclib? [英] How to install phpseclib?

查看:247
本文介绍了如何安装phpseclib?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在机器上安装了Apache,因此可以将localhost用作PHP服务器.那个有效.现在,我正在尝试使用PHP通过SFTP将文件发送到另一台服务器.我环顾四周,发现推荐了phpseclib.我似乎无法弄清楚如何安装phpseclib.这是网站提供的内容:

I have installed Apache on my machine so I can use localhost as a PHP server. That works. Right now I am trying to use PHP to send files via SFTP to another server. I looked around a bit and saw phpseclib was recommended. I can't seem to figure out how to install phpseclib. Here are the lines that the website gave:

set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');
include('Net/SFTP.php');

您必须设置包含路径.

You have to set the include path.

我理解这些词的意思,但是我无法使其正常工作.我正在使用Mac.我的服务器在/Users/diego/Sites/中.我到底需要在哪里放置phpseclib文件夹?我需要在php文件中添加哪些行,以便包含phpseclib?

I understand what these words mean but I have been unable to get it working. I am using a mac. My server is in /Users/diego/Sites/. Where exactly do I need to put the phpseclib folder? What lines do I need to put in my php file so that phpseclib is included?

推荐答案

我按照按照上面的指南,我发现apache2正在我的/etc/文件夹中寻找php.ini.但是我遇到了一个问题.在我的/etc/文件夹中没有php.ini文件.但是有php.ini.defualt.因此,我将php.ini.default另存为php.ini,然后修改了include_path.

By following the guide above, I figured out that apache2 was looking for php.ini in my /etc/ folder. But I ran into a problem. In my /etc/ folder there was no php.ini file. But there was php.ini.defualt. So I 'saved as' php.ini.default to php.ini and then modified the include_path.

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
include_path = ".:/Users/diego/pear/share/pear:/php/includes"

PHP不再抛出错误,指出找不到phpseclib.

PHP is no longer throwing an error saying that phpseclib cannot be found.

这篇关于如何安装phpseclib?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆