CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Getting 403 status from html/PHP

    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
    Norm

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Getting 403 status from html/PHP

    Then you don't have write permission. Make sure you change the access permissions.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: Getting 403 status from html/PHP

    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.
    Norm

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Getting 403 status from html/PHP

    Make the folder "testing" 755.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: Getting 403 status from html/PHP

    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:
    Code:
       if(!is_writable($upload_path))
          die('You cannot upload to the specified directory: ' . $upload_path . ', please CHMOD it to 777.');
    Norm

  6. #6
    Join Date
    May 2002
    Posts
    10,943

    Re: Getting 403 status from html/PHP

    So change it to 777 then.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  7. #7
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: Getting 403 status from html/PHP

    Thank you, that worked! 777

    Now on to the hitcounter code

    Norm
    Norm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured