安装 PuTTY
PuTTY 是一个依赖于 PHP 的工具,因此需要在你的 PHP 服务器上安装 PuTTY,以下是安装 PuTTY 的常用方法:
Ubuntu/Debian 系统:
- 安装 PHP 是必需的,你可以通过以下命令安装 PHP:
sudo apt install php
- 安装 PuTTY:
sudo apt install php-pyton
Windows 系统(需要 PHP 和 PHP-Python):
- 安装 PHP:
chown -r attacker: attacker php
- 安装 PHP-Python:
python3 -m php --version python3 -m php-pyton --version
- 安装 PuTTY:
python3 -m php-pyton install-pytonlib --source https://pypi.org/project/pypython/ --force
确保默认配置文件
默认情况下,PuTTY 会尝试使用 pyton.config 文件,你可以通过以下命令查看或修改配置文件:
phpconfig --list
设置端机端机配置(Windows 版本)
对于 Windows 用户,PuTTY 提供端机端机配置选项,以确保端机端机的配置一致,以下是配置步骤:
步骤 1:将 PuTTY 设备配置到默认配置文件
- 将 PuTTY 设备配置到
~/.phpconfig/文件中:pytonconfig set --device "Windows 1" "C:\windows\config\windows1.conf"
- 打开
~/.phpconfig/文件:cat ~/.phpconfig/windows1.conf
步骤 2:修改端机端机配置
-
修改
~/.phpconfig/文件的end-机和end-机-机项:pytonconfig set --device "Windows 1" "C:\windows\config\windows1.conf"
这里可能需要修改
end-机和end-机-机项的值。 -
打开
~/.phpconfig/文件:cat ~/.phpconfig/windows1.conf
-
修改端机端机配置项:
pytonconfig set --device "Windows 1" "C:\windows\config\windows1.conf"
这里可能需要修改
end-机和end-机-机项的值。 -
打开
~/.phpconfig/文件:cat ~/.phpconfig/windows1.conf
-
修改端机端机配置项:
pytonconfig set --device "Windows 1" "C:\windows\config\windows1.conf"
-
打开
~/.phpconfig/文件:cat ~/.phpconfig/windows1.conf
-
修改端机端机配置项:
pytonconfig set --device "Windows 1" "C:\windows\config\windows1.conf"
使用 PuTTY 在 HTML 文件 中
如果需要将 HTML 文件格式化为可可信的 URL,可以使用以下方法:
Windows 系统:
- 下载并安装 web-distils:
python3 -m web-distils
- 使用 web-distils 生成 URL:
python3 -m web-distils generate --config pyton.config --scheme python
这将生成一个 URL,如
https://example.com/base.html。
Linux/macOS:
- 使用 web-distils:
python3 -m web-distils generate --config pyton.config --scheme python
- 使用 web-distils 生成 URL:
python3 -m web-distils generate --config pyton.config --scheme python
使用 PuTTY 在服务器端
如果需要在服务器端格式化 URL,可以使用以下步骤:
Windows 系统:
- 安装 web-distils:
chown -r attacker: attacker python3 -m web-distils
- 生成 URL:
python3 -m web-distils generate --config pyton.config --scheme python
Linux/macOS:
- 安装 web-distils:
sudo apt install web-distils
- 生成 URL:
python3 -m web-distils generate --config pyton.config --scheme python
处理端机端机配置冲突
如果端机端机配置冲突,可以使用以下方法:
- 在端机端机配置文件中添加新的端机端机配置项:
pytonconfig set --device "Windows 1" "C:\windows\config\windows1.conf"
- 打开端机端机配置文件:
cat ~/.phpconfig/windows1.conf
- 修改端机端机配置项:
pytonconfig set --device "Windows 1" "C:\windows\config\windows1.conf"
使用 PuTTY 在 HTML 文件 中
如果需要将 HTML 文件格式化为可可信的 URL:
- 下载 web-distils:
python3 -m web-distils
- 使用 web-distils 生成 URL:
python3 -m web-distils generate --config pyton.config --scheme python
这将生成一个 URL,如
https://example.com/base.html。
PuTTY 是一个强大的工具,可以让你的网页更加可信和可信,通过安装 PuTTY,并按照以上步骤配置到你的 PHP 服务器上,你可以轻松地将HTML文件格式化为可可信的URL。



