chmod() operation not permitted - FatFree framework

35,843

Solution 1

Check intermediary directories permissions It's a common gotcha.

Solution 2

For this you have to give the permissions recursively using -R for your "webapp" folder

Solution 3

Siddharth alludes to the correct answer in the comments:

F3 compiles templates to a temp/ dir before serving. This temp dir needs to a) exist and b) have appropriate permissions.

To achieve this, go the dir where your template file exists and run:

mkdir temp/
chown www-data temp

Solution 4

You can add write permissions for web-server to your [fatfree-web-root-dir]. Not safe!

chmod  o+w  fatfree-web-root-dir  # Then web-server can create "temp" folder.

An other way: You must create "temp" directory with web-server owner:

mkdir  fatfree-web-root-dir/temp
chown  www-data:www-data  fatfree-web-root-dir/temp
# www-data - in Debian for example
Share:
35,843
Siddharth
Author by

Siddharth

A hacker working currently in ShopSocially. Also a freelance hacker developing in Python and PHP but always on the lookout for better languages and better frameworks. Email me at sidchilling[at]gmail[dot]com if you want something done :)

Updated on February 24, 2020

Comments

  • Siddharth
    Siddharth over 4 years

    I have been developing an app in FatFree framework and now I am trying to deploy it on a server. Everything seems to be fine when I am running it on localhost.

    However, when I have deployed it on the server and trying to access it, it gives me a strange error which is -

    Internal Server Error
    
    chmod(): Operation not permitted
    
    #0 /var/www/webapp/inc/main.php:62 Template::serve('front_page.php')
    #1 /var/www/index.php:65 F3::run()
    

    I have given 777 permissions to the webapp folder so chmod() should be allowed. The above suggests that there is an error while serving the template file front_page.php.

    How can I fix this?

  • Siddharth
    Siddharth over 11 years
    Yes. But if your parent directory has write permissions by www-data then it will automatically make the temp/ directory. You do not have to make it yourself.