在为我的Magento商店上传新产品图片时,我遇到了以下错误.
Resource interpreted as image but transferred with MIME type text/html
Run Code Online (Sandbox Code Playgroud)
有没有理由发生这种情况?
我正在运行一个应该运行至少30分钟的脚本,但脚本会在30秒后停止...
我不确定为什么之前它在其他服务器上工作.
有什么地方我需要检查吗?
有没有办法我们可以使用 file_get_contents 然后 ftp 文件上传从 file_get_contents 获取的文件到远程站点?
我有下面的代码,但出现错误:
<?php
ob_start();
$file = 'http://test4.*****.com/';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new person to the file
$current .= "John Smith\n";
$host = 'ftp.******.com';
$usr = '*******';
$pwd = '*******';
$local_file = $current;
$ftp_path = 'test4/resources-test.php';
$conn_id = ftp_connect($host, 21) or die ("Cannot connect to host");
ftp_pasv($conn_id, true);
ftp_login($conn_id, $usr, $pwd) or die("Cannot login");
// perform file upload
ftp_chdir($conn_id, '/public_html/');
$upload = ftp_put($conn_id, $ftp_path, $local_file, …
Run Code Online (Sandbox Code Playgroud)