我使用WinSCP作为ftp客户端,并将传输设置为二进制。我还使用Notepad++作为编辑器。
我上传的每一个文件,都被剥夺了所有的断线。
<?php
// this is a comment
echo 'this is an echo';
?>
变成
<?php // this is a comment echo 'this is an echo'; ?>
不输出任何东西,因为它被解释为评论。
我是否需要设置其他的东西来上传文件而没有任何问题?
我尝试将文件上传到我的服务器
my.php (普通本地文件)
<?php
$box_title= "SEARCH ME"
?>
通过FileZilla FTP客户端上传后(远程服务器文件)
// SOMETIMES ABOVE FILE BECOMES
<?php$box_title= "SEARCH ME"?>
// OR SOMETIMES LIKE THIS
<?php
$box_title= "SEARCH ME"
?>
我怀疑这是与服务器相关的问题,但不确定。有谁能用解决方案来解释这个问题吗?
我在PHP中有以下代码:
$connection = @ftp_connect (IP of the server, 21);
ftp_login ($connection, User in FTP, Password in FTP);
ftp_pasv ($connection, true);
ftp_put ($connection, Remote File, Local file, FTP_BINARY);
我创建到FTP的连接并可以登录,但是ftp_put函数总是上传一个空文件,并发出警告:
Warning: ftp_put(): TYPE is now 8-bit binary