mssql_pconnect

LATEST Official version.
Questions and discussions - NO ISSUES
FOR ISSUES => http://mantis.testlink.org

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
aostad
Member of TestLink Community
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

mssql_pconnect

Post by aostad »

Attempting to connect to mssql, as a result of following line, it returns 'null':
if (!function_exists('mssql_pconnect')) return null;

Any idea/solution?
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Re: mssql_pconnect

Post by TurboPT »

If you can edit the php.ini file, and this is not a production environment, it is possible to [temporarily] set:

display_errors = On // default is Off

To show the error[s] directly on the page. Make sure to restart the webserver after applying this change.

To the original question: I would say yes for MSSql, but the configuration might be tricky...

Is the mssql extention loaded, or available ? If so, there would be a php_mssql.dll file being loaded in the configuration. Search the php.ini file, it might be there, but may be commented-out with a ;
Of course, that dll should be available within the PHP installation as well.

But know there could be other configuration factors involved. [url, user/pass, etc]

Again, as with any changes to php.ini requires a restart of the webserver.
aostad
Member of TestLink Community
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: mssql_pconnect

Post by aostad »

Thank you very much for the hint. I've turned on the display_error. This is what I get:
Fatal error: Call to undefined function mssql_get_last_message() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\testlink\third_party\adodb\drivers\adodb-mssql.inc.php on line 545

I'm trying to connect to TFS (MS Team Foundation Server) database, which is sqlServer.
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Re: mssql_pconnect

Post by TurboPT »

Ok, but that only covers the first part of my previous post, so that you can see warnings/errors on the page...

What about the other part:
TurboPT wrote: ... I would say yes for MSSql, but the configuration might be tricky...

Is the mssql extention loaded, or available ? If so, there would be a php_mssql.dll file being loaded in the configuration...
Also, if you have the php command-line available, you could also check existence like this:
[the command is the same on Linux]

Code: Select all

C:\Users\TurboPT>php --rf mssql_pconnect
..and...
C:\Users\TurboPT>php --rf mssql_get_last_message
For both, since I don't have mssql configured, I get:

Exception: Function mssql_pconnect() does not exist
Exception: Function mssql_get_last_message() does not exist
aostad
Member of TestLink Community
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: mssql_pconnect

Post by aostad »

It looks like there is no php_mssql.dll but there is php_pdo_sqlsrv_53_nts_vc6.dll. Since the TFS database is sqlServer I've downloaded and installed sqlServer driver from MS (http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx).
A bunch of php_pdo_sqlsrv_*.dll and php_sqlsrv_*.dll have been installed in PHP\ext directory.

Since my php is 5.3.7, I've added following line in php.ini:
extension=php_pdo_sqlsrv_53_nts_vc6.dll

and this one for mssql:
extension=php_pdo_mssql.dll

I get following errors by running your suggested commands:
C:\php\ext>php --rf mssql_pconnect
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_pdo_ms
sql.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_pdo_sq
lsrv_53_nts_vc6.dll' - The specified module could not be found.
in Unknown on line 0
Exception: Function mssql_pconnect() does not exist


Since there is no php_pdo_mssql.dll, the first error is obvious, however, I don't know why it can not find php_pdo_sqlsrv_53_nts_vc6.dll.

Since I use MySQL for test link database, I've not installed mssql at the time. I should find out how to add PHP driver for mssql now.
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Re: mssql_pconnect

Post by TurboPT »

Restart the server after making the extension change?

Taking a brief look through the link you posted, I did find with "system requirement", that is had this:
MS-info-link wrote: Microsoft SQL Server 2008 R2 Native Client is required to use Microsoft Drivers for PHP for SQL Server.
Do know if that is installed? If not, they have a link at the requirements where I found that info.
aostad
Member of TestLink Community
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: mssql_pconnect

Post by aostad »

I had to replace php-5.3.17 with php-5.2.17 and install sql server clien tool.

Cheers,
AO
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Re: mssql_pconnect

Post by TurboPT »

It's annoying that you had to go back a version [...MicroSoft is supposed to be easier??]

Anyway, whatever it takes to get it working, I guess...
Post Reply