1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Can anyone help with .htaccess or otherwise advise please?

Discussion in 'Apache' started by spectre17, May 5, 2013.

  1. #1
    Hi, i'm trying to install a script which i've used in the past but am unable to do so. Part of the install procedure checks that all files and folders have the correct permissions, and all check out ok except one folder and it's contents. However, the permissions are correct.
    It seems that the install script cannot actually find the folder and i believe this is down to the .htaccess file. Are there different ways of writing .htaccess? Here is the contents of that file:
    Options +FollowSymLinks
    RewriteEngine On

    RewriteRule ^/?(admin|install|themes)/(.*)*$ - [Last]
    RewriteRule "^/?(page)/([0-9]+)-files\.html$" index.php?page=$2 [Last]
    RewriteRule "^/?(viewed|rated|members|groups)/$" $1.php [Last]
    RewriteRule "^/?(viewed|rated|members|groups)/([0-9]+)[^/]+\.html$" $1.php?page=$2 [Last]
    RewriteRule "^/?(category|file|tag|search|member)/([0-9]+)[^/]+\.html$" $1.php?id=$2 [Last]
    RewriteRule "^/?(category|file|tag|search)/([0-9]+)/([0-9]+)[^/]+\.html$" $1.php?page=$2&id=$3 [Last]
    RewriteRule "!^(thumbnails|files)" - [C]
    RewriteRule "(thumbnails|files)(/[^/]+)" $1$2 [Last]
    RewriteRule "!^[^/]+\.css$" - [C]
    RewriteRule "([^/]+\.css)$" $1 [Last]
    The folder i'm having problems with is the thumbnails folder. It has the same permissions as other folders that check out ok, but reading through the setup code it seems to refer to the folder differently.
    Example, all folders are in the public_html folder but the 'files' and 'sources' folders are referred to as
    Your ./files/' folder has the proper permissions. and
    Your ./sources/thumbnails/' folder has the proper permissions.
    Whereas the thumbnails folder is referred to as
    ERROR - Your '/thumbnails/' folder must be writable.
    Note that although all three folders are located immediately under the root directory, the thumbnails folder doesn't have the ./ before it.
    Any help would be appreciated, it's a great script once working.
    spectre17, May 5, 2013 IP
  2. Alexbizz

    Alexbizz Member

    Messages:
    109
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #2
    Try to remove the htaccess file or rename it.
    Alexbizz, May 5, 2013 IP
  3. spectre17

    spectre17 Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #3
    Thanks for the response Alex, but i've tried that already, no joy. i believe the .htaccess is important because as mentioned about the folders location. It's directly under the root folder as are the other two which check out ok, only in the set up they are referred to differently, the two checking out are written as ./ whereas the troublesome one is referred to as /
    spectre17, May 5, 2013 IP
  4. Revelations-Decoder

    Revelations-Decoder Well-Known Member

    Messages:
    2,995
    Likes Received:
    143
    Best Answers:
    3
    Trophy Points:
    190
    #4
    OK I am no expert on such matters and might be way off track but don't you need to change the chmod to writable with a 777 setting or something like that
    Revelations-Decoder, May 5, 2013 IP
  5. Alexbizz

    Alexbizz Member

    Messages:
    109
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #5
    Add thumbnails folder 775 permission to be writable.
    Alexbizz, May 5, 2013 IP
  6. ryan_uk

    ryan_uk Prominent Member

    Messages:
    3,943
    Likes Received:
    991
    Best Answers:
    33
    Trophy Points:
    365
    #6
    It's one thing to have the correct permissions, but is the user and group (ownership) correct?

    No, no, no: Don't go overboard with permissions (and risk getting hacked).
    ryan_uk, May 5, 2013 IP
  7. Alexbizz

    Alexbizz Member

    Messages:
    109
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #7
    777 = read, write, execute = No restrictions on permissions. Anybody may do anything. Generally not a desirable setting. not recommended!
    755 = read, write, execute by Owner only, All others may read and execute the file. This setting is common for programs that are used by all users. recommended!
    775 = read, write, execute by Owner and Group, All others may read and execute the file. recommended if you use complex script.
    Alexbizz, May 5, 2013 IP
  8. Revelations-Decoder

    Revelations-Decoder Well-Known Member

    Messages:
    2,995
    Likes Received:
    143
    Best Answers:
    3
    Trophy Points:
    190
    #8

    Good job I said I was no expert and "or something like that" LOL
    Revelations-Decoder, May 5, 2013 IP
  9. ryan_uk

    ryan_uk Prominent Member

    Messages:
    3,943
    Likes Received:
    991
    Best Answers:
    33
    Trophy Points:
    365
    #9
    I wouldn't call 775 recommend, in fact quite insecure. If the group and user are correct, then you don't need 775. 755 will be perfectly fine. Contact your host about this and they should be able to recommend correct user and group (it depends on what the webserver is running as).
    ryan_uk, May 5, 2013 IP
  10. Alexbizz

    Alexbizz Member

    Messages:
    109
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #10

    I did mistake while writing (typo) it was fixed instantly.
    My forum (phpbb) use 755 for attachments folder.
    Alexbizz, May 5, 2013 IP
  11. spectre17

    spectre17 Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #11
    Yes but they're set to 777, as mentioned they are the same as the folders that check out ok, the only difference is that the script seems to be looking in different places for the folders, all folders are in the same location i.e. immediately under the root directory, the script is asking for the the thumbnails folder located at / whereas it's asking for the others located at ./
    If they are all under the root folder, then it should be looking for ALL of them under ./ unless something like a .htaccess is directing it someone else.
    spectre17, May 5, 2013 IP
  12. spectre17

    spectre17 Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #12
    As mentioned in my question, i have set all folders to writable. The script is asking for the thumbnails directory located at / but asking for the other folders located at ./ as they're all in the same place why is it 'looking' in different places? Surely if they are all immediately under root they should all be ./? Unless something like the .htaccess ?
    spectre17, May 5, 2013 IP
  13. ryan_uk

    ryan_uk Prominent Member

    Messages:
    3,943
    Likes Received:
    991
    Best Answers:
    33
    Trophy Points:
    365
    #13
    You mentioned it happened after renaming .htaccess? (Effectively eliminating it.)
    It seems more like it's in the script. Have you checked the actual code?
    ryan_uk, May 5, 2013 IP
  14. Alexbizz

    Alexbizz Member

    Messages:
    109
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #14
    find the error_log file on root and copy here what is inside.
    Alexbizz, May 5, 2013 IP
  15. spectre17

    spectre17 Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #15
    Also, please note this is an installation procedure and the permissions will be changed back once the script is installed, during installation they need to be writeable.
    spectre17, May 5, 2013 IP
  16. Revelations-Decoder

    Revelations-Decoder Well-Known Member

    Messages:
    2,995
    Likes Received:
    143
    Best Answers:
    3
    Trophy Points:
    190
    #16
    Again i am no expert but lets throw this one in

    .htaccess

    perhaps change to htaccess

    remove the dot

    I remember this has worked for some such scenarios b4

    But again others will be better able to help I am going just by memories of previous conversations
    Revelations-Decoder, May 5, 2013 IP
  17. spectre17

    spectre17 Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #17
    Ahhh.....found it! you're right it's a problem with the code. In the install script it say's:
    function getPath($path)
    {
    if($path[0] == '.')
    {
    return '.'.$path;
    }
    else if($path[0] == '/')
    {
    //return '..'.$path;
    return $path;
    }

    I simply uncommented the
    //return '..'.$path;
    return $path;
    and deleted the return $path;
    and it's now allowing me to go ahead with the installation. Thanks for pointing me in the right direction!
    spectre17, May 5, 2013 IP