PHP-从ftp-500下载60mb文件:内部服务器错误

时间:2016-03-23 10:02:49

标签: php

我写了以下php代码,它应该连接到FTP,转到文件夹并定期下载60MB文件。当我尝试运行代码时会抛出500错误,这是一个问题with server_file

<?
// define some variables
$local_file = 'abc.zip';
$server_file = '/ftproot/abc/abc.zip';
$ftp_server="ftp.abc.biz";
$ftp_user_name="abc";
$ftp_user_pass="mypasssword";

$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
    echo "Successfully written to $local_file\n";
}
else {
    echo "There was a problem\n";
}
// close the connection
ftp_close($conn_id);


?>

500:内部服务器错误

当无法实现服务器上运行的脚本或文件或目录的权限分配不正确时,会生成此错误

故障排除建议:

通过重命名.htaccess文件(如果存在)暂时禁用任何重写规则。

确保任何CGI或Perl脚本至少具有.755。权限。

如果尝试运行PHP并且出现此错误,则/ cgi-bin中可能包含无效的php.ini,或者可能缺少此文件夹中的php.dat文件。

.HTACCESS FILE

Options -Indexes

FTP查看

enter image description here

enter image description here

0 个答案:

没有答案
相关问题