Attempting to connect to mssql, as a result of following line, it returns 'null':
if (!function_exists('mssql_pconnect')) return null;
Any idea/solution?
mssql_pconnect
Moderators: Amaradana, TurboPT, TL Developers
Re: mssql_pconnect
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.
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.
Re: mssql_pconnect
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.
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.
Re: mssql_pconnect
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:
[the command is the same on Linux]
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
What about the other part:
Also, if you have the php command-line available, you could also check existence like this: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...
[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
Exception: Function mssql_pconnect() does not exist
Exception: Function mssql_get_last_message() does not exist
Re: mssql_pconnect
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.
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.
Re: mssql_pconnect
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:
Taking a brief look through the link you posted, I did find with "system requirement", that is had this:
Do know if that is installed? If not, they have a link at the requirements where I found that info.MS-info-link wrote: Microsoft SQL Server 2008 R2 Native Client is required to use Microsoft Drivers for PHP for SQL Server.
Re: mssql_pconnect
I had to replace php-5.3.17 with php-5.2.17 and install sql server clien tool.
Cheers,
AO
Cheers,
AO
Re: mssql_pconnect
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...
Anyway, whatever it takes to get it working, I guess...