Domain = benchmarkstudio.biz
Dedicated Hostgator Server
PHP Version 5.4.45
Can check the info from the below link. https://benchmarkstudio.biz/phpinfo.php
Issue I have created a test form in the below link where it uploads the attached file in the directory given and prints the message. https://benchmarkstudio.biz/portal/upload-test/upload.php
Note It is an open link so my dev community can try it too.
When I try files less than 10MB it gets successfully uploaded. But when I try files larger than 20MB it gives me
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at webmaster@benchmarkstudio.transdata.biz to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.**
(I can't find any error logs related to this.)
Although php.ini settings are:
max_execution_time = 300
max_input_time = 60
max_input_vars = 1000
memory_limit = 128M
post_max_size = 32M
session.gc_maxlifetime = 1440
upload_max_filesize = 64M
upload.php code is below
<form name="form" method="post" action="upload_file.php" enctype="multipart/form-data" >
<input type="file" name="my_file" /><br /><br />
<input type="submit" name="submit" value="Upload"/>
</form>
upload_file.php code is below
<?php
if (($_FILES['my_file']['name']!="")){
// Where the file is going to be stored
$target_dir = "upload/";
$file = $_FILES['my_file']['name'];
$path = pathinfo($file);
$filename = $path['filename'];
$ext = $path['extension'];
$temp_name = $_FILES['my_file']['tmp_name'];
$path_filename_ext = $target_dir.$filename.".".$ext;
// Check if file already exists
if (file_exists($path_filename_ext)) {
echo "Sorry, file already exists.";
}else{
move_uploaded_file($temp_name,$path_filename_ext);
echo "Congratulations! File Uploaded Successfully.";
}
}
?>