we know there are a lot of post about connection problems but we think ours is different.
We are not able to connect to the db-server with a second user via php and only one active persistant link is shown as activ.
Sometimes occurs: (every 5-10time)Mssql_pconnect: unable to connect to Server xyzWe
have to press reload in the browser after an error.Environment:Server
1)Web application is running on a
Windows Server 2008 Standard SP2 x64
4 GB RamIIS7.0 with php 5.2.10 configured as
ISAPIServer
2)Database server:Windows Server 2008 Standard SP2 x64
8 GB RamMsSQL Server 2008Php-info
(parts):mssql
MSSQL Support
enabled
Active Persistent Links
1
Active Links
1
Library version
7.0
Directive
Local Value
Master Value
mssql.allow_persistent
On
On
mssql.batchsize
0
0
mssql.compatability_mode
Off
Off
mssql.connect_timeout
60
60
mssql.datetimeconvert
Off
Off
mssql.max_links
Unlimited
Unlimited
mssql.max_persistent
Unlimited
Unlimited
mssql.max_procs
Unlimited
Unlimited
mssql.min_error_severity
10
10
mssql.min_message_severity
10
10
mssql.secure_connection
Off
Off
mssql.textlimit
2147483647
2147483647
mssql.textsize
2147483647
2147483647
mssql.timeout
60
60
any idea or do someone need more detailed
information?
thats our actual netstat: (only 1435) at the DB-Server Webserver (IIS) is @ chsrv099
Proto Local Address Foreign Address State
TCP 10.10.0.102:1435 chsrv099:49188 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:49189 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:49772 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:50785 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:50960 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52495 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52497 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52517 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52547 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52560 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:53532 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:53605 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:53881 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:54116 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:58316 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:58903 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:59193 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:59927 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:59995 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60027 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60154 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60603 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60604 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60605 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60606 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60677 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60707 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60958 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:61445 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:61715 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:61898 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:62180 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:65017 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:65391 ESTABLISHED
1) we are using php 5.2.10 with IIS 7 in ISAPI mode
2) Following Extension are enabled and working properly (in phpinfo listed) extension=php_apc.dll
extension=php_gd2.dll
extension=php_memcache.dll
extension=php_mssql.dll
extension=php_pdf.dll
extension=php_sockets.dll
extension=php_zip.dll
extension=php_mbstring.dll
extension=php_sqlsrv_52_ts_vc6.dll
Theomag
5 Posts
mssql_pconnect: unable to connect to Server
Nov 22, 2011 09:52 AM|LINK
Hallo,
we know there are a lot of post about connection problems but we think ours is different.
We are not able to connect to the db-server with a second user via php and only one active persistant link is shown as activ.
Sometimes occurs: (every 5-10time)Mssql_pconnect: unable to connect to Server xyzWe have to press reload in the browser after an error. Environment:Server 1)Web application is running on a Windows Server 2008 Standard SP2 x64 4 GB RamIIS7.0 with php 5.2.10 configured as ISAPI Server 2)Database server:Windows Server 2008 Standard SP2 x64 8 GB RamMsSQL Server 2008 Php-info (parts): mssqlMSSQL Support
Directive
Uk-Sam
203 Posts
Re: mssql_pconnect: unable to connect to Server
Nov 22, 2011 10:37 AM|LINK
As you say this error occurs randomly, how many active connection you see to MSSQL when netstat command is fired.
Random MSSQL connect usually happens due to MSSQL load.
HCamper
8048 Posts
Re: mssql_pconnect: unable to connect to Server
Nov 22, 2011 11:40 AM|LINK
Hello,
Have you installed the SQL Server Driver for PHP http://learn.iis.net/page.aspx/699/install-the-sql-server-driver-for-php/ .
From the PHP manual and mssql http://www.php.net/manual/en/mssql.requirements.php install the latest PHP for windows.
Martin
Community Member Award 2011
Theomag
5 Posts
Re: mssql_pconnect: unable to connect to Server
Nov 22, 2011 12:32 PM|LINK
Hello,
thats our actual netstat: (only 1435) at the DB-Server Webserver (IIS) is @ chsrv099
Proto Local Address Foreign Address State
TCP 10.10.0.102:1435 chsrv099:49188 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:49189 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:49772 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:50785 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:50960 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52495 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52497 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52517 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52547 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:52560 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:53532 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:53605 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:53881 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:54116 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:58316 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:58903 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:59193 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:59927 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:59995 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60027 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60154 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60603 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60604 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60605 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60606 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60677 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60707 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:60958 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:61445 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:61715 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:61898 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:62180 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:65017 ESTABLISHED
TCP 10.10.0.102:1435 chsrv099:65391 ESTABLISHED
looks like that we have serval connections?
Theomag
5 Posts
Re: mssql_pconnect: unable to connect to Server
Nov 22, 2011 12:56 PM|LINK
Hello,
we are currently using ntwdblib.dll with mssql_(p)connect. we tried to use SqlSrv but using that we have encountered following strange behaviour.
Client 1 Browser:
Command: Select * from xyz where sessionnr=$session;
Info in Browser:CronJob calcLiveValues: OK (this is normally a message from the cronjob bottom next)
------------------------------------------------
Cron Job:(calcLiveValues)=> runs every 30 secs
Insersts/Updates and a lot of calculations returns OK
Error: "Select * from xyz where sessionnr=" ==> that comes from Client 1
Any idea?
thx for your efforts.
HCamper
8048 Posts
Re: mssql_pconnect: unable to connect to Server
Nov 22, 2011 01:28 PM|LINK
Hello,
No ideas yet lets start from the basics: http://learn.iis.net/page.aspx/724/install-and-configure-php/ .
What PHP version how it was installed are the "Bits" working for Extensions and SQL PHP Driver.
The PHP manager information http://www.iis.net/community/default.aspx?tabid=34&g=6&i=2007
download and install it makes life easier.
Are there reasons for using this "ntwdblib.dll with mssql_(p)connect" after the SQL Server PHP Driver is operating ?
I will assume the cronjob statements means "Moodle" is installed some where Local or Remote
and is "Apache" part of the mix ?
Update with more information about the questions.
Martin
Community Member Award 2011
Theomag
5 Posts
Re: mssql_pconnect: unable to connect to Server
Nov 22, 2011 02:06 PM|LINK
Hello,
1) we are using php 5.2.10 with IIS 7 in ISAPI mode
2) Following Extension are enabled and working properly (in phpinfo listed)
extension=php_apc.dll
extension=php_gd2.dll
extension=php_memcache.dll
extension=php_mssql.dll
extension=php_pdf.dll
extension=php_sockets.dll
extension=php_zip.dll
extension=php_mbstring.dll
extension=php_sqlsrv_52_ts_vc6.dll
3) http://learn.iis.net/page.aspx/724/install-and-configure-php/
Our System has some troubles with fastCGI therefore we are still using isapi
4) ntwdblib.dll
we are using that driver because the sql_srv driver is not working properly.
5) Installed Components
neither apache nor moodle is installed
hopefully that helps...
thx Bernd
HCamper
8048 Posts
Re: mssql_pconnect: unable to connect to Server
Nov 22, 2011 03:04 PM|LINK
Hi,
I now have an idea "we are using php 5.2.10 with IIS 7 in ISAPI mode".
Uninstall the current PHP and install the non-thread-safe latest verrsion. See the IIS Net Guide.
Remove the current extension dlls and check the windows folder for duplicate php.ini it may cause problems.
Install the Visual Studio runtimes and security patches and updates
information at the PHP for Windows Download Site.
Information for PHP install and Windows http://learn.iis.net/page.aspx/724/install-and-configure-php/ reference.
Install the PHP manager it should take care of the many settings and configuration.
For FastCGI http://learn.iis.net/page.aspx/770/install-the-microsoft-web-platform-for-php/ select the guide for your Windows.
Test the PHP with PHP Manager.
Reasons for non-thread-safe PHP installs http://forums.iis.net/t/1183101.aspx user questions.
Download and install the PHP SQL Driver as posted earlier.
Read the PHP SQL Driver guide for install.
Use the PHP manager to configure the PHP SQL Driver extensions.
Then run the PHP Sql Driver tests. check the php(info) and tests.
Thanks for this "neither apache nor moodle is installed" love both but they make this harder.
Cheers:)
Martin
Community Member Award 2011
HCamper
8048 Posts
Re: mssql_pconnect: unable to connect to Server
Nov 24, 2011 03:45 PM|LINK
Hi Bernd,
For the PHP Progress or errors questions ?
Martin
Community Member Award 2011
Theomag
5 Posts
Re: mssql_pconnect: unable to connect to Server
Nov 25, 2011 06:16 PM|LINK
Hallo,
we have solved our error in our application wich causes the problem that we ware not able to use fastcgi.
after that we were able to set the iis with your insctructions to fastcgi. Everything is fine.
many thanks Martin..
Bernd