Problem with SQL Server connection

Asked

Viewed 228 times

3

I have a PHP system hosted on a Linux server that queries a SQL Server database through the mssql. It works perfectly on the server. I needed to make some changes to this system, so I put it on my localhost and it was working ok. Out of nowhere, the appointments with mssql stopped working, returning ERR_EMPTY_RESPONSE on the pages.

The connection:

$host='******';
$user='***';
$database='****';
$pass='****';

$con=mssql_connect($host, $user, $pass) or die ("Erro de conexão com o banco de dados"); 
mssql_select_db("$database") or die ("Erro ao selecionar banco de dados");

The connection does not return any error. But when I run a query, like this:

 $sql=mssql_query("SELECT DES_MOVIMENTO, VAL_PRODUTO_MOVIMENTO
 FROM supervisor.MOVIMENTO_ESTOQUE 
 WHERE COD_PRODUTO='1254'") 
 or die ('Erro de conexão com o SIGA');

This error appears: inserir a descrição da imagem aqui

PHP INFO displays these directives: inserir a descrição da imagem aqui

  • In localhost, enable errors in PHP, probably the error has nothing to do with connecting to the database.

  • The errors are enabled.

  • Is there any other localhost page with no database connection? If so, does it work?

  • 1

    Only thing I found was this, I never used mssql so I don’t know if it’s useful: http://sakrawebstudio.blogspot.com.br/2012/05/mssqlquery-cause-neterremptyresponse-in.html

  • @Filipemoraes, all others work. Only pages with mssql queries do not work. Mysql queries work normal.

  • @DH., I’VE TRIED THIS, IT’S NOT DONE :(

  • Use any program to recreate your local system, like Wamp? Use windows?

  • 1

    I use Linux Fedora with Apache. I have already solved, reinstalled the php-mssql module. After reinstalling it worked. Thank you to everyone who helped.

  • Creates an answer with the details that solved the problem

Show 4 more comments

1 answer

1


The problem was fixed by reinstalling the php-mssql module on my local server.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.