需要在哪里安装SSH2?

发布于 2025-02-07 15:21:45 字数 440 浏览 2 评论 0原文

尝试将SSH2安装到Litespeed服务器上并使用传统安装方法对我不起作用。我已成功将SSH2安装到/etc/php/cli中,并从命令行起作用。但是,我的litespeed服务器正在使用目录/usr/local/lsws/lsphp74/etc/7.4/litespeed/php.ini的php.ini。我确认通过从浏览器运行phpinfo()并查看已加载的配置文件条目,该输入显示/usr/local/lsws/lsphp74/etc/php/php/7.4/litespeed/php.ini。无论我尝试什么以及向我提供哪些示例或步骤,我都无法安装在可以通过浏览器使用的区域中。我确实看到了此行“/usr/local/lsws/lsphp74/etc/php/7.4/mods-available/50-ssh2.ini”,在phpinfo()页面的其他.ini文件部分中我已经尝试过,我无法得到它,因此当我查看phpinfo()页面时,它像安装一样出现。

Trying to install ssh2 onto a litespeed server and using the traditional install methods are not working for me. I have successfully installed ssh2 into the /etc/php/cli and it works from the command line. However my litespeed server is using the php.ini from the directory /usr/local/lsws/lsphp74/etc/7.4/litespeed/php.ini. I confirmed that by running phpinfo() from the browser and looking at the Loaded Configuration File entry which shows /usr/local/lsws/lsphp74/etc/php/7.4/litespeed/php.ini. No matter what I try and what examples or steps provided to me, I cannot get it to install in an area that I can use via the browser. I do see this line "/usr/local/lsws/lsphp74/etc/php/7.4/mods-available/50-ssh2.ini," in the Additional .ini files parsed section of the phpinfo() page however no matter what I have tried, I cannot get it so show up like its installed when I view the phpinfo() page.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风轻花落早 2025-02-14 15:21:45

这适用于使用SSH2的LSPHP81,随时用当前版本替换PHP版本。

1-安装必要的PHP软件包和SSH2 LIB

apt-get update
apt-get install lsphp81-pear lsphp81-dev -y
apt-get install libssh2-1 libssh2-1-dev -y

2-从PECL

wget https://pecl.php.net/get/ssh2-1.3.1.tgz
tar -zxvf ssh2-1.3.1.tgz
cd ssh2-1.3.1

3下载SSH2软件包 - 编译SSH2软件包

/usr/local/lsws/lsphp81/bin/phpize
./configure --with-ssh2=/usr/local/lsws/lsphp81 --with-php-config=/usr/local/lsws/lsphp81/bin/php-config
make
make install
echo "extension=ssh2.so" >> /usr/local/lsws/lsphp81/etc/php/8.1/mods-available/ssh2.ini

4-重新加载LSW和PHP

systemctl restart lsws
killall lsphp

5-结果 - 结果

This works for LSPHP81 with SSH2, feel free to replace the PHP version with your current version.

1 - Install necessary PHP packages and ssh2 lib

apt-get update
apt-get install lsphp81-pear lsphp81-dev -y
apt-get install libssh2-1 libssh2-1-dev -y

2 - Download SSH2 package from pecl

wget https://pecl.php.net/get/ssh2-1.3.1.tgz
tar -zxvf ssh2-1.3.1.tgz
cd ssh2-1.3.1

3 - Compile ssh2 package

/usr/local/lsws/lsphp81/bin/phpize
./configure --with-ssh2=/usr/local/lsws/lsphp81 --with-php-config=/usr/local/lsws/lsphp81/bin/php-config
make
make install
echo "extension=ssh2.so" >> /usr/local/lsws/lsphp81/etc/php/8.1/mods-available/ssh2.ini

4 - Reload lsws and PHP

systemctl restart lsws
killall lsphp

5 - Result
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文