温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

linux中上传php网页的方法

发布时间:2020-08-19 15:31:59 来源:亿速云 阅读:172 作者:小新 栏目:编程语言

这篇文章主要介绍linux中上传php网页的方法,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

在linux系统下,上传php网页到服务器,可以通过ftp的相关命令上传。

建立FTP连接

要打开与远程系统的ftp连接,请使用ftp命令后跟远程服务器IP地址或域名:

ftp 192.168.42.77

1、 如果建立连接,将显示确认消息,系统将提示您输入FTP用户名,在此示例中,FTP用户名为linuxidc:

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 21:35\. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (192.168.42.77:localuser): linuxidc
You may see a different confirmation message depending on the FTP service running on the remote server.

2、 输入用户名后,系统将提示您输入密码:

Password:

如果密码正确,远程服务器将显示确认消息和ftp>提示。

230 OK. Current restricted directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

如果您访问的FTP服务器接受匿名ftp帐户,并且您想以匿名用户anonymous身份登录,请使用用户名和电子邮件地址作为密码。

常用FTP命令

许多FTP命令与您在Linux shell提示符中键入的命令类似或相同。

以下是一些最常见的FTP命令

help或?- 列出所有可用的FTP命令。
cd - 更改远程计算机上的目录。
lcd - 更改本地计算机上的目录。
ls - 列出当前远程目录中的文件和目录的名称。
mkdir - 在当前远程目录中创建一个新目录。
pwd - 打印远程计算机上的当前工作目录。
delete - 删除当前远程目录中的文件。
rmdir- 删除当前远程目录中的目录。
get - 将一个文件从远程复制到本地计算机。
mget - 将多个文件从远程复制到本地计算机。
put - 将一个文件从本地复制到远程计算机。mput - 将一个文件从本地复制到远程计算机。

使用FTP命令上载文件

要将文件从本地目录上载到远程FTP服务器,请使用以下put命令:

put index.php

输出应该如下所示:

200 PORT command successful
150 Connecting to port 34583
226-File successfully transferred
226 0.849 seconds (measured here), 111.48 Kbytes per second
96936 bytes sent in 0.421 seconds (225 kbytes/s)

如果要上载不在当前工作目录中的文件,请使用该文件的绝对路径

要将多个文件从本地目录上载到远程FTP服务器,请使用以下mput命令:

mput image1.jpg image2.jpg
mput image1.jpg? y

200 PORT command successful
150 Connecting to port 41075
226-File successfully transferred
226 1.439 seconds (measured here), 102.89 Kbytes per second
151586 bytes sent in 1.07 seconds (138 kbytes/s)

mput image2.jpg? y
200 PORT command successful

150 Connecting to port 40759
226-File successfully transferred
226 1.727 seconds (measured here), 111.75 Kbytes per second
197565 bytes sent in 1.39 seconds (138 kbytes/s)

上传多个文件时,系统将提示您确认要上传的每个文件。

完成上传文件到远程FTP服务器后,用bye或关闭连接quit。

以上是linux中上传php网页的方法的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI