PDA

View Full Version : Forbidden 403 errors / images broken


Ashe
09-16-2012, 10:06 PM
My members have been getting this message when they login:

"Forbidden

You don't have permission to access /adopt/login.php on this server.Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. "

It happens to a few members. But when I make new accounts myself, it works fine.

Also, I've tried putting the adoptables on other sites but it appears as a broken image. Is there a way to solve these issues?

Hall of Famer
09-16-2012, 10:33 PM
Well the 403 forbidden problem has something to do with your host. Consult them and see what they can do for you. Regarding broken images, well, you are gonna get broken images if you move your adoptables directories after uploading images, thats what happens. You can fix this manually though.

Ashe
09-16-2012, 10:54 PM
But the thing is, so far 1 member is getting the 403 error when she tries to make any account. She made like 3 and none work xD But other members are able to make accounts fine.

Adoptable directories? I'm taking a look. So all adoptables should be uploaded in picuploads/ ?

Hall of Famer
09-16-2012, 11:06 PM
umm this is weird, did you ask her to use a different browser? And is she living in US?

Well not really. The fact is that you should not move directories around after installing the site, it may result in broken images.

Ashe
09-16-2012, 11:13 PM
Oh I see. The file had 755 permissions (logout.php) so i changed it to 700 and it seems to work fine now for some...but not all.

As for the images, I never changed the directories o.o I created my own directory (maybe thats where i went wrong?) which was /stage1 and /stage2. The images appear on the adoptable site when you choose to adopt one. But when you want to place the code somewhere else, it shows a broken image. (also in the admin panel a broken image is shown)

Hall of Famer
09-16-2012, 11:19 PM
Well it is supposed to have 755 permission, this is weird...

umm so you are not using images uploaded in ACP? If you upload your images through ftp or an external source, you should not get broken image unless you have mis-linked your image url.

Ashe
09-16-2012, 11:27 PM
Well I tried the FTP image and it's not working but I also tried the admin panel and those wont appear either. Here's a screenshot.

http://i1154.photobucket.com/albums/p527/dragonsden425/Screenshot2012-09-16at92621PM.png

Hall of Famer
09-16-2012, 11:30 PM
umm I see. Did you specify the correct domain and script path in your config.php? Please show me the details you add to your config.php with your password censored. Perhaps this is where it went wrong.

Ashe
09-16-2012, 11:38 PM
Alright. Here's the config.php

http://i1154.photobucket.com/albums/p527/dragonsden425/Screenshot2012-09-16at93453PM.png

and here's the images path http://www.adragonsden.com/adopt/stage1/pika1.jpg (testing image, ugly lool)

