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.
Related
This question already has answers here:
How do I get the SQLSRV extension to work with PHP, since MSSQL is deprecated?
(3 answers)
Closed 3 years ago.
I'm trying to run mssql driver for PHP, but something goes wrong.
I managed to get the right drivers for mssql, then added the extensions in php.ini, but PHP is still running "--without-mssql" "--without-pdo-mssql".
I'm running PHP 5.4 under Apache 2.2 on Windows XP SP3.
How to start the mssql drivers?
I've just had the same problem, for me I needed to use a different version of the driver.
I was using:
extension=php_sqlsrv_53_ts.dll
Which gave me the following error in PHP:
[28-Nov-2013 10:58:47 UTC] PHP Warning: PHP Startup: sqlsrv: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API
The solution:
extension=php_sqlsrv_54_ts.dll
Download from: http://www.microsoft.com/en-us/download/details.aspx?id=20098
See this answer: https://stackoverflow.com/a/25199324/1847383. If you use PHP as an Apache module, use the thread safe version.
I have found a great tutorial and explanation on this website:
http://bendustries.co/wp/setting-up-xampp-to-work-with-mssql/
All you need to do is download from here :
https://www.microsoft.com/en-us/download/details.aspx?id=20098
two files called:
php_pdo_sqlsrv.dll
php_pdo_sqlsrv.dll
And place then inside the php\ext folder.
Then you need to add those two lines under "Dynamic Extensions"
extension=php_sqlsrv.dll
extension=php_pdo_sqlsrv.dll
Save your php.ini file and restart apache, This process worked for me on win7 after I tried several other methods !
I downloaded the php_printer extension from http://downloads.php.net/pierre/ . But when i try to configure my php.ini file, a message pops-up saying that
PHP Startup: printer: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
I am using EasyPHP for Windows. The PHP version is 5.4.6 and that of Apache is 2.4.2
I went through other questions of similar kind but i am not server-admin or like so I don't have any idea of Command-Line PHP, and recompile things. Can anyone find me a good and easy solution to this.
PS: If the solution is not easy and i really have to recompile the PHP extension, please provide me with the steps how to do that on Windows.
Basically the extension was compiled to work with php 5.3, and you are trying to use it with 5.4
One solution is to downgrade EasyPHP to php 5.3 to make it work.
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
I'm trying to get a PHP site working in IIS on Windows Server with MySQL.
I'm getting this error…
Fatal error: Call to undefined function mysql_connect() in C:\inetpub...\adodb\drivers\adodb-mysql.inc.php on line 363
Update…
This link outlines the steps I followed to install PHP on my server:
How do I get PHP and MySQL working on IIS 7.0 ?
(note especially steps 6 and 8 regarting php.ini and php_mysql.dll).
Only two lines in the phpinfo report reference SQL:
<?php
phpinfo();
?>
Configure Command:
cscript /nologo configure.js "--enable-snapshot-build" "--enable-mysqlnd"
sql.safe_mode:
Local Value Off, Master Value Off
PHP Configure Command http://img79.imageshack.us/img79/2373/configurecommandmw8.gif
PHP sql.safe_mode http://img49.imageshack.us/img49/3066/sqlsafemoderu6.gif
Update…
I found the solution: How do I install MySQL modules within PHP?
Check out phpinfo to see if the mysql functions are compiled with your PHP
<?php
phpinfo();
?>
Since in some versions of php, its not default with the install.
Edit for the Update:
You should have a full MySQL category in your phpinfo();
See this for example: https://secure18.easycgi.com/phpinfo.php (googled example)
It sounds like the version of PHP you are using has not been compiled with MySQL support, or has not been enabled in the php.ini.
Looks like you haven't got the MySQL PHP extensions installed! You shouldn't have to do any configuration other than installing the correct modules (and shouldn't be doing anything with ADODB).
PHP comes in 2 versions as well - a CGI version and an ISAPI module. You're best using the ISAPI version with ISS and adding all the trimmings...
I found the solution: How do I install MySQL modules within PHP?
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...