Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.