The script from under Apache tries to write to the file and gets an error: not write permissions.

f = open('/var/www', 'w')print f 

What rights and where to add?

    2 answers 2

     chmod 755 -R /var/www 

    Not sure what you are doing is generally feasible (are you trying to read a directory? What is this command?)

      On the file in which you are trying to write, set rights.

       cmod +x /путь/к/файлу/название.файла 

      Maybe it will help.