Connecting to DB2 through PHP - php

I'm trying to connect to a DB2 databse from a windows machine using XAMPP.
When I try to load the php_ibm_db2 module I get the following error
"PHP Startup: ibm_db2: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match"
How do I fix this and connect to a db2 database?

This means you are trying to use an old (it seems : it's from 2006) version of the imb_db2 .dll file, with a recent (it's from 2009) version of PHP. You should use the same version for both PHP and the extension.
There is a recent version of some extensions .dll available from http://downloads.php.net/pierre/ ; amongst those, there is a couple of versions of php_ibm_db2.dll 1.8 ; with a bit of luck, maybe they'll match your version of PHP -- and there are versions for both PHP 5.2 and 5.3.

You have different "versions":
20060613
and
20090626
Did you compile these by yourself? Re-compile it.

The top answer got close but didn't have the right php_ibm_db2.dll I needed for PHP 5.3.2 VC9 (windows) NTS (non-thread-safe). But I found one that has it - and many more! Link:
PHP IBM DB2 DLLs on SourceForge via Technology Explorer for DB2

Related

Missing php_ssh2.dll extension for php 7.2 (windows)

Today I wanted to update my dev machine with new php so i downloaded and set up PHP 7.2.7 x64.
After that I sterted collecting missing modules and everything goes fine till i came to the last one: php_ssh2.dll.
Downloaded latest version 1.1.2 from https://pecl.php.net/package/ssh2
Unfortunately it doesn't work. Error:
Warning: PHP Startup: ssh2: Unable to initialize module
Module compiled with module API=20160303
PHP compiled with module API=20170718
These options need to match
Anyone have any tips for me how to make it work?
I have compiled SSH2 module for PHP 7.2 (and PHP 7.3) on Windows. It is available at https://github.com/nufue/pecl-ssh2-windows
On Windows, PHP 7.2.x is built using VC15 and the latest SSH2 module is v1.1.2 which was built on VC14.
So you need to either downgrade to PHP 7.1.x or wait for the PHP team to compile SSH2 in VC15.
Additionally, I have no experience with this but you could decide to compile it yourself in VC15 if you are comfortable with that sort of thing.
Update:
SSH 1.1.2 now has a VC15 build at https://windows.php.net/downloads/pecl/releases/ssh2/1.1.2/
The latest SSH is 1.2 which currently has PHP 7.1-7.4 builds: https://windows.php.net/downloads/pecl/releases/ssh2/1.2/

Can't install gmagick on Windows 7 XAMPP

I have XAMPP 1.8.1 with PHP 5.4.7 installed. When I add php_gmagick_ts.dll to my php.ini (I made sure that I need the ts and not the nts version), upon restarting Apache I'm getting these errors:
The procedure entry point php_checkuid_ex could not be located in the
dynamic link library php5ts.dll
and after that one:
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_gmagick_ts.dll' - The specified procedure could not be found.
Any help?
AFAIK there is currently no GraphicsMagick DLL available working with PHP 5.4 on Windows.
As the availability of php_gmagick_(n)ts.dll for latest PHP versions is always a problem, I recommend that you either drop back to PHP 5.3 (DLLs available here) or that you use the standalone version of GraphicsMagick and call it from within PHP using exec() commands.

php starup sqlsrv unable to initialize module

I am trying to connect MSSQL to PHP. i am following this tutorial. Anyway after i added the dll files as described in that tutorial, i get the following warning. How can i solve this ?
php starup sqlsrv unable to initialize module module compiled with module api=20090626 php compiled with module api=20020520 these options need to match
note:i have gone through this post but none helped.
Looks like you've tried to install the sqlsrv extension for php 5.3 on a php 5.2 system.
Either run <?php phpinfo(); ?> and look for the php version and look for the following entries:
PHP Version
Thread Safety
pick the appropriate .dll from the sqlsrv driver: the version number must match and if thread safety is enabled pick the ts version, if not pick the nts version.
For anyone trying to get it to work with PHP 5.5 (PHP compiled with module API=20121212) then you can replace the dlls in the ext folder with new updated binaries >here<
Don't forget to enable the new dlls in the php configuration.
In my case the issue was with multiple php version under an Apache. The php cli loaded another php version's php.ini. The takeaway is: always check the configuration before you dig deeper into the problem.

WAMPSERVER php_memcache extension

I have a copy of php_memcache.dll (from php_memcache-2.2.6-5.3-nts-vc9-x86.zip) which I have placed in my C:\wamp\bin\php\php5.3.5\ext folder.
In WAMP I can see php_memcache in my extensions list, however whenever I start the extension I get the following warning:
PHP Startup: Unable to load dynamic
library
'C:/wamp/bin/php/php5.3.5/ext/php_memcache.dll'
- The specified module could not be found.
This does not happen for any other extension that I can turn on or off.
Have tried moving php_memcache.dll to C:\windows\system32 but makes no difference.
Any ideas?
Your extension probably not fit the compilation mode of wampserver.
Is it compiled with vc9 (visual 2008) and a non threads safe support ?
My wampserver (latest available) is compiled in VC6 TS.
To know this info check phpinfo() on line :
Compiler
Thread safety
I'd suggest trying other versions of the dll.
2.2.5.0 works for me using WAMP.
The VC9 builds are the only supported builds. VC6 (which is used as convenience builds by Apache) is not supported anymore.
Latest PHP version (and PELC extensions) are only available as VC9 builds. Xamp are already moving their suite to VC9, other already did. You can also do it yourself using apachelounge.com builds, which are the ones we recommend to use with PHP Binaries.

SAPRFC dll and PHP 5.5

I wanted to try using SAPRFC dll along with PHP to retrieve data from SAP server at our company, but after downloading the latest version (1.4.1) from http://sourceforge.net/projects/saprfc/files/
Then, I added the dll files (php_saprfc_528.dll and php_saprfc_530.dll) to PHP extensions folder, then I updated php.ini file. When I start Apache server, the following error message shows to me
PHP Startup: saprfc: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20121212
These options need to match
Googling this issue, I found that that saprfc was compiled with another version of PHP not same as the one I'm using. I'm running PHP 5.5.9, so I started looking with saprfc dll file compatible with PHP 5.5, but I couldn't find.
Can anybody please provide the download for the php_saprfc.dll which will work with PHP 5.5, or what are the steps for compiling php_saprfc.dll that will make it compatible with PHP 5.5
Thanks
Compiled php module you can download here: https://sourceforge.net/projects/saprfcsapnwrfc/files/?source=navbar
Have you installed the RFC DLL on the system in question? At runtime the SAPRFC PHP module needs it - from the installation instructions (As you mentioned DLL I'm assuming you're using Windows):
For installation (from binary package):
PHP binaries (http://www.php.net/downloads.php)
librfc32.dll in Windows System directory (or SAPGUI installed)
You can obtain librfc32.dll from a system that has SAPGUI installed (check the Windows directory) or by installing the classic RFC SDK. For more information on that SDK, see note 27517 (SAP SMP login required).
Once you've done that and if the PHP module still doesn't work, then you can consider recompiling. See the instructions in that same installation guide for instructions. They do mention Visual C 6.0 though, which is rather old...

Categories