Troubles with Drupal IMCE image upload - drupal

I got some problems with Drupal's IMCE module. When I try to upload inline images from admin, it doesn't upload any images. I get this JS error on firebug:
"NetworkError: 404 Not Found - http://www.mydomain.com/imce?jsop=upload&dir=."
If I go to that URL it gives me 404 not found page. If I go on my other Drupal that uses same system, it gives me JSON data result with same URL. Settings are same. And it has worked before on both systems. Now just it stopped on another one.
Also all the files folder should have correct rights. Is it some JS thing or? Anyone have had anything similar?
Thanks!

Yeah, I was having this issue too. For me it was a conflict with the Fast 404 module I had installed also. If you've got that module installed try disabling it to see if it fixes the problem. If it does then you'll want to look into using an advanced config for fast 404. Details of that are outlined in the readme.txt file in the fast_404 module dir.

I have had this problem too.
instead of disabling the module, I whitelisted the string jsop in sites/default/settings.php
$conf['fast_404_string_whitelisting'][] = 'jsop';
That fixed the problem.
Important: If you are editing sites/default/settings.php, first give write permission to that file first. edit it, and dont forget to set permission to 444 after editing.
Here is why

I fix my problem with this missing line in settings.php:
$conf['404_fast_paths_exclude'] = '/\/(?:styles|advagg_(cs|j)s)|(?:system\/files)\//';

Related

Is there a reason certain PDF's give me an error in WordPress when I try uploading them? [duplicate]

