Wednesday, March 20, 2013

Installing WAMP or XAMPP and Drupal

WAMP Installation
This post is dedicated to the new installation of a web site.  Haven't done it for a while, so most of my software (previously downloaded) is out of date.

The first step is to get your requirements.  In the old days, you would go to the customer and get some information and put together a detailed specification that the customer would then sign off on.  I prefer to speak to the customer to get an idea of what she wants and then put a basic site together so that early on in the process, she has an idea of what she is getting.  Of course one of the advantages of drupal is that this is easily changed.

Next step is to set up your offline web site.  To do this I use WAMP (Windows, Apache, MySQL and PHP).  It turns out that my version is way out of date and when I uploaded and installed the new version over the old one, it didn't work.  Major problem.  I simply removed the previous version and changed the name of the Wamp folder to wampold and started from scratch.  

Once installed, you can check two things.  going to local host in your browser and coming up with the home page proves that you have connected to the server.  Next you need to get PHPmyAdmin going.  In my case I got a '2002' error telling me that I had been rejected:

#2002 - No connection could be made because the target machine actively refused it.

While the solution could be skype (try stopping it), this is the best answer I found and the one that worked for me:

left click wampmanager icon -> Apache -> httpd.conf 
this will launch notpad to edit the Apache config file 

Look for 'Listen' and change it to 'Listen 0.0.0.0:80' 

reboot the software 

Found the answer at this site:

http://forum.wampserver.com/read.php?2,110318

So finally having got the server going, go to PHPmyadmin and open a new empty database (with the name of your new site) and set up an admin user with a password.. 

Now you download the latest version of Drupal, make directory under wamp/www with the name of you new site and unzip drupal files (not the file name) into this site.

Go to your browser and type localhost/[new site name] and follow the installation instructions.

XAMPP
XAMPP is similar to WAMP in that it is a server that you set up on a Windows machine.  I found that it was less intuitive, but more likely to work.  I tried to get WAMP working again recently and failed.

Like WAMP, you simply download it and run it.  Unlike WAMP, you have to start the various part manually.  The two that are important are Apache and MySQL.  PHP is also included but not in the control panel (which is a little irritating, but not a train smash).  Once again, in order to set it up properly, I had to change the Apache port (using the config button) to 2375 (recommended) instead of port 80.  The down side of this is that you have to go to localhost:2375 to find the main page of the server and localhost:2375/yourwebsite to get to your web site.

If you are using Drupal, there is one other trick that I only learned much later (which I couldn't edit my content types in Drupal) and this is probably applicable to WAMP as well.  

  • Open my.ini (this is the config file for MYSQL)
  • Change max_allowed_packet from 1M to at least 5M (or increase it until the irritating error (PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone) has gone away
  • When you install Drupal, first go to localhost:2375/PhpMyAdmin and add a database (name).  You log in with the password that you set up for MySql.
  • When installing Drupal, don't use the advanced tab and make settings there.
  • The easiest way is to use the same username and password above.



No comments:

Post a Comment