This topic is locked
[SOLVED]

 MSSQLUnixConnection.php

6/13/2016 2:05:21 PM
PHPRunner General questions
E
e k author

Sergey et al,
I have the following error message when trying to access a website made with PHPRunner:
Warning: mssql_connect(): Unable to connect to server: 00.000.000.000:0000 in directory/MSSQLUnixConnection.php on line 39
Host: 00.000.000.000:0000

User: username

PWD: password

dbname: database

Conn:
Fatal error: in directory/MSSQLUnixConnection.php on line 60
The echo statement wrote to generate the above credentials takes up 14 lines, I just put it in to try to handle some of the error. Bolded parts have been changed for obvious reasons. I worked on I am using a WHM web hosting platform running PHP 5.4, and PHPRunner 9.0. I've read through the threads and although I have seen postings talking about trying to telnet into the database, that is not a reasonable possibility under my particular constraints (I'm fairly bound by the WHM GUI). I'm unsure what I need to do to effectively handle this error.
Thank you for your time.

Admin 6/13/2016

I'm not quite sure I understand. Do those connection parameters look correct? "Unable to connect" means either connection parameters are incorrect or something prevents PHP code from connection i.e. SQL Server doesn't allow remote connections.

E
e k author 6/14/2016



I'm not quite sure I understand. Do those connection parameters look correct? "Unable to connect" means either connection parameters are incorrect or something prevents PHP code from connection i.e. SQL Server doesn't allow remote connections.


The SQL server is set to allow remote connections, though I have no proof that any connections get that far. When we looked at the network traffic, the GET request goes out but doesn't query the server afterward. The connection parameters appear to be right, and I get the same error whether I use a trusted connection, or sign in as other users. Our server is running Windows Server 2012 R2. Is it problematic that it is invoking MSSQLUnixConnection.php? Should I, instead, look at our hosting provider?
Thanks, again, for your help.

Admin 6/14/2016

I guess PHPRunner is not finding another ways to connect and resorts to MSSQLUnixConnection.php.
Check if php_com_dotnet.dll extension is enabled in php.ini

E
e k author 6/15/2016



I guess PHPRunner is not finding another ways to connect and resorts to MSSQLUnixConnection.php.
Check if php_com_dotnet.dll extension is enabled in php.ini


Would it help to say that I'm using HostGator? Or, if that's not palatable, that I'm with a hosting company that rhymes with roastbaiter? We have a basic cPanel loadout to work with. Is there some part of PEAR that I can install to fix these connectivity issues?
The host is on linux kernel (I definitely got this wrong, and I'm sorry about that): 3.12.41-77.ELK6.x86_64

Php version 5.4.45 but I can adjust that to any other up to 7.0

Admin 6/15/2016

What you saying doesn't make much sense to me. How can you "Our server is running Windows Server 2012 R2" and at the same time "The host is on linux kernel".

E
e k author 6/15/2016



What you saying doesn't make much sense to me. How can you "Our server is running Windows Server 2012 R2" and at the same time "The host is on linux kernel".


My apologies, Sergey, I haven't been terribly clear. I'm trying to set up PHPRunner on a HostGator site. That 'host' is based on a linux kernel. I'm trying to set up the site so that it queries 'our' MS SQL server on a Windows Server running Windows Server 2012 R2.
I'm terribly sorry about the confusion, I'm a new programmer and I'm still learning the ropes.

Admin 6/15/2016

If PHP code runs on Linux server than nothing is wrong with the use of MSSQLUnixConnection.php.
Two things you need to check:

  1. Connection parameters are correct
  2. SQL Server accepts remote connections in general and connections from your web server particularly.
    This is it. Nothing to change in PHPRunner application itself. It will work once it is able to connect.

E
e k author 6/24/2016

After some struggle, this was resolved by changing the following code in /home/placename/username/projectname/connections/connectionmanager.php
Add this part

$data["connInfo"][0] = "xx.xxx.xxx.xxx:1433";

$data["connInfo"][1] = "username";

$data["connInfo"][2] = "password";

$data["connInfo"][3] = "database";

Just before this part (and add the //)

// $data["connInfo"][0] = "This address' format was incorrect.";

// $data["connInfo"][1] = "username";

// $data["connInfo"][2] = "password";

// $data["connInfo"][3] = "database";