Development Shack Technology Understood

WAMP for Windows, PHP, and other notes  

Installation

So I had the wonderful opportunity to install WAMP 2.5 today.

Unfortunately, not everything went smoothly.

Let me first say that my computer already had this configured and working:

  1. IIS 7
  2. PHP 5.6 (x86)
  3. MySQL Server 5.6
  4. Wordpress 4.1.1

I am a huge fan of a LAMP stack, and installed WAMP because I wanted Apache 2.
This configuration would closely match my live environment and it also includes better out-of-the-box URL rewriting.

So- I installed WAMP and nothing worked exactly right- in the out-of-the-box fashion I had hoped for.

Why?

No discredit to the guys who put the WAMP stack together, but they didn't assume I would already have a running environment with PHP, MySQL, etc.

Issue #1: PHP is confused.

So, my WAMP PHP 5.5.12 was attempting to use my PHP 5.6 php.ini file, extensions, etc. This was an easy fix, I had to change the httpd.conf for Apache2 (C:\wamp\bin\apache\apache2.4.9\conf) to look for the correct PHP ini file:

LoadModule php5_module "c:/wamp/bin/php/php5.5.12/php5apache2_4.dll"
PHPIniDir c:/wamp/bin/php/php5.5.12

The 2nd line above was commented out. I had attempted for 1 hour to get WAMP to use my PHP installation (because it is a newer version) but I suspect that the 64-bit Apache2 server didn't like the 32-bit PHP installation.

I changed this line in the httpd.conf:

# onlineoffline tag - don't remove
Require all granted

It used to only allow access from 'local'. This is just a side-note, as I'm fairly sure that it isn't required.

Issue #2: I like VirtualHost's

In order to enable VirtualHosts in Apache2, I had to run through a host of configuration changes.

First, double-check that the vhosts module is enabled:

LoadModule vhost_alias_module modules/mod_vhost_alias.so

Secondly, create a <VirtualHost> for 'localhost' (notice the ServerName statement):

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot c:/wamp/www/
</VirtualHost>

Now, create another VirtualHost as desired:

<Directory "C:/Projects/wordpress/">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride all
</Directory>

<VirtualHost *:80>
    ServerName me1
    DocumentRoot C:/Projects/wordpress/
</VirtualHost>

In my hosts file, I have hard coded a few URLs to point to my own machine (like me1).

Issue #3: URL-rewriting for Wordpress

This can be found on my other post, but here is the code:

<VirtualHost *:80>
    ServerName me1
    DocumentRoot C:/Projects/wordpress/

    RewriteEngine On

    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.+) /index.php [QSA,L]
</VirtualHost>

Issue #4: php_intl.dll failed to load.

For some reason, php_intl.dll didn't like my machine. I just disabled it from my php.ini file:

;extension=php_intl.dll

No solution here, but I disabled it because I don't need it.

On another note, you might want to change the timezone in the php.ini. I used New York since I'm on the east coast, it was in Paris France as a default:

http://php.net/date.timezone

; Defines the default timezone used by the date functions
date.timezone = America/New_York

And that's it!

With these changes, everything was up and running.