I have a website built with CodeIgniter which, for the admin area, is using CKEditor and CKFinder to write posts for the news section.
The CKFinder image uploader was working with no problems, but two days ago I had to move the files on another server. Till then I get the 500 error when trying to upload images.
Behavior:
I open the Upload image modal window. I browse and select an image and when I click the Send to server button I get a 404 error message (the custom 404 page of CodeIgniter). In firebug it shows that there is a 500 internal server error.
File path is plugins/ckfinder/core/connector/php/connector.php and it exists on the server.
I managed to find out the problem was a file permission issue. The folder in which I have to save the images had 777 permission (and for the old server was the good one) and it needed 755 permissions.
To debug this issue i have to add :
ini_set('display_errors', 1);
error_reporting(E_ALL);
in the followings files: config.php and ckfinder.php in the root of the directory ckfinder.
Related
I have the following code in my localhost project in WAMP
<img src="/imgs/quickstartVideo.jpg" width="357" height="200" alt="quick start video">
The image won't appear - console says "403 (forbidden)". However, if I right click to view the page source, and click the image's link, the image appears.
The page loads js and css files that are using the same sort of relative URL.
Why does it tell me it's forbidden, yet lets me load it when I click it? How do I get it to just load please?
My dir structure is:
c:\wamp
c:\wamp\www
c:\wamp\www\imgs
c:\wamp\www\js (js files are loading fine)
UPDATE: it's displaying correctly in MS Edge, but not Chrome.
Thank you
Solved -the issue was an IfModule mod_rewrite I'd set up in htaccess to stop image hotlinking on my production domain. Commented it out for localhost development, and, funny enough, my images are working again.
Until yesterday, I was able to use CKFinder with CKEditor 4 to upload images to the server and add them to the inline CKEditor.
Now, all of a sudden, I'm getting a 405 (Method not allowed) error when trying to upload an image. CKFinder itself is returning "Error 10: Invalid command". This happens even if I re-upload images that I uploaded before.
I am able to see the contents of userfiles in CKFinder, so it's not a matter of a wrong directory. Also, I've tried adding
config.filebrowserUploadMethod = 'form'
to config.js, but my browser console's Network tab still shows the outgoing request as 'xhr'. Don't know if that's relevant.
Can anyone help? Again, this worked fine yesterday, I have no idea what has changed.
Here's the network tab output for the failed upload:
Actually, in my localhost, my website run without any problem.
However, in the living server, there are some problem of showing image.
If I put image in the web root, image can be showed in web. But if I put image into folder, image can't be showed.
Example:
/post/1/1.jpg
If I click the link directly:
http://website/post/1/1.jpg
it will be error 403. As below:
Forbidden
You don't have permission to access /post/1/1.jpg on this server.
Server unable to read htaccess file, denying access to be safe
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Discover some hints:
If I put all files into the web root, including codeigniter framework itself.
The website run without any problem.
However, it is not the good practice. Actually, I want to put the codeigniter framework out of the web root.
Open your FTP via Filezila or any other program. navigate to your root folder and find the folder /post/ right click on it and change the select File Permissions... change it to 755 and re view the image in the browser.
Thanks for all reply.
I find the solution.
1) codeigniter framework can place out of web root without changing .htaccess file.
2) folder of image should be place under web root.
3) make sure the folder of image are 755 / 777 file permission.
There is a issue in wordpress for uploading image at the time of creating an article.
Steps to regenerate the issue.
Posts -> Add new posts -> Add Media -> Upload files.
Select a Image to upload, Upload process will start.
it gives an error "An error occurred in the upload. Please try again later."
Then go it Media ->Library
The image is uploaded in the Library, sometimes image is being uploaded multiple time.
Make sure you set permissions 777 on upload folder ? if you set 777 already and problem is still there then this is about your theme problem you should contact to your theme provider..
I have integrated browse button in ckeditor. The file is uploading but it gives "Image souce URL is missing" and not showing the image.
How can I solve this problem?
Regarding your question, most likely you're executing a cross-domain request, which is disallowed with a regular browser configuration due to several security concerns.
I solved this problem by moving the CKEditor folder to the webroot of cakephp from the js folder inside the webroot and giving the full URL in CKEditor.replace function of the view file.