I m focusing on a python version cgi script which must create img files (which is proven on the internet page) in cgi-bin folder.

However it fails with: [Get married March 28 16:13:51 2009] [error] [client ::1] OSError: [Errno 13] Permission refused: 'average/'

[Note] 'average/' may be the folder the cgi script will create first to save individuals img files.

I attempted giving a+x permission towards the cgi script, however it unsuccessful still. This occurs on Win and Mac.

Btw, I m dealing with the default Apache designs. I did not change anything after installing Apache.

You would need to provide the web server user write permission towards the cgi-bin folder. Usually web server user is one thing like nobody and never within the same group as who owns the folder, to ensure that means making cgi-bin world-writable:

chmod a+rwx cgi-bin

(or, on Home windows setting permissions on cgi-bin to provide Everybody ‘Full Control’.)

This can be a really bad idea. Now any user in your server, or any script that does not check its filenames correctly, could create personal files within the cgi-bin, where it will likely be construed by Apache like a CGI script and performed. This is an excellent method of getting your server possessed.

Run-time-written files should use another ‘data’ folder, outdoors the cgi-bin (and ideally outdoors the net root, bound by having an Alias), with Apache set to disallow any type of script or htaccess from that folder. After that you can set ‘data’ 777, or, possibly better, get it possessed through the web server user rather.

The mistake message is worrying about permissions for that folder average/ not the cgi file.

EDIT: So that your python script (which operates on both Win and Mac) accounts for creating the folder and also the img files?

You certainly should look at your script and also the permissions around the parent folder by which average/ will be produced.

When not only a permissions problem, because the error message indicates, you will need a Python expert.