Can Not Increase File Upload Size Wamp

Can not increase file upload size and execution time in phpmyadimin in WAMP

In WAMPServer 2.5 the PHP limits applied to phpMyAdmin can be found in this file \wamp\alias\phpmyadmin.conf

It was done this way so that you do not have to mess with php.ini to increase these parameter which of course would effect every site that you may be developing/maintaining.

This is what the file looks like:

# to give access to phpmyadmin from outside 
# replace the lines
#
# Require local
#
# by
#
# Require all granted
#

<Directory "d:/wamp/apps/phpmyadmin4.1.14/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from localhost ::1 127.0.0.1
</IfDefine>
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
</Directory>

So if you want to increase these parameters mentioned at the bottom of the file, do it in this file and it will only effect phpMyAdmin and nothing else.

How to increase server file upload limit in bemusic?

it probably wasn't the config file, make info.php for check the configuration file. check Loaded Configuration File and upload_max_filesize

<?php
echo phpinfo();
?>

Set max file size PHP

You need to put the validation checks inside the for loop that processes each file.

ALso, your limit on the number of images is wrong. You need to compare the number of files that were uploaded to $img_limit, not compare $img_limit to the same value you initialized it with.

I've taken the redirect and exit out of the loop, because that will redirect after uploading the first file. I've also taken prepare and bind_param out of the loop, since the same prepared statement can be used for each file.

$date_time = date('Y-m-d_H-i-s');
$img_limit = 10;
$maxsize = 3367463;

if(isset($_POST['submit'])) {
$errors = '';
$file_count = count($_FILES['files']['name']);

if ($file_count > $img_limit) {
$errors = 'Cannot upload more than 10 images';
}
if (!$errors) {
$stmt = $con->prepare("INSERT INTO images (image) VALUES (?)");
$stmt->bind_param('s', $file_path);
// Loop through each file
for( $i=0 ; $i < $file_count ; $i++ ) {
$file_name = $_FILES['files']['name'][$i];
$file_size = $_FILES['files']['size'][$i];
$file_tmp = $_FILES['files']['tmp_name'][$i];

$imageFileType = strtolower(pathinfo($file_name, PATHINFO_EXTENSION));

if ($file_size >= $maxsize) {
$errors = "Your file is too large";
} elseif ($imageFileType != "jpeg" && $imageFileType != "jpg" &&
$imageFileType != "png" && $imageFileType != "gif") {
$errors = "File type not allowed.";
}
//Make sure we have a file path
if (!$errors && $file_tmp != "") {

$picToUpload = $date_time . " -#- " . md5($file_name) . " -#- " . $_FILES['files']['name'][$i];
$uploadPicture = move_uploaded_file($file_tmp, "uploads/" . $picToUpload);

$file_path = "uploads/" . $picToUpload;
$stmt->execute();
}
}
}
}
if ($errors) {
$_SESSION['error'] = '<b><p style="color: #000; font-size: 30px; top: 34%;right: 50%;position: absolute;">
' . $errors . '</p></b>';
}
header('Location: index4.php');
exit();


Related Topics



Leave a reply



Submit