php_pdo_sqlsrv driver

Discussion about the open-source Phalanger [?] project.

php_pdo_sqlsrv driver

Postby dacami » March 22nd, 2012, 4:54 pm

hello!

i want to ask if there is a way to enable php_pdo_sqlsrv_53_nts_vc9.dll extension for ms sql server to build a php commandline executeable?

thanks,
dacami
dacami
 
Posts: 3
Joined: March 22nd, 2012, 4:49 pm

Re: php_pdo_sqlsrv driver

Postby Jakub Misek » March 22nd, 2012, 5:01 pm

Hi!

PDO is currently not supported. It has to be reimplemented into .NET, since .NET is not able to use PDO drivers from native PHP directly.

PDO is planned, however the implementation was not started yet. Currently there is MSSQL extension available, instead of PDO sql server driver.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: php_pdo_sqlsrv driver

Postby dacami » March 22nd, 2012, 5:23 pm

ok, so maybe it is possible to use the php_sqlsrv.dll from microsoft which isn't PDO?
dacami
 
Posts: 3
Joined: March 22nd, 2012, 4:49 pm

Re: php_pdo_sqlsrv driver

Postby Jakub Misek » March 22nd, 2012, 5:49 pm

php_sqlsrv.dll is native DLL written in C language. Its PHP4 version is possible to use from Phalanger, but Phalanger comes already with its reimplementation into C# which is better.

To use mssql extension (http://php.net/manual/en/book.mssql.php) from Phalanger, add following into .config file, into <phpNet><classLibrary> section:
Code: Select all
<add assembly="PhpNetMsSql, Version=3.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03" section="mssql"/>

or
Code: Select all
<add assembly="php_mssql.mng, Version=3.0.0.0, Culture=neutral, PublicKeyToken=4ef6ed87c53048a3" section="mssql-native" />


The second option will load original PHP php_mssql extension, the first one is its .NET reimplementation.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: php_pdo_sqlsrv driver

Postby dacami » March 22nd, 2012, 9:53 pm

thanks for your help!

i tried to use php_mssql.dll, but now my problem is im using win7 64bit os and it throws an error that native extensions only build for 32bit. why can't i choose x86 in my vs2010 configuration manager? only any-cpu option is available?
dacami
 
Posts: 3
Joined: March 22nd, 2012, 4:49 pm

Re: php_pdo_sqlsrv driver

Postby Jakub Misek » March 23rd, 2012, 8:58 am

There are several options:
- use only managed libraries, so your project will run as x64 process without issues. I would definitely replace native php_mssql with PhpNetMsSql which runs x64.
- create post-build action, that will mark your EXE as 32bit only, so it will start is 32-bit app, and all the native PHP extensions will load properly.
Code: Select all
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\corflags.exe" /32BIT  myapp.exe


We will take a look on the configuration manager. It should definitely allow compiling in x86 (even automatically)
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 9 guests

User Control Panel

Login

Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 guests (based on users active over the past 5 minutes)
Most users ever online was 787 on May 12th, 2024, 11:50 am

Users browsing this forum: No registered users and 9 guests