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');
In localhost, enable errors in PHP, probably the error has nothing to do with connecting to the database.
– Filipe Moraes
The errors are enabled.
– Amanda Lima
Is there any other localhost page with no database connection? If so, does it work?
– Filipe Moraes
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
– DH.
@Filipemoraes, all others work. Only pages with mssql queries do not work. Mysql queries work normal.
– Amanda Lima
@DH., I’VE TRIED THIS, IT’S NOT DONE :(
– Amanda Lima
Use any program to recreate your local system, like Wamp? Use windows?
– Filipe Moraes
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.
– Amanda Lima
Creates an answer with the details that solved the problem
– rray