Hope you can help!
I have a Wordpress site hosted with 1and1.com, and since upgrading to Wordpress 3.7.1 I have been experiencing errors with the uploaded media - specifically images.
When large images are uploaded and inserted in the post, they are given width='1' and height='1' values, which I have diagnosed to be an error caused by a failure of the media upload/crunching in the first place.
By testing uploads of varying filesizes and dimensions, I have discovered the errors occur when an image is over approximately 2.2 megapixels (tested successfully at 1700x1275, failure at 1800x1350) regardless of filesize. When an image is too large, the image uploads successfully in its original form, but the processing of thumbnails, medium and large versions fails and the Media Uploader returns "An error occurred in the upload. Please try again later."
After researching the problem, I have tested the following to no avail:
1) Disabling all plug-ins
2) Re-installing WordPress
3) Creating a php.ini file to increase memory-limit (tested memory-limit = 64M, memory-limit = 128M, memory-limit = 256M and memory-limit = 1024M). N.B. I also altered the maximum upload size in the php.ini file to test whether it was in the right directory, which it was.
I don't have access to Apache Error Logging as the hosting is on a shared server.
Also looking back through media/posts, it seems large images have been uploading incorrectly since the site was launched a few years ago, so the error is nothing to do with Wordpress 3.7.1. However, only in 3.7.1 are they displayed with width='1' and height='1' values, seemingly when it can't find medium, large or thumb versions?
If I can't find a way to get the image uploading/crunching to work, is there a workaround that could help with the width='1' and height='1' being outputted?
Related
I'm trying to upload an image to my WordPress site. The image is 5.6 MB big.
The resolution is 1920px x 1444px.
I've already uploaded a much smaller image (0.5MB / 939px x 471px). That worked fine.
I'm getting this error message: The server cannot process the image. This can happen if the server is busy or does not have enough resources to complete the task. Uploading a smaller image may help. Suggested maximum size is 2560 pixels.
WHAT I HAVE TRIED:
I have already tried a few things:
Changed the upload_max_filesize, post_max_size, max_execution_time in the php.ini File
(WordPress even says that the max size is 128M now)
Changed the 'big_image_size_threshold'
Uploaded the images to the Server via SFTP, renamed them according to the Other images that are in the Folder, but that didnt work as well
Installed a few plug-ins that change the max upload size. Didnt work either.
I've looked at so many websites, but they all gave me these as solutions.
Has anybody got any Idea? Thank you in advance.
WHAT I AM USING:
Operating System: Debian GNU/Linux 10 (buster)
PHP-Version: 8.0
WordPress Version: 6.1.1
Also I'm using Nginx not Apache2
Dean
1- try deactivating all other plugins temporarily , it may happen sometimes due to some plugin process the images before uploading to the server.
2- if you want to upload any file to the wordpress outside the wordpress dashboard make sure to use the plugin named " Add From Server " , for this case you first upload your file to the directory then u import them via this plugin to your wordpress database so it loads in the wordpress dashboard.
3- at last if you using any control panel to manage your server , check the php.ini setting in its control panel , sometimes setting in the server overwrite the local php.ini in your website directory.
This is not a quick failure, I have spent a totally of 5 completely full days trying to figure this out. Initially I was limited by file size and then file type; in which I removed the Wordpress restrictions and am now "capable" of uploading my 177MB .glb file to Wordpress.
However when doing so, I receive the following error:
retriever.glb
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.
I was on the phone with GoDaddy Specialists for 2.5 hours yesterday ensuring that this was not a Server issue or restriction on their side.. they confirmed that it was not. We pretty much ended the conversation that it is something I must figure out with me, myself, and I.
I went ahead and uploaded my .glb to the server through panel, everything worked fine. In fact I have a location for it here: https://www.tattiniboots.com/wp-content/uploads/2020/07/retriever.glb
However, this does not make the file discoverable to the 3D viewer plugins I have installed on the site through the media location.
I truly don't know where to go from here
I changed the name of the file to .png and attempted an upload and received the following error:
Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.
I just tried to update a normal .mov file that is 150MB and received the following error; really making me think this is something to do with file size:
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.
Yes, normal images are uploading just fine (2MB-ish)
I just attempted to deactivate all plugins with consideration that maybe "Smush" or another was imposing issues: I then received the issue that the file type is not supported (even with the allow all file types code in my wp-config)
Is this just the case that glb is not allowed at all?
This must be a server thing. probably a run time error
Whoever supported you just doesn't know it. GoGoDaddy. ;)
Nevertheless... you can Use a plugin that's called
media sync. Check it out and best of luck
I have a problem, where I get 500 internal server error when I try to upload an image that is too big in dimensions. The application works fine on one server and throws 500 internal error on the other. In both cases the application is on shared hosting but I do have some influence on hosting providers :)
So the problem is not the weight (MB) but the dimensions (px). Everything over ~1600px width, throws an error. The problem is that I cannot resize the image in PHP before I get the error. Because the app runs fine on one server and not on the other I presume it is some server restriction similar to one with weight (MB). Giving the user a custom error doesn't resolve the problem, because most users do not know how to resize the image.
Has anyone seen this kind of problem? Could this be some php.ini setting or something else?
#user805528
in order to tackle that issue, you need to grab the image, save to a stream (probably file system or php streams) and then calculate its dimensions using getimagedimensions
https://www.php.net/manual/en/function.getimagesize.php
In case your image doesn't meet your validation criteria, you need to throw an error to the end user and remove the image.
In any other case you can accept your image any way you would normally.
I would say that a webserver doesn't restrict image uploads by dimensions.
If you are sure that there's not some PHP function restricting the upload by image size in the code, I would suggest increasing these values in your server's php.ini file:
upload_max_filesize / memory_limit / post_max_size
I have my Laravel site set up and have an image uploading test page.
I am using Dropzone and the AWS S3 package to handle my image uploads to my S3 Bucket.
Locally, using mamp, I can upload any image without any issues. However when pushing to both a shared hosting and also FortRabbit I get 500 / 503 errors when uploading an image over X mb.
An image 330kb uploads fine, but an image that is 1mb / 700kb etc will not work.
The images are a mixture of png and jpg and some work some don't. All I can put it down to is the smaller images are working fine and the ones from my DSLR are failing.
The phpinfo() shows:
Which to me looks fine?
I am really stuck on where to look to debug this one. Maxfilesize in dropzone is also set as 10mb.
Check other php.ini config values, particularly upload_max_filesize.
I have a problem when attempting to upload really big files using PHP. I know this has been raised before and I have read many responses, but I have not found a definitive answer.
The basic code I use is posted here: http://design.wildsandwebdesign.co.uk/technical/uploading-files-2.php and I have used this with complete success for letting client upload image files, JPEG, GIF, png etc. The problem arose in allowing users to upload non-displayable files such as .psd files which can be very large.
In php.ini on both my local and remote servers upload_max_filesize and post_max_size are set to 128MB. The hidden field MAX_FILE_SIZE in the code has been set to various values during development. The problem is this: If the user selects a file bigger than the MAX_FILE_SIZE but smaller than 128MB,$_FILES['uploadfile']['error'] returns an error code of 2 as the PHP documentation says it will. If the file size exceeds 128MB then the upload handling fails altogether with bizarre results.
The “bizarre” results include irrelevant error messages such as “Undefined index: uploadbtn” this being the index of the submit button you have to click to get the error message(!) This happens with Firefox 26 and with Chrome. Bigger files can crash Firefox altogether which then displays the bug report dialog.
I don't want to upload files larger than 128MB, I just want to handle the situation where a user selects a very large file in some reasonable way. Does anyone know how to do this?
The production code is very much more complicated than the example above but I will happily provide it on request.
......