0

I am trying to query a remote MSSQL server from php. I connect fine using mssql_connect and run a simple query that gives me 3000 rows but if I try to run a query that gives me more than 100,000 rows it gives me a 500 internal server error. I tried increasing the max_execution_time for the php but with no avail. I don't know how to debug this since the connection is remote and don't have idea to go forward from here. Can anybody give any advice or solution to this problem.

4
  • Code or it didn't happen.. Commented Oct 7, 2015 at 15:02
  • 1
    Anything in the error logs? Are you running IIS or apache? Commented Oct 7, 2015 at 15:03
  • I am connecting from a linux server to a remote Microsoft SQL server. Commented Oct 7, 2015 at 15:06
  • @Naruto : I just tried a simple query , if i run "select * from table where id like '%99%' " it gives me a result of 3000 rows and is fine. But if i try to run "select * from table where id like '%9%'" it gives me "500 internal server error" with a blank screen. Commented Oct 7, 2015 at 15:09

1 Answer 1

1

Thank you guys, it turned out to be a memory_limit issue. I had to increase the memory_limit in php.ini and that fixed my problem. Thanks again for quick replies.

Sign up to request clarification or add additional context in comments.

1 Comment

Fellow reviewers: this is an answer. OP explains what solved it for them, and there are no competing answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.