I'm using Perl/Ubuntu/Apache. My script is on /usr/lib/cgi-bin and i'm trying to write a file(open ">") to /var/www/my_custom_dir but i get "Permission denied".
If i try to write to the script directory or any other the error is the same. The permissions seem right. Everything is 755, root owner. I tried to change "my_custom_dir" owner to www-data(apache user), but does not make any difference.