I have used default MS SQL driver to connect to a SQL server in a php application.
I'm using XAMPP 1.6.8. my php version is 5.2.6.
Application was connected successfully to the SQL server and the application was running successfully for a long time. Now suddenly the application is showing an error on mssql_connect() function with same MS SQL access information.
the error is "Unable to connect to server: xxx.xxx.xxx.xxx"
I also checked the SQL server access info with a SQL client. SQL client can connect successfully, therefore i think the access info is correct.
Can any one help me resolved this issue?
Thx
I just found my solution here. http://jimmyli.net/2009/03/php-unable-to-connect-to-mssql/ .problem was that the file ntwdblib.dll packaged with PHP5 was an old version. then i just replace with updated one from here http://jimmyli.net/wp/wp-content/uploads/2009/03/ntwdblib.zip
Thx
Related
I have already Docker and SqlServer which is works normally. Now i want to connect to sql server with php. it gives me could not find driver error. I use php 8 on centos 7. How can i fix it?
I am trying to test a trial version of ArrowChat on windows (using IIS and MS SQL Server). I have installed the extensions of MS SQL Server and when i connect using a PHP script, i get connected successfully. However, with Arrow chat it errors. It doesnt show any error details either.
Is there a way to see the log? I am not a PHP developer.
I'm moving some php sites backed by SQL from a 2003 server to a 2012R2 server. I haven't had time to update code to use a newer php version so am using 5.2.10. I have everything working except I can't get a connection to the SQL server - the latter has not changed.
The errors I'm getting are:
PHP Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server...
PHP Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in...
How can I verify that mssql_connect and mssql_select_db are working? Or do those errors mean that they are? The credentials are the same as those on the currently working server to be replaced so I'm fairly certain that's not it but if I can be assured that the php side is working, I'll invest my attentions back to SQL and/or a possible network issue (although they're on the same network behind a firewall so that shouldn't be it)
I'm stuck with what to do next.
i was wondering if anyone knows why i am getting the following error.
I have an application doing massive queries to a SQL 2008 Server. The main application runs over PHP on linux , I call many php scripts simultanously to a windows server running PHP over xampp, this server queries the sql database and this is where I am getting the error.
On this windows server I hava PHP 5.4.4 with the sqlsrv extension. I have the sql server configured to handle unlimited connections. however when I send many API calls (thousands) i eventually start getting connection errors like the one below,
Unable to connect to server
I read that mssql conection can be tuned with the max_procs config, however I am using sqlsrv extension instead and I havent found any info regarding this .
Has anyone experienced this issue before.
Thanks in advanced.
I have a big problem connecting my php page which is running on the same PC as my SQL Server with the SQL server and execute things...
Maybe this following warning will help you:
Warning: odbc_connect(): SQL error: [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. , SQL state 08001 in SQLConnect in MY_CONFIG_FILE on line 9
I wonder what causes this problem as the webserver with the php page is running on the same machine as my SQL server does.
I´m using this code:
odbc_connect("Driver={SQL Server Native Client 11.0};Server='MY_IP';Database='MY_DATABASE';", 'MY_SQL_USER', 'THE_PW_OF_MY_SQL_USER');
What I have tried so far:
Adding the IP to the host file of Windows
Switching the complete firewall off
adding a User-DSN ODBC Connection called SQLEXPRESS with a working connectivity test
Connecting from my home PC with SQL Management Studio to the SQL Server. It worked with the same login data and IP which I´ve added in the SQL Config File.
Enabling TCP/IP and Named Pipes in the SQL Management Studio on port 1433
Restarting everything several times (Professional Solution, I know ;))
enabling TCP/IP and Named Pipes in the cliconfg.exe
I hope there are some gurus here which can help me :)
Thx a lot in advance ;)
I´m sorry for the troubles.
The problem was, that I was using SQL Server Native Client 11.0 as driver.
I switched it to SQL Server and now it works :/
Hopefully this at least helps someone, being in a similar problem....