LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-31-2014, 12:16 PM   #1
MichaelGMorgan
LQ Newbie
 
Registered: Jan 2011
Posts: 14

Rep: Reputation: 0
2MB Upload Limit - Not The Usual Issue


Hi,
I'm having an issue with a dedicated server.
It's a typical web server, Apache, PHP, etc.
It's running WHM + cPanel with a few accounts on it.

There's a problem with one particular account which is running WordPress - I can't seem to upload any files larger than 2MB in size. I've tried using the WordPress uploader and I've written a completelt seperate PHP script which also fails.

When trying to upload a file, there's no errors or anything - it's as if the file wasn't selected. Anything 2MB and under works perfectly.

I've gone through all the usual PHP configuration, I've set the upload_max_filesize and the post_max_size to both be 1G (I've tried various values here). I've increased the total execution time, etc. All of this I've done globally via php.ini

Running phpinfo() shows these values are being saved and are correct.

On all other user accounts it works fine and I can upload files right up to my 1GB limit without any problems.

Can you suggest what I can try to resolve this? I've tried everything I know!
Any help & suggestions appreciated!

Thanks
 
Old 08-01-2014, 05:43 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

The settings upload_max_filesize and post_max_size are both PHP_INI_PERDIR which means you can override the settings in a .htaccess file or in the Apache configuration with php_value. So make sure you run phpinfo() in the directory of that account. It could be you get a different local value than the master value.
 
Old 08-01-2014, 06:10 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Also check what version of Wordpress is installed.

I believe the MS (Multi-Site) version of WPress has an admin option that specifies the maximum media file upload.
 
Old 08-01-2014, 08:03 AM   #4
MichaelGMorgan
LQ Newbie
 
Registered: Jan 2011
Posts: 14

Original Poster
Rep: Reputation: 0
I've checked all the .htaccess files including one in the users home dir and in the public_html dir.
I've even tried removing them entirely, still the same issue.

I am running phpinfo() within the public_html directory of the users home directory.
It's not being set by PHP at the script level because I've written my own bit of PHP to test it, and yet it still doesn't work.

It's just plain old WordPress. I'm pretty sure it's not WordPress related as the issue also happens when testing with my own standalone upload script.

Any other suggestions?
 
Old 08-01-2014, 08:53 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Moderator Response

Moved: This thread is more suitable in <Linux - Server> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 08-01-2014, 09:03 AM   #6
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

You can't set upload_max_filesize or post_max_size at script level, it doesn't work. The limiting happens before any script starts. I really can't think of what it could be. But some more tips for debugging it:

error_reporting(E_ALL);
ini_set('display_errors',1);
Output ini_get('upload_max_filesize') and ini_get('post_max_size') in your test script.
do a var_dump($_FILES) - (On some errors, there will be something in $_FILES[name]['error'])
check the error logs.

Also I think I remember a case where it would not log anything if post_max_size was too low. If upload_max_filesize was reached there was something in the log.

Some older versions of PHP/servers use Suhosin. You can set some limits there, but I can't think of any that will limit the file upload size to 2mb. But you can set an "upload verification script" which could prevent files over a certain size to be uploaded.
 
Old 08-01-2014, 10:57 AM   #7
MichaelGMorgan
LQ Newbie
 
Registered: Jan 2011
Posts: 14

Original Poster
Rep: Reputation: 0
Here's my test script...
PHP Code:
<?php
error_reporting
(E_ALL);
ini_set('display_errors'1);
?>
<html>
<body>
    <?php
    
echo '<h1>$_FILES</h1>';
    
var_dump($_FILES);


    echo 
"<h1>Config</h1>";
    echo 
"upload_max_filesize: " ini_get("upload_max_filesize") . "<br/>";
    echo 
"post_max_size: " ini_get("post_max_size") . "<br/>";
    echo 
"<br/><br/>";
    
?>


    <form action="/cwd.php" method="post" enctype="multipart/form-data">
        <input type="file" name="file" id="file"><br>
        <input type="submit" name="submit" value="Submit">
    </form>
</body>
Here's the results from uploading a file less than 2MB...

Quote:
$_FILES
array(1) { ["file"]=> array(5) { ["name"]=> string(7) "sdf.jpg" ["type"]=> string(10) "image/jpeg" ["tmp_name"]=> string(14) "/tmp/phplkFwrS" ["error"]=> int(0) ["size"]=> int(163171) } }

Config
upload_max_filesize: 1G
post_max_size: 1G
Here's the results from uploading a 5MB file...

Quote:
$_FILES
array(0) { }

Config
upload_max_filesize: 1G
post_max_size: 1G
I really don't understand what's going on...
 
Old 08-02-2014, 04:44 AM   #8
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Yes strange. It doesn't seem like it's the upload size limits. Some other possibilities:

- You have disk usage quotas per user turned on, and the limit is almost reached. A small file is ok, but with a bigger you get over the limit.

- There's auto_prepend_file in some ini file and some other script is playing tricks on you?

The web server log says nothing at all?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can I limit total upload? Adol Linux - Newbie 1 05-19-2011 06:00 PM
[SOLVED] The Usual... a Broadcom 4311 issue Bull J Linux - Wireless Networking 7 04-28-2011 04:30 PM
limit upload deepaklukose Linux - Networking 3 10-02-2005 10:09 AM
How to limit upload speed for IP? wild_beast Linux - Networking 4 11-18-2003 01:14 AM
Quota issue, hard limit doesn't limit users Gratz Linux - Software 2 09-16-2003 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration