Lunarpages Web Hosting Forum

Author Topic: FormMail inexplicably stopped working  (Read 8354 times)

Offline mschlauch

  • Space Explorer
  • ***
  • Posts: 7
FormMail inexplicably stopped working
« on: April 04, 2012, 07:00:45 AM »
Greetings,
I've been using the FormMail script found on the forums here (the replacement for matts script), and it has been working fine, but suddenly and inexplicably has quit working on me, now returning and HTTP 500 error. I've been told that the HTML in the form fails to specify the "POST" method, but that is not true. it reads: <form method="post" action="/cgi-bin/rsvp.pl">

I've double checked the lines that need to be customized in the script, everything seems fine. I can't figure it out. It's quit on me once before, then started working again after a couple days, but it's been more than a couple days now.

Permissions are also set correctly.

thoughts?!?!

Offline Hush

  • Über Jedi
  • *****
  • Posts: 2830
Re: FormMail inexplicably stopped working
« Reply #1 on: April 04, 2012, 10:41:05 AM »
Are there any details within the error message (a 500 error is pretty broad). Could you perhaps copy and paste the error message in please?

Which FormMail script are you using (I read that you'd found it on the forum here, would you mind posting which thread it was so I can take a look at the script please).

Which server are you on? I'd consider, if nothing else has been changed on the site or in the script prior to it stopping working, dropping tech support a quick message asking if there have been any updates to that server. They won't be able to help with getting the script working again, but if you know whether anything has been updated it will give you a good place to start looking for answers.
<- From the ashes will rise a phoenix ->

Lunarpages Web Hosting || Lunarpages Forums || Lunarpages Affiliate Program

Offline mschlauch

  • Space Explorer
  • ***
  • Posts: 7
Re: FormMail inexplicably stopped working
« Reply #2 on: April 04, 2012, 12:21:27 PM »
Under the "more information" button it simply displays:

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.
For more information about HTTP errors, see Help.

The formmail script was found here:
http://www.lunarforums.com/web_hosting_tutorials_faqs_and_resources/setting_up_nms_formmail-t18221.0.html

I tried contacting Lunarpages, and they told me that it was in the HTML code, failing to specify "post" method, but that is not the case. If it was (I tried playing with it) it would display that as an error message.

I'm not sure which server I'm on, might this be the right answer? 209.200.244.80
or is there something more broad I'm looking for. That IP is listed as DB Server in my control panel.

I can supply any more information, this is frustrating as it was working fine then just stopped (second time at that...). the website address is www.mcsjlc.com/wedding/scrsvp.html

Thanks

Offline Hush

  • Über Jedi
  • *****
  • Posts: 2830
Re: FormMail inexplicably stopped working
« Reply #3 on: April 04, 2012, 01:35:03 PM »
The error would suggest that it was having trouble accessing the script at all. Permissions on the script are 755 (assumption as you've said the permissions are set correctly), but what are the permissions on the cgi-bin folder? Do you have the line

AddHandler cgi-script .cgi .pl

in your .htaccess file?

I'm going to upload the script and a copy of the page to my development server.

>> Additional >>
On my dev server, it worked perfectly fine with a new copy of the formmail.pl file and your HTML code (taken from the page source). With the fact that it does not appear to be accessing the script I would definitely check the permissions on the script, possibly the cgi-bin folder... Check the .htaccess file as well.

PS - Hope it's a wonderful day for the wedding.
« Last Edit: April 04, 2012, 01:54:32 PM by Hush »
<- From the ashes will rise a phoenix ->

Lunarpages Web Hosting || Lunarpages Forums || Lunarpages Affiliate Program

Offline mschlauch

  • Space Explorer
  • ***
  • Posts: 7
Re: FormMail inexplicably stopped working
« Reply #4 on: April 05, 2012, 04:28:58 AM »
I'm sorry, stupid question maybe, but do I have an htaccess file by default, or do I need to create one? i've never done anything with htaccess.

The permissions on both the file and folder are rwx-rx-rx, which should be correct, right?

I appreciate the help. Thanks

Offline Hush

  • Über Jedi
  • *****
  • Posts: 2830
Re: FormMail inexplicably stopped working
« Reply #5 on: April 05, 2012, 04:40:10 AM »
There is no such thing as a stupid question  :nope:

In general, there should be a .htaccess file located in public_html already. As long as it hasn't been deleted. If it is not there, simply create a file with the name .htaccess (the . at the beginning is crucial). It's file permissions should be 664 ( rw-rw-r ). In essence .htaccess is a text file which contains instructions that Apache (the web server software) reads and acts upon.

The AddHandler line is a directive to tell Apache to serve scripts within your pages. Techno-babble which essentially means that you are telling the server that when it needs to access a CGI or Perl script, what it should do with them. You may have .htaccess files in other folders within your hosting, as they can be used to control a whole variety of things. The AddHandler line needs to go in the file within public_html.
<- From the ashes will rise a phoenix ->

Lunarpages Web Hosting || Lunarpages Forums || Lunarpages Affiliate Program

Offline mschlauch

  • Space Explorer
  • ***
  • Posts: 7
Re: FormMail inexplicably stopped working
« Reply #6 on: April 05, 2012, 05:16:58 AM »
So I created .htaccess within my public_html folder (that's the very top folder, the site is found in public_html/mcsjlc/wedding

The only line I have in the file is the line you gave me, copied and pasted.
permissions set to rw-rw-r
Quadruple checked all permissions for the script and cgi-bin - perfect.
Cleared my browser's cookies, history, and cache.

Nothing. No change. Where do I find the "pulling one's hair out" emoticon?

Offline Hush

  • Über Jedi
  • *****
  • Posts: 2830
Re: FormMail inexplicably stopped working
« Reply #7 on: April 05, 2012, 06:07:00 AM »
 :wall: << I think this may be the most appropriate.

You mentioned that the site is stored in public_html/mcsjlc/wedding - so I'm guessing now that it's an addon domain (you have more than one domain on your account perhaps). At this stage, I'm just going to have to tell you what I'd be doing in this situation to troubleshoot the issue. (It was so much easier when I was in tech support - you have access to the things causing the problems  :) )

Anyhow, the next thing I would try is probably to create a copy of the .htaccess in public_html/mcsjlc

In the event of having an addon domain, the folder you put it into becomes the public_html folder for that domain. So if your main domain was "mydomain.com" and your addon domain is "mcsjlc.com" then:

public_html = the public_html folder for "mydomain.com"
public_html/mcsjlc = the public_html folder for "mcsjlc.com"

I may be barking up the wrong tree here, but given that the form mail script has pretty good error handling in it, the fact that you are not receiving an error message from the script makes me think that the server isn't actually hitting the script.

The other thing that comes to mind (and this depends on how LunarPages servers are set up these days - I'm a few years out of touch now), is where the cgi-bin is located. Obviously the instructions say to put the script into public_html/cgi-bin - part of me would try duplicating it in public_html/mcsjlc/cgi-bin. However, that is only because I don't know these days whether addon domains refer to the root public_html folder for the cgi-bin folder.

One way or another we'll get to the bottom of this... May need a lot of coffee though  :java:
<- From the ashes will rise a phoenix ->

Lunarpages Web Hosting || Lunarpages Forums || Lunarpages Affiliate Program

Offline mschlauch

  • Space Explorer
  • ***
  • Posts: 7
Re: FormMail inexplicably stopped working
« Reply #8 on: April 05, 2012, 07:21:13 AM »
You're completely correct on all assumptions, mcsjlc.com is indeed an add-on domain. Now the frustrating thing is that I've already tried what you suggested, I've tried a cgi-bin in the public_html folder, one in public_html/mcsjlc folder (where it did originally work), as well as the .htaccess file in all folders and subfolders.

I've tried every possible variable I can think of. Incidentally, what are the perms supposed to be for the public_html folder? I'd found it was set to rwx-rx---

I tried changing it to 755 and 644, but no luck with either of those.

Does this seem like something that I should be speaking about with lunarpages? Logic as I see it has narrowed it down to something server-side, everything is perfect, and more importantly nothing changed from the original configuration, as I can see it.

Offline mschlauch

  • Space Explorer
  • ***
  • Posts: 7
Re: FormMail inexplicably stopped working
« Reply #9 on: April 05, 2012, 07:58:55 AM »
Ok,

It just started working again... uber weird. It did this last time too, no changes, just suddenly working again.

I'm grateful for that, but I tell you, I don't have a lot of confidence in it in terms of longevity... not sure if I should lack the confidence in lunarpages, or myself, but for now oh well, it's working.

Thank you very much for all your help, it could very well have been one of your suggestions, with just a delayed affect or something. Either way, I will be looking into learning more about the htaccess files and what they can do for me.

Cheers! :java:

Offline Hush

  • Über Jedi
  • *****
  • Posts: 2830
Re: FormMail inexplicably stopped working
« Reply #10 on: April 05, 2012, 08:47:09 AM »
At least it's working now , :clap: which begs the question why it stopped processing the script.  :-? With regards to .htaccess, the following may help get you started:
http://www.freewebmasterhelp.com/tutorials/htaccess/

If you're interested in playing about with this sort of thing as a learning exercise, it may be worth setting up a small virtual server in Virtual Box on a PC. That way the worst that happens is you do something untoward and simply restore the virtual machine. I saw the AS400 stuff on your site (Was just getting to start to play with that on my last placement with HP, but client contract renewals put paid to that), so if you're a bit of a tech head anyhow I'm sure you can put something together. If you want any help or info though, just let me know.
<- From the ashes will rise a phoenix ->

Lunarpages Web Hosting || Lunarpages Forums || Lunarpages Affiliate Program

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6423
Re: FormMail inexplicably stopped working
« Reply #11 on: April 05, 2012, 10:46:25 AM »
I've tried every possible variable I can think of. Incidentally, what are the perms supposed to be for the public_html folder? I'd found it was set to rwx-rx---

I tried changing it to 755 and 644, but no luck with either of those.
750 (rwxr-x---) is the correct setting for public_html. 755 (rwxr-xr-x) is the usual setting for directories under public_html. Never make a directory 644 -- it does not have "execute" (x) permissions for anyone, and will fail to work for you. In other words, you should understand the permissions system before changing permissions willy-nilly.

Notes on .htaccess files: there is always one in the root (public_html). By default, it may be empty. If you should erase it, a new empty one will usually be automatically created. All .htaccess files found are processed sequentially from the root (public_html) down the chain of directories to the directory with the page being run. This includes subdomains and add-on domains -- public_html/.htaccess is always the first one run.
Visit My Site

E-mail Me
-= From the ashes shall rise a sooty tern =-