1. corpa Member

    Chmod() not permitted

    Topic geplaatst op: 14-02-2013 om 23:15

    Hi,
    I like to run a PHP script that sets the right permissions to files (644) and folders (755).
    However when I run it I get the error: chmod() [function.chmod]: Operation not permitted
    Trough google I learned that this error occurs when you are not the owner of the files.
    In my ftp tool I see that the owner of the files and the group is 'ftp' while this should be the username from the site.
    How can I change ownership?
    Or is there a way in DirectAdmin to set the attributes all right at once?
    Regards,
    corpa

  2. Fabien Daniel Versio medewerker
    Reactie geplaatst op: 15-02-2013 om 01:45

    You can reset the ownership in DirectAdmin -> File manager. Select the files, then at the bottom you can check the "recursive" button followed by "reset owner". Sometimes there is an owner reset button too in the "action" column to reset the rights on a folder or file. Hope this helps.

    Vond u dit antwoord nuttig?

  3. corpa Member
    Reactie geplaatst op: 15-02-2013 om 13:18

    Thanks Daniel,
    I did as you mentioned and I can see in the filemanager columns UID and GID that the files and dirs belong to the correct user (i.e. the user I created the web space with).
    However my php script still fails and comes with the error: chmod() [function.chmod]: Operation not permitted.
    Any other ideas why this can be?


    Vond u dit antwoord nuttig?