Click to See Complete Forum and Search --> : Getting 403 status from html/PHP


Norm
June 17th, 2010, 04:45 PM
Hi,

This is my first attempt to put some PHP code on a linux server. The code is supposed to write to the files folder.
I get a 403 Forbidden! error with the URL: http://asdfasdfsdf.zxq.net/Testing/UpLoad.html <<<<<<< userid changed

drwxr--r-- 3 201405 vhosts 53 Jun 17 17:07 Testing <<<<<<<< The folder containing the html and php file

The contents of the Testing folder:
-rw-r--r-- 1 201405 vhosts 343 Jun 17 01:12 UpLoad.html
-rwxr--r-- 1 201405 vhosts 1543 Jun 17 17:07 UpLoad.php
drwxrw-rw- 2 201405 vhosts 6 Jun 17 01:30 files <<<<<<< The folder to be written to by the php filel


Thanks,
Norm

PeejAvery
June 17th, 2010, 07:59 PM
Then you don't have write permission. Make sure you change the access permissions.

Norm
June 17th, 2010, 08:15 PM
Thanks for the response.

For which file/directory and for which user. I posted the settings for 4 objects. Each object can have 3 write permissions. That makes 12 different places to set write permission.

PeejAvery
June 17th, 2010, 08:47 PM
Make the folder "testing" 755.

Norm
June 17th, 2010, 09:31 PM
Thanks again. I made the change and the settings are now:

drwxr-xr-x 3 201405 vhosts 53 Jun 17 17:07 Testing
In Testing:
-rwxr-xr-x 1 201405 vhosts 1565 Jun 18 02:26 UpLoad.php


I got some improvement. The html page loaded.
I now get the following message:
You cannot upload to the specified directory: files/, please CHMOD it to 777.


It is from the following lines in my PHP file:
if(!is_writable($upload_path))
die('You cannot upload to the specified directory: ' . $upload_path . ', please CHMOD it to 777.');

PeejAvery
June 18th, 2010, 06:51 AM
So change it to 777 then.

Norm
June 18th, 2010, 08:39 AM
Thank you, that worked! 777

Now on to the hitcounter code

Norm