Does anyone know what this error message on WordPress means?
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.
I couldn't find any errors that I can think of.
This happened when I tried to upload an MP4 file that is about 200MB in size. I have set my WordPress to accept MP4 of up to 5GB so that shouldn't be a problem, I am using WordPress Multisite installation on Ubuntu 16.04.
In my php.ini I have set the max upload size to 50GB and max post size to 50GB too and I also set the max memory to 1GB. But it just kept sending me that error and I have no idea where to look. All it says was an unexpected response and I have no idea what response that might be.
I can upload MP4 with a size of 27MB with no problem, I know the default WordPress setting is 20MB so I'm pretty sure the size isn't the problem.
I have also check that the file wasn't corrupted, it was working fine on my computer as well as YouTube.
I tried restarting PHP (PHP-FPM) and Apache2 but it doesn't seem to be working.
Does anyone has an idea of what is going on? Thanks 🙌
I think my answer is too late. but I would like to post a solution for anyone still looking for a solution for this issue on WordPress running on Nginx.
You should add the following directive to set the maximum allowed size in HTTP(server/location) section.
client_max_body_size 10M;
I have understood why this WordPress error occurs "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.", atleast in my case :D
Issue:
If you can upload any other file except this specific one, then it is an issue with the file's size.
Solution:
In my case everything was correct - upload limits, post_max_size, memory_limit etc but if you are using NGINX, the possible issue is with client_max_body_size
Step 1: In your nginx.conf file, increase the value of "client_max_body_size" to 256M (or more as needed).
Step 2: Restart nginx.
Now you can reload the media library and try uploading the file again. To be on the safe side, rename your file before uploading.
The mentioned error is generic, it may refer to more than one possibility, so check this out:
Maybe you enabled Cloudflare with basic plan in your hosting, if so, Cloudflare limits the upload to 100 MB.
Maybe you mixed content on your website, with some pages refering to http and other pages refering to https. If so, please check the link: https://websitesetup.org/http-to-https-wordpress.
Maybe you installed security plugin.
Deactivating "All in one WP security" did the trick. You can re-enable it after the upload.
I had the same issue and tried all of the solutions above but had no luck. I ended up using this plugin and it worked automatically. No idea why bc I didn't increase the max upload size or anything. I noticed in their reviews someone else had the same issue. So hopefully it'll help someone else out there!
https://wordpress.org/support/plugin/tuxedo-big-file-uploads/reviews/
This appears to be an issue with the newer versions of WordPress themselves, rather than anything server side.
It appears to be a known issue to WordPress developers that is being investigated (eg: https://core.trac.wordpress.org/ticket/48778)
I faced the same error and finally it was fixed.
you may installed maximum upload plugins and its configuration is different than your host configuration, for example: if you set max upload from the plugin to 512M and your host configuration is 64, your browser will show your maximum upload as 512M not 64, but later after uploading the unexpected error will display.
the solution : remove the max upload plugin as it my conflict with configuration.
and if you host your website with shared server service, call the support to update the max upload size for you
I had the same problem a number of times and again today. My client was trying to upload PDF's to the media library that were not large and he was getting the error message "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page" The files were mostly around 1.6mb. Some worked, some didn't. They would upload but the preview of the file would not show in the media library. I tried using the Browser upload method also. Same result only once the upload completed we would get a 404 page not found error.
Ultimately I figured out the issue was an unsupported font used in the PDF files called ZeitungPro-Regular. When I opened the file in Adobe Acrobat DC Adobe showed the error message "Unrecognized font". I switched over to edit mode and changed the font to Arial Narrow as a test. Saved it and uploaded it and it worked! The issue was not with the server or the site set up, the issue was that WordPress could not process that font after uploading the file. If you are getting the "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page" check the file you are uploading carefully.
For people using the Wordfence security plugin, I had the same issue combined to other listed here. Max upload size, nginx client_max_body_size, it finally worked but only for admins.
Then I had to switch the Wordfence firewall in learning mode and let users upload their large file, and turn the firewall back to production mode. Long calls to admin ajax were blocked.
Hope this helps.
I came looking for a solution to this same problem. What caused the problem was an apostrophe in the file name. Simply removing that allowed the same file to upload without an issue.
I also faced the same error. I just deactivated the wordfence security plugin and now it's work fine. Hope help someone.
I had the same problem on Windows when I upgraded PHP to a newer version.
The problem was that the /logs and /tmp folders did not exist in the new PHP folder as it was set to c:\php\logs and c:\php\tmp in the php.ini file.

Wordpress uploading .docx file via Media Library Unexpected response from the server [duplicate]

Does anyone know what this error message on WordPress means?
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.
I couldn't find any errors that I can think of.
This happened when I tried to upload an MP4 file that is about 200MB in size. I have set my WordPress to accept MP4 of up to 5GB so that shouldn't be a problem, I am using WordPress Multisite installation on Ubuntu 16.04.
In my php.ini I have set the max upload size to 50GB and max post size to 50GB too and I also set the max memory to 1GB. But it just kept sending me that error and I have no idea where to look. All it says was an unexpected response and I have no idea what response that might be.
I can upload MP4 with a size of 27MB with no problem, I know the default WordPress setting is 20MB so I'm pretty sure the size isn't the problem.
I have also check that the file wasn't corrupted, it was working fine on my computer as well as YouTube.
I tried restarting PHP (PHP-FPM) and Apache2 but it doesn't seem to be working.
Does anyone has an idea of what is going on? Thanks 🙌
I think my answer is too late. but I would like to post a solution for anyone still looking for a solution for this issue on WordPress running on Nginx.
You should add the following directive to set the maximum allowed size in HTTP(server/location) section.
client_max_body_size 10M;
I have understood why this WordPress error occurs "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.", atleast in my case :D
Issue:
If you can upload any other file except this specific one, then it is an issue with the file's size.
Solution:
In my case everything was correct - upload limits, post_max_size, memory_limit etc but if you are using NGINX, the possible issue is with client_max_body_size
Step 1: In your nginx.conf file, increase the value of "client_max_body_size" to 256M (or more as needed).
Step 2: Restart nginx.
Now you can reload the media library and try uploading the file again. To be on the safe side, rename your file before uploading.
The mentioned error is generic, it may refer to more than one possibility, so check this out:
Maybe you enabled Cloudflare with basic plan in your hosting, if so, Cloudflare limits the upload to 100 MB.
Maybe you mixed content on your website, with some pages refering to http and other pages refering to https. If so, please check the link: https://websitesetup.org/http-to-https-wordpress.
Maybe you installed security plugin.
Deactivating "All in one WP security" did the trick. You can re-enable it after the upload.
I had the same issue and tried all of the solutions above but had no luck. I ended up using this plugin and it worked automatically. No idea why bc I didn't increase the max upload size or anything. I noticed in their reviews someone else had the same issue. So hopefully it'll help someone else out there!
https://wordpress.org/support/plugin/tuxedo-big-file-uploads/reviews/
This appears to be an issue with the newer versions of WordPress themselves, rather than anything server side.
It appears to be a known issue to WordPress developers that is being investigated (eg: https://core.trac.wordpress.org/ticket/48778)
I faced the same error and finally it was fixed.
you may installed maximum upload plugins and its configuration is different than your host configuration, for example: if you set max upload from the plugin to 512M and your host configuration is 64, your browser will show your maximum upload as 512M not 64, but later after uploading the unexpected error will display.
the solution : remove the max upload plugin as it my conflict with configuration.
and if you host your website with shared server service, call the support to update the max upload size for you
I had the same problem a number of times and again today. My client was trying to upload PDF's to the media library that were not large and he was getting the error message "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page" The files were mostly around 1.6mb. Some worked, some didn't. They would upload but the preview of the file would not show in the media library. I tried using the Browser upload method also. Same result only once the upload completed we would get a 404 page not found error.
Ultimately I figured out the issue was an unsupported font used in the PDF files called ZeitungPro-Regular. When I opened the file in Adobe Acrobat DC Adobe showed the error message "Unrecognized font". I switched over to edit mode and changed the font to Arial Narrow as a test. Saved it and uploaded it and it worked! The issue was not with the server or the site set up, the issue was that WordPress could not process that font after uploading the file. If you are getting the "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page" check the file you are uploading carefully.
For people using the Wordfence security plugin, I had the same issue combined to other listed here. Max upload size, nginx client_max_body_size, it finally worked but only for admins.
Then I had to switch the Wordfence firewall in learning mode and let users upload their large file, and turn the firewall back to production mode. Long calls to admin ajax were blocked.
Hope this helps.
I came looking for a solution to this same problem. What caused the problem was an apostrophe in the file name. Simply removing that allowed the same file to upload without an issue.
I also faced the same error. I just deactivated the wordfence security plugin and now it's work fine. Hope help someone.
I had the same problem on Windows when I upgraded PHP to a newer version.
The problem was that the /logs and /tmp folders did not exist in the new PHP folder as it was set to c:\php\logs and c:\php\tmp in the php.ini file.

Cannot access configuration page in drupal 7 site

I am currently building a website using drupal 7.x. Unfortunately I cannot seem to enter the admin/config page. Every time I click on the configuration tab on the administration menu, I only get a blank page. Then I created another sample site. It also has the same problem and I am using WAMP server. I cleared cache and finds no difference. I have searched for similar issues, but could find none. Can someone please tell me what I am doing wrong?
A number of things can cause the White Screen of Death, but the most common things to check:
As suggested above, memory limit may need to be increased.
Have you enabled any modules other than those in Drupal core? Try disabling contributed modules and enable individually until you experience the error, to help you identify which module is causing trouble. If you can't access the modules admin page, you can disable them in the database - the system table has a 'status' field. 1 means enable, 0 is disabled.
Could it be a permissions issue? Check admin access permissions or try logging in as the superuser (user ID 1).
Lots more and discussion here and here.
Finally I got the answer. Increase the max_execution_time in php.ini file. It solves the issue.
A few things to try...
Check your php error log for clues.
Create a simple file that calls phpinfo() and see what your memory_limit is. It may need to be increased.
Try tweaking your php.ini to get it to display an error message instead of a blank page.
I tracked this very issue to l10_update module, once I enable it, admin/config shows the WSOD. Once I disabled it, everything's fine. So:
- unchecking the localization_update module in the "modules" list
- de-installing it from the modules list
- deleting directory sites/all/modules/l10n_update
- and re-installing the module (from the same tar.gz file)
Source: https://www.drupal.org/node/1141160

'Dynamically-related files could not be resolved' error in Dreamweaver

I'm using Dreamweaver (CS5) to manipulate a Wordpress template, however when I try and use 'live view' on a themes index.php file I receive the error:
"Dynamically-related files could not be resolved because of an internal server error".
My local host however appears to be working fine and correctly displays the index.php file located on my top tier directory.
Many users have resolved this error by turning perma-links to default, however mine are already set this way.
Any help would be appreciated.
This isn't a solution, but merely a reference for someone else who is having a similar issue.
I had the same issue using the /%postname%/ permalink structure, but when I returned to the "Default" structure, it discovered the files fine.
If you're just testing a design before implementation, I suggest leaving it to "Default" on your testing server. Or, if you haven't already, create a testing server.
I had the same problem i fixed by changing Permalinks to custom structure and below there is Option ->category base give a name and try it. Dreamweaver knows all dynamically related files after all.
Selecting default permalinks structure also works on DW CS5. Hope this helps.

Wordpress Blog :: 500 Internal Server Error

I am getting this error message while trying to access a wordpress blog which is installed in a directory. Is this due to .htaccess or something? Any help is appreciated.
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#xxxxx.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache Server at xxxx.com Port 80'
This is almost always a problem with your Apache configuration. Errors originating in PHP won’t trigger the Apache 5xx handler, which is what you’re seeing.
Unfortunately, without more information, your problem is impossible to diagnose. I’d recommend that you:
Check the logs. First thing! It should give you a better idea where your problem is.
Stop and restart Apache. If there is a problem with permissions on something Apache needs write access to (logs), it could completely fail to start. This should give you the proper motivation to fix the problem, particularly if there are other VirtualHosts on that Apache.
Move your .htaccess file(s) somewhere else. If Apache works, you know it’s a problem with that file.
It sounds like you're getting some sort of PHP error but PHP isn't set to display errors. You'll want to check your Apache logs for detailed error info.
The mostly likely culprit is that you're missing some prerequisite for running WordPress, although all you should really need is Apache, MySQL, & mod_rewrite.
I was able to fix it by adding the following line to my .htaccess file:
php_value memory_limit 128M
Russ
This is happening to me RIGHT NOW.
As to from what I know, my hosting providers did a DNS change and so I'm waiting for the DNS to propagate, it's been like three hours and still zero.
Blog is showing ok, apache is up and working, I just can't get access into the WP Admin area.
If it does get fixed by tomorrow, I'll reply here so it can be of help for others.
Edit: I just fixed my problem.
In my case it was determined that the Fast Contact Form plug-in was creating the problem. I modified the folder name from si-contact-form to si-contact-form-hold then I regained WP Admin access.
After that I created a php.ini file with this string inside 'memory=64MB' and saved that into the wp-admin folder.
Manually deleted the si-contact-form-hold (to avoid possible corrupted files) and reinstalled the Fast Contact Form.
All my settings were already there and everything is back up and running good!
Hope this helps.
Look at http://zemalf.com/1470/wordpress-htaccess-the-definite-guide/, and look for the paragraph which says something like "Good and default .htaccess looks like this...."
My issue was a little bit different. I had an .htaccess file inside the wp-admin directory. I deleted the .htaccess inside of wp-admin and that fixed my problems.
Unfortunately it could be anything. Do static pages on the site work properly.
Have you checked the server logs.
I think it is likely to do with php. If static pages are there then possibly your config for wordpress is incorrectly configured or files missing.
Has php be working? Did the blog work and then stop? Did you get through the install process?
Check wordpress files ownership for the user are correct or not.
In linux ls -laZ command will display the ownership.
For setting the ownership for a folder use this command
chown -R username:username /user/username/public_html/
An HTTP 500 error could be caused by a great many things. Have you changed your .htaccess file recently? If you try to use a .htaccess feature that is disabled on your host, that is one possible cause.
Some more points
Blog has been running successfully. Just observed this problem since yesterday.
Blog is in a directory so it works something like this www.xyz.com/blog. Apparently www.xyz.com is working perfectly.
Update on logs
Getting these two errors in the logs:
File does not exist: /home/directory/public_html/500.shtml
/home/sub-directory/public_html/sub-directory/.htaccess: RewriteCond: bad argument line '%{REQUEST_FILENAME}!-f'
/home/directory/public_html/sub-directory/.htaccess: # without matching # section
How do I restart apache on cpanel ?
memory = 64MB;
The above line inside a php.ini file uploaded to the wp-admin folder solved my problem. I was not being able to log into the dashboard either through /wp-admin or /wp-login.php, and was getting a HTTP server error 500.
There can be multiple causes for this, I just solved mine, after 2-3 hours of going crazy.
I had another WP instance in a subdirectory inside the main WP instance (in the root folder).
Have checked / deleted .htaccess
deleted plugin folder
In the end, it was to do with the permission of the subfolder in which second instance was running. It was originally 775 (write permission for group), I had to change it to 755 (no write permission for group) and this finally fixed it, like magic.
This is of course just one of possible the answers to your question, I wanted to write it down though as I didn't find it explicitly written anywhere so it might save others some time.

Resources