A couple of weeks ago I spent half a day putting in a newsletter sign up function in four languages onto a clients site linked into the signup.to api. On the test server it was working perfect. Opt-in email was arriving and script was executing as it should. I was very happy.
However, after the client decided that it was to be put on the live site, I tested the scripts on the live site and was getting a 404 not found error when executing the sign up function.
It was a bit baffling and I then spent a few hours trying to figure out why it was working fine on the test server and not on the live server.
After many hours of checking scripts, paths, discussing it with fellow coders who were as baffled as I was, in the end, I logged into the clients live server with SSH to see if the server logs would show anything.
It did and this is how I solved the issue:
1. Ran this command as root in SSH: tail -f /usr/local/apache/logs/error_log
2. Went to the live site and pressed submit for the newseltter function to replicate the issue
3. checked in the ssh window and saw the error below.
[Thu Mar 21 15:05:01 2013] [error] [client 126.96.36.199] SoftException in Application.cpp:601: Directory "/home/siteowner/public_html/blog.siteowner.com/wp-content/themes" is writeable by group, referer: http://blog.siteowner.com/
AHA!!! The bit that immediately caught my attention was “is writeable by group” as this means that the server is refusing to execute the script because the wordpress theme directory has world writeable permissions (tut tut whoever was developing before me because its pretty bad to have permissions set like that)
4. Seeing this, I then ran a permissions fix across the clients home directory fixing everything to 644 for files and and 755 for folders.
5. Went back and tested my form and it worked perfect.
So, in conclusion, I would not have been able to solve this without root access to the clients server and my advice to anyone else who has the same issue, is to check folder permissions first and in the case you cant find anything, then ask the server admin to check the apache error logs for you.
Hope this helps someone.