php driver iis problem

298 views
Skip to first unread message

Rhino

unread,
Jun 16, 2009, 2:44:36 PM6/16/09
to mongodb-user
Hi,

added the line: extension=php_mongo.dll to the php.ini file
and put the php_mongo.dll file in the extension folder.

when trying this:
<?php
phpinfo();
?>

I dont see a mongo column (like the php install page showed).

When I try the other example:

$connection = new Mongo();

I get the error: "PHP Fatal error: Class 'Mongo' not found in..."


I'm probably missing something obvious. Can anyone point me in the
right direction?

Thanks

R

p.s. I tried adding a fake extension name in the php.ini file
(extension=noneexistingname.dll) and this resulted in an error. This
means the mongo dll is in fact found and loaded... (right?)
p.s.2. the mongod is running in the background without errors

Mitch Pirtle

unread,
Jun 16, 2009, 3:19:31 PM6/16/09
to mongod...@googlegroups.com
I know this might sound daft, but did you remember to restart the IIS service?

-- Mitch

Rhino

unread,
Jun 16, 2009, 3:32:27 PM6/16/09
to mongodb-user
just tried it... no effect.

my server is windows server 2003 running iis 6

Rhino

unread,
Jun 16, 2009, 3:36:47 PM6/16/09
to mongodb-user
ah right. I also tried running php from the commandline. Same effect

I'm sure I'm missing something obvious here.... Question is:
what :^)

Kristina Chodorow

unread,
Jun 16, 2009, 3:44:42 PM6/16/09
to mongod...@googlegroups.com
It sounds like you're doing everything right. What PHP version are
you using/where did you get it? Someone from Microsoft warned me
that, as I compiled the extension with VC2009, it will only work with
PHP compiled with VC2009 (ah, the joys of Microsoft products).

It also probably will only work with 32-bit, are you using a 64-bit
machine/version of PHP?

Does the command line give you any errors on startup?

I was trying to get IIS working on my machine, glad I can ditch that :)

Rhino

unread,
Jun 16, 2009, 4:03:05 PM6/16/09
to mongodb-user
hi,

Thanks for the answers so far,

php version is: PHP Version 5.2.9-2
got it here: http://www.php.net/downloads.php

regular 32 bit version of windows

vc2009? There is a beta out from 2010, and 2008 is the latest version.
I thought.
Compiling binaries with the latest compiler might sometimes cause
problems. But usually, given the correct compile settings you can
still target old windows versions. (It would be very impracticle
otherwise)

Reinier

Kristina Chodorow

unread,
Jun 16, 2009, 4:09:44 PM6/16/09
to mongod...@googlegroups.com
Aha! It will not work on PHP 5.2.*, sorry. It will only work with
PHP 5.3 and up.

I know that this is inconvenient for a lot of people, as 5.3 is only
on release candidate 3, but compiling the driver for PHP 5.2 is
brutal. You can download PHP 5.3 at
http://windows.php.net/qa/#php-5.3-nts-VC9-x86, if you'd like to give
it a try.

Sorry, VC9, not VC2009. Confusingly, Visual Studio 2008 is called VC9.

Rhino

unread,
Jun 16, 2009, 4:13:42 PM6/16/09
to mongodb-user
ok thanks!

I'll upgrade php tomorrow (it's past 10 pm here) and report back.
thanks for the help,

Reinier

On 16 jun, 22:09, Kristina Chodorow <krist...@10gen.com> wrote:
> Aha!  It will not work on PHP 5.2.*, sorry.  It will only work with
> PHP 5.3 and up.
>
> I know that this is inconvenient for a lot of people, as 5.3 is only
> on release candidate 3, but compiling the driver for PHP 5.2 is
> brutal.  You can download PHP 5.3 athttp://windows.php.net/qa/#php-5.3-nts-VC9-x86, if you'd like to give

Rhino

unread,
Jun 17, 2009, 2:47:45 PM6/17/09
to mongodb-user
Hi Kristina,

I know this is probably not the proper place to ask this, but since
you apparently had gotten 5.3 rc3 running, you might have bumped into
this same issue and have the solution.

I created a clean install dir, unzipped the new php, modifed the
php.ini slightly and now I get: can not find: php5ts.dll

I checked the zip and indeed it's not included. Now I can of course
get a dll out of an older zip but this does't sound like a top plan.

any suggestions on how you solved this?

Reinier

Kristina Chodorow

unread,
Jun 17, 2009, 3:48:19 PM6/17/09
to mongod...@googlegroups.com
Hmm, I didn't run into that problem. Are you sure you downloaded a
thread safe version? I just downloaded and unzipped
http://windows.php.net/downloads/qa/php-5.3.0RC3-Win32-VC9-x86.zip,
which contained php5ts.dll.

Rhino

unread,
Jun 19, 2009, 8:01:19 AM6/19/09
to mongodb-user
*blush*

right...

The rc is out by the way, so I downloaded this (the threadsafe version
that is), and it works fine! I actually got mongodb results flowing
back.

thanks!

On 17 jun, 21:48, Kristina Chodorow <krist...@10gen.com> wrote:
> Hmm, I didn't run into that problem.  Are you sure you downloaded a
> thread safe version?  I just downloaded and unzippedhttp://windows.php.net/downloads/qa/php-5.3.0RC3-Win32-VC9-x86.zip,

Rhino

unread,
Jun 24, 2009, 11:03:29 AM6/24/09
to mongodb-user
Hi Kristina,

One more thing to note about using PHP 5.3, is that it doesn't come
with an ISAPI dll anymore. So you can only use it with CGI.
So this means, that Mongo on PHP only works with a release candidate
version, which only works on CGI (given that there won't be an
eventual community isapi release of course)

Is 5.2 so completely different than 5.3 that it gives these headaches
while creating the driver?

R

Kristina Chodorow

unread,
Jun 24, 2009, 12:51:37 PM6/24/09
to mongod...@googlegroups.com
Unfortunately, 5.2 is very different (as far as building on Windows goes) and a huge pain to get working.  I'll give it one more stab, I think a lot of people would prefer not having to upgrade their PHP!  I don't hold out a lot of hope, though.

In the 5.3 migration guide (which isn't available yet, I'm just subscribed to the doc commit list), it says:
    Support for the ISAPI module have been dropped, use the improved 
and much better FastCGI sapi module instead.
So, it sounds like you could use sapi instead?  I'm not really up on this stuff, though, I could be wrong.

Mitch Pirtle

unread,
Jun 24, 2009, 11:01:57 PM6/24/09
to mongod...@googlegroups.com
Saw this and thought of you :-)

http://en.wlmp-project.net/

LightTPD is my fave, and I can use it to serve apps in PHP, rails,
whatever without having to fire up separate mongrels or other
containers - all thanks to fastcgi. You should give it a shot, as it
turns your windows machine into a very lean, mean httpd.

-- Mitch
Reply all
Reply to author
Forward
0 new messages