Posts Tagged ‘Development’

Getting Apache 2.2 to work with PHP 5.2 on Windows

Tuesday, August 12th, 2008

Sad truth of the matter is that I need to be able to access Microsoft SQL from PHP.  The old cross-platform PHP mssql functions are depreciated and will not authenticate with SQL Server 2005 or 2008–now to access MSSQL stuff, you need to use Microsoft’s SQL Server 2005 Driver for PHP .  Which is only available for Windows.

I do all my primary development on a Mac, but now I have a Windows dev server for PHP apps that interface with Microsoft SQL.  This new machine runs Vista, and I’m using all the latest versions–(Apache 2.2 and PHP 5.2.6).

I’ve installed PHP on many Windows systems, and usually it is dead simple:

  • Install Apache
  • Download PHP, Zip Version
  • Unzip php zip file into c:\php
  • Copy php.ini-dist to php.ini
  • Modify the $PATH Environment Variables to include “c:\php”.  Reboot for changes to take effect
  • Append httpd.conf with
    LoadModule php5_module "c:/php/php5apache2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "C:/php"
  • Restart Apache

Only this time I was getting an error when I restarted Apache.  Checking the error.log I noticed this error.

Cannot load C:/php/php5apache2.dll into server: The specified module could not be found.

Strange error.  php5apache2.dll does exist and in that location.  I double and triple-checked.  It is there.

Eventually I discovered that if you’re using Apache 2.2 you need to use the php5apache2_2.dll not php5apache2.dll. This is not in PHP’s install.txt documentation, nor does the Apache error log steer you in the right direction.  It should say something like “unable to load module” not “module not found”.  You’re just supposed to know.  Nice.

So to recap, do everything the same except instead of putting this in your httpd.conf:

LoadModule php5_module "c:/php/php5apache2.dll"

use:

LoadModule php5_module "c:/php/php5apache2_2.dll"

So if you’re getting that error message, there is your solution.

Windows Server / SQL Server / Visual Studio 2008 Launch Tour

Monday, February 4th, 2008

So Microsoft is having their Windows Server / SQL Server / Visual Studio 2008 Launch Tour starting the end of this month and running into the springtime.

If you thought that 2005’s “Ready, Set, Launch!” was dumb name, they’ve come up with a really, really lame name for it this time: “Heroes Happen Here”.

They are having a Seattle one on April 1st at the Convention Center.

Nik, Matt, Grant and I went when they did the 2005 stuff, it was worth attending (would be more worth attending now that I’m using those products on a day-to-day basis). There were several tracks–database, development, and administrators (I think)–for seminars, which were fairly well done. We got a bunch of free products/licenses (SQL Server 2005, etc.), as well as some door prizes.

Anyway, I was planning on going, would like to learn about the new stuff. This year they have four tracks: IT Pro, Data Platform, Partner/Reseller and Developer. Developer track is currently full in Seattle, but has a waiting list.

On a side note, check out this hilarious post on what it would be like if Microsoft were a Schoolboy and software were homework.