Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialCarla Thomas
Front End Web Development Techdegree Student 16,039 PointsI found "php.ini" but...
Using the "php.ini" file I have
(1) changed the post_max_filesize from 8M to 1000M; and (2) changed the upload_max_filesize from 5M to 1000M.
I have restarted XAMPP and the changes can be seen on the admin's media page...
...however, I am still getting the following error:
Maximum upload file size: 1000MB. Dismissโ015.gifโ has failed to upload due to an error The uploaded file exceeds the upload_max_filesize directive in php.ini.
Does anyone have any insight on how to solve this matter?
1 Answer
Lucas Krause
19,924 PointsPHP doesn't support an option called "upload_max_size". The option you are searching for is called "upload_max_filesize". ;)
Carla Thomas
Front End Web Development Techdegree Student 16,039 PointsCarla Thomas
Front End Web Development Techdegree Student 16,039 Points...that was a typo that I had written above..."filesize" is in fact what is used in my ini.php file.
Sorry about that...
Do have any insight on how to fix this problem?
Lucas Krause
19,924 PointsLucas Krause
19,924 PointsWhen you write "I have restarted XAMPP" I think you mean that you restarted the Apache, do you? If not, do so.
The error message doesn't seem to be an original PHP error message, rather a WordPress error message. I'm not sure if it describes the problem perfectly. Maybe the error doesn't happen due to your "upload_max_filesize" setting but due to another setting like "memory_limit" which can be reached really fast when uploading an processing huge files. Other related settings are "max_execution_time" and "max_input_time".
Moreover you can set a file size limit for file uploads using an input field with its name attribute set to "MAX_FILE_SIZE".
Unfortunately I can't think of other potential error sources.
Carla Thomas
Front End Web Development Techdegree Student 16,039 PointsCarla Thomas
Front End Web Development Techdegree Student 16,039 PointsIt's a small .gif of 6.01 KB (75x75)....Thanks for your help anyway :)
Lucas Krause
19,924 PointsLucas Krause
19,924 PointsHm... Maybe it's actually not the php.ini but a .htaccess file?
Carla Thomas
Front End Web Development Techdegree Student 16,039 PointsCarla Thomas
Front End Web Development Techdegree Student 16,039 Points...not sure what to do with the .htaccess file...do I need to do the exact same thing I did with the ini.php file?
Lucas Krause
19,924 PointsLucas Krause
19,924 PointsJust place the
.htaccess
file inside of the directory containing your PHP file and add the following line to it:php_value upload_max_filesize 1G
You can also set boolean settings using
php_flag
and add comments using a#
.Please note that you can't set all settings using a
.htaccess
file, see PHP documentation for more information about the different options.Carla Thomas
Front End Web Development Techdegree Student 16,039 PointsCarla Thomas
Front End Web Development Techdegree Student 16,039 PointsThanks for your patience with me Lucas...
Two questions:
(1) Do I create a .htaccess file; and (2) Is there a more specific name for the "PHP" file that is mentioned above?
Carla
Lucas Krause
19,924 PointsLucas Krause
19,924 PointsHi Carla.
Two answers:
.htaccess
file. If you want to create one you can simply create a new file, write "php_value upload_max_filesize 1G" (for example) to it and save it as ".htaccess" (without any file extension) in the directory containing your PHP file (see below) or one of its "parent" directories.Carla Thomas
Front End Web Development Techdegree Student 16,039 PointsCarla Thomas
Front End Web Development Techdegree Student 16,039 PointsThanks!!!!! :)
Lucas Krause
19,924 PointsLucas Krause
19,924 PointsMaybe you should also watch this video at about 4:20 ;)