Forum Moderators: phranque

Message Too Old, No Replies

Managed to mess up .htaccess file with php

......403 forbidden *ouch*

         

scraf

8:09 am on Apr 12, 2004 (gmt 0)

10+ Year Member



Sorry for starting a new thread, but this is kind of a disaster.

I tested some PEAR stuff on my localhost, when I FTP'd to test it on the server I ran this script...


ini_set("include_path", "/var/www/html/pear/");

It appears that php "/" has taken the script to the root of the server (or someit) and I've now messed up the path to the .htaccess files. well that's what I think after reading the error log....

[error log]
(13)Permission denied: /home/virtual/site120/fst/var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[/error log]

I'm getting 403 forbidden on everything on my site, I'm curious if that is the case for other people who are sharing the hosting.

Help!

scraf

5:34 pm on Apr 13, 2004 (gmt 0)

10+ Year Member



.....um does anyone know where I might be able to get some help sorting this one?

I emailed the host, but I think the chap has adopted a "You ran a dodgy php script that shut down your site? Wow, that sucks" attitude.

jdMorgan

5:38 pm on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Run the script again using the correct path?

Jim

scraf

5:39 pm on Apr 13, 2004 (gmt 0)

10+ Year Member



Got the "403 forbidden" again

jdMorgan

5:49 pm on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you still have shell access (via telnet) you may be able to restore your configuration. This problem is beyond me and I think your best bet is to get your hosting provider involved. If you get no help, then it's time for a new (helpful and competent) host.

Jim

scraf

6:06 pm on Apr 13, 2004 (gmt 0)

10+ Year Member



Thanks for your replies and advice JD, no shell access unfortunately, hopefully the hosting provider will take some time to look into the case, but I'm not holding my breath.

lemat

9:02 am on Apr 14, 2004 (gmt 0)

10+ Year Member



Could you simple check/move/delete file .htaccess and see what happens?

If you created this file from PHP try to gain access to this file by php (fopen,fread,echo).

Check it's permissions and structure.

scraf

9:31 am on Apr 14, 2004 (gmt 0)

10+ Year Member



I placed a .htaccess file, and chmodded everything to 777 and now I can get .html files.

If I point my browser to a .php file, I get an "Internal Server Error" page, if I place php code in a .html page it isn't parsed.

Question, is it normal to be able to access (and edit) the php.ini file via FTP on a shared host?

lemat

10:00 am on Apr 14, 2004 (gmt 0)

10+ Year Member



Depends on your ISP. For egzample I do have access to php.ini. But it's my "personal" php.ini and is used on my part of ISP's vserver ONLY.

But if you and anyone else have access to the php.ini (the very same php.ini) I suggest you strongly to change your ISP. AS SOON AS POSSIBLE.

Of course if you have access to any file above your DocumentRoot or FTPRoot (ftp and php are not chrooted) -> the same advice...

500 Internal Server Error is caused mainly by bad PHP configuration (lack of modules, error in php.ini, etc.)

scraf

12:12 pm on Apr 14, 2004 (gmt 0)

10+ Year Member



Got my php back (finally), needed to get my chmod's in order....

755 to all directories(rwxr-xr-x)
644 to all files(rw-r--r--)