cannot show image in codeigniter - image

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.

Related

SFTP Login Success - 404 Error In Browser

This is my first time working with SFTP. I'm used to using a cPanel with a hosting company (like JustHost or GoDaddy, etc.).
I'm able to log in to my SFTP server through FileZilla and I'm able to upload files onto the server but when I go to visit the page on my web browser, it gives me a 404 error. For example, let's say my IP address for the server is:
123.45.67.89
I have the logins and I use them in FileZilla and put files in. And then I want to navigate to a file (in this case I'll use the phpMyAdmin directory I've created since that's what I'm trying). In the browser I write:
123.45.67.89/phpMyAdmin/setup/
This directory exists and has an index.php file in it but when I try to go to it, the browser gives me a 404 error. Am I missing a step here? Do I need to somehow work the login credentials into the URL? I've tried other paths too and they don't work either.
Thanks for your help!
EDIT
I just realized that with SFTP, the browser uses the information that's in the /var/www/html/ folder to display. I can navigate to those directories by just simply typing the directory name in. I suppose my question now is how do I get to the root directory in my web browser. Using just the 123.45.67.89/ defaults to the /var/www/html/ folder...
Which web server do you use? If it's Apache you should learn about apache virtual hosts and modify the apache configuration file (usually on /etc/apache2).
See here for more details.

Joomla Temporary URL images forbidden 403

I have setup a development server for an issue(see No Input File Specified - Joomla), all is working correct now on the development server apart from no images on the site or inside the administration menu are loading.
When I try to look at them individually they are 403 forbidden.
http://37.26.108.168/~arbersho/
All directories are 755, all files are 644 and the owner is the correct one.
Is this because of the temporary URL and will this be fixed by pointing the domain over?
Thanks again
This was a htaccess issue which is fixed.

Forbidden You don't have permission to access /appetitclic/wp-content/themes/Apc/img/logo.png on this server

Hello all :)
I am currently working on a WP website and a the moment I am working locally with Wampserver.
None of my pictures happen to appear on my website.
Here is the error I get when I put the image url in my browser :
Forbidden
You don't have permission to access
/appetitclic/wp-content/themes/Apc/img/logo.png on this server.
I have no problem accessing phpmyadmin and image from TewentyTwelve template work fine.
Things I have tried :
-Editing (and creating) .htaccess in wp-admin.
-Editing phpmyadmin.conf
-Puting Wamp on online mode
-Working through http://127.0.0.1/ instead of locally.
I am pretty sure the problem doesn't have to so with the code because I have access to the /appetitclic/wp-content/themes/Apc/img/ folder and I see the list of images (not working). I maybe missed one or two workarounds but I am pretty sure I tried most of the common ones.
If you need any info on my setup / configs I have tried ask away.
Thank you very much,
Cheers.
If you start your relative url with a backslash '/' that means go to the servers root folder and work up from there.
Try loosing the leading slash and see what that does.
I have that same problem when I downloaded random images for img preloading testing.
So I went to change permission from no access to read & write (if on Mac then > Get info. You shall see that permission section at the very bottom).
You might use chmod to change permission to particular users.
Hope this help.
I had the same problem today. I created a static webpage put in the html folder of my web server. It turned out that some images could not be loaded. The solution is quite simple. I just right click the image folder and changed the properties to allow readers to view the images.

CodeIgniter uploads directory

I'm trying to achieve:
I am using CodeIgniter.
I am trying to access http://localhost/mywebsite/uploads/. The directory exists, and via a 3rd party upload script, I can successfully write to that directory. However, when going straight to the URL (or referencing its files in an src attribute), it gives me a 404 error.
I thought the best way to do this was to:
Make sure my $config['base_url'] was set to http://localhost/mywebsite/.
(For an unknown reason, I can access /mywebsite/js/ but not /mywebsite/uploads/.)
I read the documentation and it said to:
Create a folder at the root of your CodeIgniter installation called
uploads and set its file permissions to 777.
That works to upload to, but it doesn't work to access from!
I did it, I expected to see:
Either a directory listing or permission denied page. I even tried going straight to a file, like http://localhost/mywebsite/uploads/myfile.jpg.
Instead, I saw:
404 Page Not Found
The page you requested was not found.
What am I doing wrong?
Please check your .htaccess file,
there shouldn't be any rule to restrict the access to the uploads folder.
("uploads" should not appear within this rule: RewriteRule ^(css|js|ckeditor) - [L])

codeigniter : unable to access image inside view folder

am using codeigniter 2.
when i use the below i cant get the image.
application/views/admin/images/image.png
folder structure is correct.but the image is not coming there.from view
source option i got the following
403 Forbidden
Forbidden
You don’t have permission to access /application/views/admin/images/image.png
on this server.
am on local server wamp.
if i put the image on root i can get it
but i was uing similar folder structures with codeigniter 1.7.3 those were working for me
i dont know why its not with ci2 or i mde any mistake…..
Only .php view files are supposed to exist within the /application/views directory. You should store images in a directory like /images or /assets in the web root.
there may be .htaccess file in your root what deny write.
Rename .htaccess and try again.
if it works, you may edit .htaccess

Resources