Setting Up Local Host for Website Testing

If you have been trying to set up a feedback form using a php script and everything looks to be going really well until you get to the moment of truth, you click on submit the form and you get:

Warning: mail() [function.mail]: Failed to connect to mailserver at “localhost” port 25, verify your “SMTP” and “smtp_port” setting in php.ini or use ini_set()..

This is where the nightmare begins, you can trawl through endless forums and search for the solution to the problem and you will find string after string of posts from people who have experienced the same problem with nearly as many proposed solutions.

I have actually managed to get a working solution, but before you get excited let me explain exactly what I am doing so that you can assess whether this solution can potentially work for you.

First, I wanted a reliable feedback form for a website I am designing. I use the Windows operating environment and wanted a php script that would deal with the information being submitted from a .html page and forward it to the required email address, simple as that.

Next I wanted to set up a local web server so that I could change the default script that I had got hold of and test it on my own PC before going live. I decided to use Apache with .php for my test environment running on Windows XP.

So first thing you need to do is ensure that the host supports .php scripting, not all of them do. If your host does not support php you are on a looser from the start and will have to consider using java scripts or Perl as an alternative neither of which are included in this post.

For a basic .php feedback form you should visit The Site Wizard, this guy is a wizard as far as I am concerned. I used his feedback form generator wizard and had a working solution straight away.

Problem was that his form was not exactly what I wanted, I needed a couple of extra features and to change the layout a little. I noticed that he had instructions for setting up a localhost using Apache and .php. That way I could copy the website files to my localhost.com domain (which I would set up on my PC) and test any configuration changes before going live, sounded perfect.

I followed the instructions to the letter and in no time at all I had Apache and .php running on my local machine. Duly copied the files across to the domain directory loaded the contactus html page onto the browser and clicked on the submit button.

That’s when I got the dreaded error message and the trouble started, I was trying to use the gmail smtp server to send out the form information to the target email address.

In the end I found a solution when I discovered Digiex Feed Your Mind who offered a ‘sendmail’ fake email solution.

The problem I had was that I had no email server on my machine so when I tried to use my gmail smtp to send the mail it simply didn’t work, the reason being that you have to authenticate your logon, the pop and smtp are encrypted and the port numbers are different to the default number 25.

With sendmail you have a middle man that sits between the form and your email provider, logs onto your server for you and deals with the security issues because you can include your user name, password and select a port to match the server. The solution is supposed to work with gmail which is what I was using, so again it seemed perfect.

When I employed the recommended solution using sendmail, I no longer got the dreaded error message and instead got my ‘thankyou’ message your enquiry has been submitted.

Eureka, I am there (3 days later I’ll have you know). Anyway I was a bit premature because, you guessed it, the email didn’t arrive.

After trying numerous combination’s for configuring the php.ini and the sendmail.ini to get the system to work with gmail, I decided that I would look for an alternative email provider and I selected gmx.com.

This is a good quality free email service that you can access with Outlook using their pop3 server and smtp options. The interesting thing about gmx is that they do not use the encrypted pop and smtp check boxes and the smtp port is 25, so they had to be worth a shot.

I had to change the SMTP option to mail.gmx.com and set the port to 25 rather than one of the encrypted ports. The rest I just followed the instructions given including the commenting out of the SMTP mail handler lines in php.ini and the adoption of using the linux ‘sendmail_path’ option as described in the Digiex dialogue.

This time it was hey presto and it really was EUREKA because the form was submitted and the email duly arrived about 60 seconds later.

So if you are struggling with this one and are happy to adopt the same method as I used then your troubles are over.

Happy feedback forms to you.

In summary: –

  • Use The Site Wizards php feedback form generator wizard to create a basic form.
  • Use The Site Wizards instructions for downloading and installing Apache and .php to create a localhost server on your own PC so you can test any new configurations
  • USe the Digiex instructions for setting up and configuring the sendmail option if you don’t have an email server on your PC
  • Register and adopt gmx.com’s free email service as an alternative to gmail if you cannot get gmail to work with sendmail
  • Use The Site Wizards .php tutorials for editing your .php script and html form to change the form configurations as required
  • Test any new configurations on your newly working localhost webserver.
  • I used php 5.2.8 and Apache 2.2.10

Hope this helps and if I have not been clear give me a shout and I will try and clarify.

