Python CGI script can't write files, permission denied
Ok, I have my python CGI script, and it isn't able to write to my config file (which is named config.cfg). First it wasn't able to open the file at all. So I did a touch config.cfg, and a chmod 777 config.cfg, but still it can't open the file for writing ("Permission denied"). So, since it was in my ScriptAlias directory, I thought maybe that was the problem, so I made a new directory, and put it in that, so now it is in test/config.cfg. It still wont work! I've tried changing users, modes, everything on the file and all the directories leading to the file, but still I get the same error. Anyone got any ideas?
|
Can you post some code?
|
Code:
#!/usr/bin/python That is my complete script, however the problem is in SaveCFG. It is going to be a script to help me split my income into percentages or raw amounts. |
Have you tried changing up the modes on your Handles?
Handle = open("accounting/config.cfg", "w") Also, and this may not make a difference, try putting the full path to config.cfg. I've had some issues with the open method as well and it seems to be very picky at some times. |
Still doesn't work. I've tried everything, including all the things you guys suggested. So I just put my script on another server, and it works fine! :confused: Sheesh! Anyhow, thanks for the replies. If anybody does truely know the problem, than let me know! Thanks!
|
All times are GMT -5. The time now is 07:49 PM. |