I have a 'curl' code in php as
$ch = curl_init("http://www.abcd.in/upload.php");
curl_setopt($ch, CURLOPT_POSTFIELDS, array("file" => "@$file", "file_name" => "$file_name"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
curl_close($ch);
the upload.php is as
$file = $_FILES["file"]["tmp_name"];
$file_name = $_POST["file_name"];
$file_extension = substr(strrchr($file_name, '.') , 1);
$path = "uploads/".date("YmdHis", time()).uniqid().".$file_extension";
move_uploaded_file($file, $path);
after executing this code although the image is getting uploaded,I am getting a Internal Server Error-500. How can I overcome this?
CURLOPT_POST
. 尝试查看apache日志错误并仅在安装时进行验证
sudo apt-get install curl php5-curl php5-xmlrpc
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.