I am runnning MSVC11 x86 and have added the corresponding drivers to ext and added it in the php.ini file.
I have attached screenshots of the errors and have followed what they have asked but they're not making a lot of sense, if anyone has any ideas please let me know.
The most likely case is that the driver DLL you're using is not compatible with your PHP runtime. A similar question on the subject is here.
Each Windows driver release includes various DLLs for each permutation of PHP. For instance, the 1.5.7 release includes the following just for PHP 5.5:
VC9
VC9, NTS (not thread-safe)
VC9, x86_64
VC9, NTS, x86_64
VC11
VC11, NTS (not thread-safe)
VC11, x86_64
VC11, NTS, x86_64
I assume you're correctly using a VC11 DLL, but based on the error message I assume you're using an NTS or x64_64 DDL when you should not be.
The PECL downloads do not specify whether builds are for VC9 or VC11. I believe builds for PHP 5.5+ are VC11, and all prior versions are VC9. That said, the zip releases published in the S3 bucket (referenced in the documentation) do include builds for both VC runtimes for all supported PHP versions.
On a related note of DLL dependencies, you may encounter an error similar to "php_mongo.dll is not a valid Win32 application." If so, that may be due to libsasl.dll missing from your path. This is mentioned in the Windows documentation for the driver and you'll find additional discussion of the issue in PHP-1159.
Related
do they make mongodb php extension for visual studio 2010 (on a win7 32bt operating system) and php version 5.2?
i've seen sites that have the dll for download. (sites listed at the end of this text).
but, looking a the different dlls, i only see them for vc9 and vc11. does that mean that isn't mongo/php extension for my version of visual studio?
any info would be greatly appreciated. thank you.
https://github.com/mongodb/mongo-php-driver/downloads
https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
If you're going to download and use a precompiled PHP extension for MongoDB, the important details to match up are: your version of PHP, what compiler was used, and whether it is 32-bit or 64-bit.
You can get this information from the phpinfo() details or by running php -i from a commmand line.
Look for a "PHP Extension Build" line similar to:
PHP Extension Build => API20100525,TS,VC9
You should then download the latest MongoDB driver DLL zip and find the appropriate DLL to install (matching PHP version, TS vs NTS, and VC version).
For example, with the above output from my 64-bit PHP 5.4 install I would use the php_mongo-1.4.x-5.4-vc9-x86_64.dll.
If your PHP extensions require something other than VC9 or VC11 (which is what the current versions are built with) you can try older driver versions, or ideally update your PHP to a newer version.
This might not be a programming question but I am posting it after long search and confusion.
I have a dedicated server running Windows server 2008/64bit running Apache as a web server and using PHP 5.3.9
I am trying to install APC extension for Apache. From what I found on php.net I should use a V6 version because I am using Apache.
I searched everywhere to find APC for PHP 5.3 vc6 x64 and found nothing
This comment says that "it’s not possible to compile 64 bit PHP binaries with VC6 since it does not have 64 bit compiler" I don't know if that's true or just an assumption
Any help will be gladly appreciated/
Update, I cannot use VC9 as stated on windows.php.net
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP
If you are using PHP with IIS you should use the VC9 versions of PHP
VC6 Versions are compiled with the legacy Visual Studio 6 compiler
VC9 Versions are compiled with the Visual Studio 2008 compiler and
have improvements in performance and stability. The VC9 versions
require you to have the Microsoft 2008 C++ Runtime (x86) or the
Microsoft 2008 C++ Runtime (x64) installed
Do NOT use VC9 version with apache.org binaries
VC9 versions of Apache can be fetched at Apache Lounge. We use their
binaries to build the Apache SAPIs.
Thanks
UPDATE
I was given wrong information about the server configuration and settings. phpinfo() revealed the following:
Compiler MSVC9 (Visual C++ 2008)
Architecture x86
So I used built VC9 and x86 and it worked perfectly.
I used to run PHP as an Apache module on my Windows development machine. However, as PHP has stopped releasing VC6 binaries, I run the VC9 non theadsafe 32-bit versions as a FCGI module. There is plenty of documentation from both Apache and PHP on how to install these.
Then all you have to do is download the latest APC dll from here. Make sure you get the non-threadsafe version (nts), plonk it in your ext folder and just enable it like any other extension.
Edit: Didn't see that you wanted to run the 64-bit version. I haven't had a chance to try that out. However, if you are happy with running 32-bit versions of Apache and PHP, the above should work well.
The problem is that no binary I could find worked, the APC section never appears in the info display and the apc monitor states that APC is not running.
Is there a way to make APC + PHP + IIS work?
Thank you
You need a fitting library.
Be aware of the version number though. From your phpinfo() or php -i you can find out which version you need:
There are three different factors:
32bit vs 64bit
VC6 vs VC9 (Visual Studio Compiler version)
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP
If you are using PHP with IIS you should use the VC9 versions of PHP
VC6 Versions are compiled with the legacy Visual Studio 6 compiler
VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability. The VC9 versions require you to have the Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed
See: http://windows.php.net/
Thread safe vs Non thread safe. (TS/NTS)
php -i|grep VC
Compiler => MSVC9 (Visual C++ 2008)
Zend Extension Build => API220090626,TS,VC9
PHP Extension Build => API20090626,TS,VC9
I usually get them here (32bits):
http://downloads.php.net/pierre/
or here (64bits): http://www.anindya.com/
In theory yes, but you will need, as you already know, a fitting binary. I think the problem is not so much IIS but rather windows in general - its also a pain to get an APC DLL working with Apache under windows.
So in short: if you spend much time compiling it yourself, you might succeed, but I do not know anybody who actually succeeded.
Referring following link
http://www.php.net/manual/en/mongo.installation.php#mongo.installation.windows
There are thread-safe, non-thread safe and with this it is also prefixed with VC6,VC8,VC9.
I have window 7 Ent and I am not able to understand which binary (.dll) I should download from here.
How am I suppose to know which dll I have to download ?
How to identify which VC compiler + thread safe or non-thread safe combination to choose ?.
To tell which PHP install you have, from the command line, run this command:
php -i | more
This will dump phpinfo page by page. On the second page or so, you should see a "Zend Extension Build" and/or a "PHP Extension Build" key under the "System" section. Maybe it will display something like "API###, TS, VC9". TS stands for "thread safe" (which actually also shows as enabled/disabled in the "Thread Safety" key just a bit below that). "VC9" stands for... VC9. You already know you have PHP5.3 installed. This means you want to install the PHP5.3 Threadsafe VC9 version of Mongo.
Also, this is an example of when user provided comments in the PHP manual page are very helpful. Check the first comment by Andrey 01-Jun-2011 11:54.
On http://windows.php.net/download/ there's a 'Which version do I choose?' section on the left.
Which version do I choose?
If you are
using PHP with Apache 1 or Apache2
from apache.org you need to use the
VC6 versions of PHP
If you are using PHP with IIS you
should use the VC9 versions of PHP
VC6 Versions are compiled with the
legacy Visual Studio 6 compiler
VC9 Versions are compiled with the
Visual Studio 2008 compiler and have
improvements in performance and
stability. The VC9 versions require
you to have the Microsoft 2008 C++
Runtime (x86) or the Microsoft 2008
C++ Runtime (x64) installed
Do NOT use VC9 version with apache.org
binaries
VC9 versions of Apache can be fetched
at Apache Lounge. We use their
binaries to build the Apache SAPIs.
Since you are running Windows 7, downloading VC9 would be ideal.
If your App needs to be thread safe, then download Thread safe one. If you are not sure if your application needs to be Thread Safe, you probably won't need Thread Safe Version anyway.
i need help installing and configuring PHP APC i have downloaded from http://downloads.php.net/pierre/ in my PHP info, i see
Compiler MSVC9 (Visual C++ 2008)
Architecture x86
so i downloaded php_apc-5.3-nts-svn20100226-vc9-x86.zip. then to install, i tried adding
[PHP_APC]
extension=php_apc.dll
to php.ini. restarting Apache fails. trying to execute php in cmd results in an error saying php5.dll is missing. but i doubt so. removing the 2 lines from php.ini fixes the error. how can i install apc then?
UPDATE: This is a very old answer. Since then I've used APC well with php5.4 and since the upgrade to php5.5 which removed APC, moved to memcached.
On Windows, seems php5.3 cannot work with APC. I simply use php5.2.5 instead as it's not a production machine anyway.
for the record :
Which version do I choose?
If you are using PHP with Apache1 or Apache2 from apache.org, you need to use the VC6 versions of PHP
If you are using PHP with IIS, you should use the VC9 versions of PHP.
VC6 Versions are compiled with the legacy Visual Studio 6 compiler
VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability. The VC9 versions require you to have the Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed
Do NOT use VC9 version with apache.org binaries
Short story use vc6 for apache and vc9 for windows
Personally i use PHP 5.2.6 and php_apc_3014_php521.dll. It works in production.
I had a similar problem. I used this copy of PHP APC: http://downloads.php.net/pierre/php_apc-3.1-svn20101116-5.3-vc6-x86.zip and it worked to put 3.1.7-dev in place on XAMPP 1.7.7 with PHP 5.3.8