Posted in website design | 1 Comment

Website reviews you might like to see

Our Reviews
“Wonderful site. Your site is professional and pleasant to visit. Very nice products. Navigating your site is a pleasant experience. Take care.”

Anthony
cashtextads.com/link/onemillionhitsforfree

“Like the site, it offers some nice products and good pricing. It loads fast and has a really nice look to it. Good luck in 2009!”

GUY
help-yourself-online.com

“Nice website very easy to navigate and great keyword content on your homepage. The curtains interest me the most you have a nice selection and the prices are very resonable. Good luck with your website.”

Brian
dealstampabay.blogspot.com

“A very nice site. I especially liked the “Headboard” page. It was very attractively arranged and offered some good decorating advice. Your site was easy to navigate and responded quickly. Good luck and God bless.”

Sue
christiancomforts.com

“Outstanding design and very professional. Anyone furnishing a new home or redecorating one should visit this site. Easy to navigate this is a must see! Site loads well and all the links work. Terrific job and I wish you all the best!”

marie
angeltreasuresonline.com

“This is a very nice custom drapery site. You have very well explained your services and product. Site loaded quickly and navigated easily. I wish you the best.”

Karen
babysownroom.com

Get your own reviews, free traffic at

These reviews were written about the website Curtains and Cushions which was put together to support a soft furnishings manufacture and supply business.

Posted in website design, Website Reviews | Leave a comment

About Me

Website Design and Internet Marketing

This is actually a bit of a welcome to my blog and an introduction to me.

I worked for many years in the oil and gas industry and specialized initially as a production engineer supporting the design and manufacture of directional drilling and surveying equipment.

I progressed in the industry to become a project leader, department manager and ultimately the technology manager once I had gained a 1st class honors degree in technology.

During this progression I was involved in the testing and evaluation of new product lines for their functionality in a severe operating environment including the testing of mechanical, electronic and software functionality.

My final position as technology manager meant that the department heads for mechanical engineering, electronic engineering and software development reported to me along with the project managers working on the new developments.

So why am I telling you all this, well it’s primarily to let you know that I am well used to working in a technically challenging environment that requires attention to detail and the ability to work through technical problems. Skills that I believe transfer very well to my newly chosen profession of website design and internet marketing with a sprinkling of search engine optimization thrown in.

Add to that my love for photography, especially of the digital variety, and my enjoyment in the production of aesthetically pleasing graphics using Photoshop and I think you will agree that website design is a reasonable career choice that fits well with my need to work from home here in the South of France.

My website design work is done utilising the Dreamweaver 8 software package, which is an industry standard software for website development. I also publish websites via Squidoo and Hubpages and use Blogger to publish blogs in support of my holiday business , website design business and internet marketing activities. You can find out about affiliate opportunities on HubPages via this link.

With respect to internet marketing and SEO, you will find any SEO lessons I have learned along the way will be made available to you with completely free access and I will occasionally use this blog to offer products through my affiliate relationships.

So that is it, please feel free to comment on any of my blog postings, ask questions or get in touch if you have a new project you would like to discuss for website development.

Posted in About Me | Leave a comment

Tips to work from home


Tips to work from home

This is my thinly disguised SEO hub masquerading as a work at home hub.

Well given we now have an extra mouth to feed, you will see Charlie in the hub by the way, I need to take this working and earning money at home a bit more seriously.

I was requested to do this hub and I hope it fits the bill, most people who work from home are tinkering on the internet one way or another so I thought I might as well write down some of the things I have learned along the way, how to organize yourself when you produce a hub and a few sources of information I have found useful and it’s FREE no pay me this or pay me that, you can just have it.

So enjoy.

Posted in SEO and Traffic | 16 Comments

Digital Cameras and Accessories

This is my latest hub page which is a series of reviews on digital cameras.

Really enjoyed doing this one as I am into photography anyway and I get to show off some of my best pictures (and one or two of the wife’s).

I let her have a go occasionally, she thinks she has a better eye for a shot than me, as if!!

Surprising how long it can take getting all the information together especially when you spend your time reading all about it. Can’t wait to get back to the review on my camera, there was some great information in there about things I didn’t know you could do, guess I should have read the manual a bit better.

Anyway I hope you enjoy reading it as much as I did doing it.

Digital Cameras and Accessories

Posted in online shopping | Leave a comment