tags:

views:

234

answers:

1

We use Windows for our development systems. I am installing PHP, Apache, MySQL manually. All from zip packages. Now:

If I use php thread safe binaries: pdo_mysql fails to load when executing php.exe from command line. I get the following warning:

PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
 in Unknown on line 0

I checked our RHEL production server, there php thready safety is disabled. So I downloaded not thread safe binaries from here.

Now, I hit another problem: Apache is failing to start. The error.log says:

[Thu Mar 04 13:54:08 2010] [crit] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP.
Pre-configuration failed
[Thu Mar 04 13:54:08 2010] [warn] (OS 995)The I/O operation has been aborted because of either a thread exit or an application request.  : winnt_accept: Asynchronous AcceptEx failed.

How do I install php with support for pdo_mysql in Windows? So, that the command line php.exe works?

Note: In the thread-safe binary, although php.exe was not loading pdo_mysql, the PHP API was able to load it. Because in phpinfo, it was appearing.

A: 

Sorry! It was stupid. I figured out this was the problem: Apache was using the thread-safe SAPI. The command line was using the php.exe supplied by Zend Core!

I reconfigured the "PATH" environment variable: so now it points to the php.exe in the thread safe package. Issues solved.

Sabya