Hall of Famer
09-16-2012, 11:50 PM
umm your config file appears fine. The problem is that you cannot manage images uploaded in ftp, at least at this point. You dont need to manage your images at all, just create an adoptable from ACP and enter your full image url (http://www.adragonsden.com/adopt/stage1/pika1.jpg) in the text field 'Adoptable's Egg (First) Image'. You can see how to do this from the screenshot below:

http://oi46.tinypic.com/wus27p.jpg

Ashe
09-16-2012, 11:58 PM
Yup. That's what I did. It appears on the site but not in the code that allows it viewable on other sites. Here's a page where I put the code it gave me to place on websites.

http://adragonsden.com/adopt/click.html

It names the img file ( http://www.adragonsden.com/adopt/siggy.php?id=8 )

Hall of Famer
09-17-2012, 12:15 AM
Oh you are talking about the bbcode? It seems that you have disabled the allow_url_fopen property in php.ini. For this reason you won't be able to read your image file from a different url. Do you have access to your php.ini file? If so, find the keyword 'allow_url_fopen' and set this value to be 'on'. And then, problem solved.

Here's what I found after seeing your siggy.php warning/error log, which confirms my conclusion:


<br />
<b>Warning</b>: readfile() [<a href='function.readfile'>function.readfile</a>]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in <b>/home/itsumoon/public_html/ash/dd/adopt/siggy.php</b> on line <b>146</b><br />
<br />
<b>Warning</b>: readfile(http://www.adragonsden.com/adopt/stage1/pika1.jpg) [<a href='function.readfile'>function.readfile</a>]: failed to open stream: no suitable wrapper could be found in <b>/home/itsumoon/public_html/ash/dd/adopt/siggy.php</b> on line <b>146</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/itsumoon/public_html/ash/dd/adopt/siggy.php:146) in <b>/home/itsumoon/public_html/ash/dd/adopt/siggy.php</b> on line <b>151</b><br />
Readfile appears to be disabled on your host.

http://www.adragonsden.com/adopt/siggy.php?id=8 (http://adragonsden.com/adopt/levelup.php?id=8)

Ashe
09-17-2012, 12:17 AM
Where is that file located in the directory?

Hall of Famer
09-17-2012, 12:30 AM
Well php.ini may be located in your ftp root directory's subfolder called 'php'. Some webhosts do not allow their clients to modify php.ini manually, and if this is the case you won't see php.ini from ftp. You'd have to consult your webhost and ask them to modify the php.ini settings. I was wondering though, who is your webhost provider? Or do you host your site on a local machine? It's rare for allow_url_fopen to be disabled by any kind of hosting services, there must be a mistake.

Ashe
09-17-2012, 12:36 AM
My host is from another domain (itsumo-online.net) but I'm close friends with him so I can ask about the php.ini settings. I have access to his cpanel but I don't know where to modify that setting xD

Hall of Famer
09-17-2012, 12:44 AM
I see, so you are not using any hosting services that I know of. XD Your friend may have disabled allow_url_fopen for a reason, you need to consult him and ask whether it is possible to enable allow_url_fopen property in php.ini. This is crucial if you want to use bbcode on other sites/forums, otherwise they won't be able to see your images and other uploaded stuff.

There is a chance you may be able to edit your php.ini through cpanel. Do you see a module called 'php configuration'? If so, click it and see if you can do anything about php configuration there. For me, this is not an option and I have to consult my own host to update php settings. XD

If you wanna know what your php.ini setting currently is, create an empty php file and enter this code below:


<?php
phpinfo();
?>
The page should look like this below:
http://www.datafirst.uct.ac.za/wiki/images/0/0a/Php_info.gif

Ashe
09-17-2012, 12:52 AM
It says its in /usr/local/lib/php.ini but I have no idea where that is located xD I don't see any folders like this.

Hall of Famer
09-17-2012, 12:58 AM
Well this is usually a hidden directory only accessible to the webhost itself. I was wondering if you could use a custom php.ini file though, download the attachment below and upload it to your public_html directory. Some webhosts allow you to use custom php.ini which overwrites part of their default settings, not all of them do though. Lemme know if this solves your problem, otherwise you'd have to consult your friend and persuade him to enable allow_url_fopen.

Ashe
09-17-2012, 01:02 AM
nope doesnt work xD I'll try to contact him tomorrow. And I still need to solve the login problem so i'll ask him too

Hall of Famer
09-17-2012, 01:08 AM
Alright good luck on that. I apologize that I cannot help you more, this script does require an appropriate server environment to run flawlessly. Does not mean you won't be able to use it, but some features depend on your server variables. XD

Ashe
09-17-2012, 01:12 AM
yah ty for your help! I don't know if my host knows more about it but I hope he does. This script was perfect for what I wanted to do. Would suck if it ends up I cant use it :(

Hall of Famer
09-17-2012, 01:16 AM
Well I dont think it will be as bad as you won't be able to use it, but you won't benefit from certain features such as bbcode if your php.ini settings ain't working out properly.

Ashe
09-17-2012, 11:22 AM
http://www.surmunity.com/showthread.php/21629-Security-Register_globals-allow_url_fopen-off-on-new-servers?highlight=fopen

My host showed me this. It seems they disabled allow_url_fopen for everyone. My host is suggesting I instal cURL to bypass it but I have no idea how >.<

Hall of Famer
09-17-2012, 11:27 AM
Wow this is so unexpected. I personally dont really know what Curl is, not sure how much I can help you. Can your host provide scripting support for customers? If not, I will see if I can get an answer from a few PHP programmer communities that I've registered on.

Ashe
09-17-2012, 11:53 AM
Nah there's no support for it. >.<

Hall of Famer
09-17-2012, 03:27 PM
I see, I will try to help you by asking on the php coders community. Hopefully someone will come out with a solution to your problem. If it turns out that curl functions are better alternative than allow_url_fopen, we may be switching to use curl functions for the next releases.

Ashe
09-17-2012, 04:19 PM
Alright, thanks a bunch. Let me know if you guys learn anything more on the matter ^^

Hall of Famer
09-17-2012, 08:57 PM
Well I am not sure if this will work, but let's give it a try. Open your siggy.php file and find the following lines:


header ($contentType);
$status = readfile($image);
if($status == "" or $status == "false" or $status == "FALSE"){
// Reading the file failed, so show an error...
header ("text/plain");
die("Readfile appears to be disabled on your host.");
}


Replace by:


header ($contentType);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $image);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);

Incase you get an error message, please report to me so I can troubleshoot it further. I am not quite familiar with curl functions myself, so I really cannot guarantee that it will definitely work for this time being.

Ashe
09-18-2012, 05:23 PM
Yup! That solved it! The images are now showing up ^^ Here's a page where I placed the html code for testing: http://www.adragonsden.com/adopt/click.html Thanks so much :D I was beginning to make a myadopt page all depressed lool

But I still have a problem with members logging in (forbidden 403 error)...The first time they make the account they can login but once they logout they can't get back in xD I'm not sure if its a browser issue or not. Out of 3/5 people or so can't log back in.

if you want you can test it out with one of my members' accounts. This is her old account and that doesn't work but she made a new one that works now so I'm not sure what's going on o: When you try to login, it does'nt lead you to the page (wrong login) instead it leads to a 403.

user: bbshadowcat pass: chobits413

Hall of Famer
09-18-2012, 08:29 PM
Glad it works for you Ashe, this was my first attempt using curl functions so I wasnt quite sure at the very beginning. XD

Its kinda weird how the login script is malfuntioning for you at times. I used the account you provided and made two login attempts. Both failed, but I was able to log in with an account I registered. I will see what I can do about this, it never happened to anyone before. I was wondering though, did you happen to notice if there was anything in common with those who could not log in? Username, IP address, or anything?

Ashe
09-18-2012, 08:54 PM
Well I know 2 users who cant login and they are using Chrome as their browser. But the girl with the account I gave made a new account with chrome which worked. I did register again and I got an error message, but still able to login/out. Here's a pic:

http://i1154.photobucket.com/albums/p527/dragonsden425/Screen%20shot%202012-09-18%20at%206.50.46%20PM_zpsab0a6406.png

Hall of Famer
09-19-2012, 08:24 AM
Well looks to me that your site has the same problem as Aasix's. Read this post and edit a line in functions.php will get rid of these warning messages for you. Not sure if this helps with 403 forbidden error though:
http://www.mysidiaadoptables.com/forum/showpost.php?p=23403&postcount=15

Ashe
09-19-2012, 08:54 AM
oo thanks that did fix the error messages but not the 403 login bug. T_T Someone who could login a few days ago can't login now as well.

Ashe
09-19-2012, 12:15 PM
http://adragonsden.com/adoptables/index.php

Ok I totally reinstalled everything and created a new database. Want to try to test an account? I made some and it seems to work but I'll ask some other people.

edit// nope still same 403 xD People say they get this message at the bottom too " Apache Server at adragonsden.com Port 80 "

2/3 members can't login but the 1 can (other than me) xD

Tequila
09-19-2012, 04:09 PM
Just registered for an account and I'm not having any problems with logging out and back in.

Ashe
10-11-2012, 10:26 PM
Strange. It just seems like hit or miss with logging in. I finished doing all my adoptables (after weeeeeks of work) I'll continue to build it and see if members can just make new accounts if they can't log back in.

btw; is there a way to make the user login non case sensitive?

Hall of Famer
10-11-2012, 10:55 PM
Well yeah, its difficult to troubleshoot a problem like this, both Nyxi and I do not get login problem after registering on your site. Are there any similarities among the users who cannot log in? I mean, similarities other than the fact that they cannot log in?

umm you want to make Username non-case sensitive?

Ashe
10-11-2012, 11:34 PM
I cant seem to find similarities with the users who can't login. :c

And yah, if it's possible for usernames to be non-case sensitive,it might be more convenient with having a login issue o.o

Hall of Famer
10-12-2012, 07:52 AM
Well do some of your users have symbols and weird characters in their username? This may explain why it is not working out for them? And to make username case insensitive, just add strtolower() to the register.php page on username variable. It should be simple.

Ashe
10-12-2012, 09:48 AM
thanks for the help with the non-case sensative username :D

and nope the usernames where simple. The ones who couldnt log back where Nocturnal and Doimatest2. the doima guy has made several accounts and cant seem to get it working at all. I had another friend try and her first account got the error then her second account worked. so strange :c

"You don't have permission to access /adoptables/login.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.". maybe its just my host ><

Hall of Famer
10-12-2012, 10:00 AM
Well are these users living in a different country? Can you think of any differences between them and the others who are able to log in?

Ashe
10-12-2012, 10:13 AM
alright the doima guy just made his 4th account and it worked o.O He lives outside of the US..Not sure which country. The rest of the members are from US (who also experience the problem too)

He said he used usernames with "Doima" like "doimatest" "notdoima" and they wouldnt work. Then he used a new name "testworm" and it worked. Reminds me that another member before who couldnt login used a different word for hers too then it worked.

I wonder if the database stored any username with "doima" and rejected any new members with those characters? o.o

Hall of Famer
10-12-2012, 10:16 AM
Well I do not think so, the script does not filter out specific keywords. Strange.

Ashe
10-12-2012, 10:32 AM
hmm I see. Thanks for the support btw! I'll keep setting everything up and see how everything turns out ^^