简体   繁体   中英

image is not uploading even though changing in php.ini file

I have increased the value of my php.ini file in my VPS then I have restarted my server + restarted service. Still it is not upload the more than 5 MB. I am using following code for uploading . I am uploading images with correct image extension validation.

$target_path = "uploads/"; 
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; 
}
else{ 
    echo "There was an error uploading the file, please try again!"; 
}

There are several options that effect the maximum upload size I believe, have you tried increasing each of;

post_max_size = 128M
upload_max_filesize = 128M
memory_limit = 256M
max_input_time = 60

ssh into your server, type sudo tail /var/log/apache2/error.log and post the output into your question.

请尝试在php.ini配置文件中增加max_execution_time

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM