The 'cgi-bin' is a protected folder name and will always point to the cgi-bin in the root of the webspace. Any other folder called 'cgi-bin' will not be found. Either place the script into the cgi-bin in the root of the webspace or change the name of the folder you've created and adjust the code accordingly.