2

I have very strange situation...

Platform: Win7, apache24, mysqld 5.6.x, php5.5.10

query1 = "SELECT abc FROM table1 WHERE id=123 " (result give me about 200 rows)

query2 = "SELECT abc FROM table2 WHERE id=555 " (result give me about 200 rows)

In short, PHP code looks like this:

step1. I'm using my own DB Wrapper and I make query1 to table1. In result I receive multiple rows from table1. I save it to php array using while loop.

step2. next I make curl requests to 3rd party API using foreach loop. Request are very simple and working fine at 150 other places in my script.

What is wrong?

Scripts are working fine.. but only one time after apache start/restart.

What going next?

  • When I try reload page for test it again - curl response is empty. http_code for curl request is 200, but request is empty.

  • After apache restart script working again - one time.

  • Without step1 curl working fine all time.

  • And one more... when I try query2 (similar to query1) but for different table (query2 to table2) script works fine everytime (after refreshing too).

What i tried:

  • testing different headers in curl,
  • curl options like curlopt_fresh_connect and all f... possible configurations.
  • dumping printing all possible variables...
  • googling, binging, yandexing....
  • after step1 I tired connect to different websites than API, google, websites without ssl etc - result is the same. Crash after 1 run.

Browser cache is not a problem, API limits are fine.

I wasted for it 9 hours and I dont know what is wrong:) If you have any ideas - please share with me.

  • Have you tried reinstalling different version of apache? – Roshan Feb 19 '19 at 01:16
  • @Roshan I tried run code on 2 different VMs. After your reply I tired with latest apache version. No good result. – StackOver666 Feb 19 '19 at 01:28
  • 1
    Or maybe there's a conflict on your DB wrapper. You made all of that? – Roshan Feb 19 '19 at 01:33
  • full error checking and display is on? –  Feb 19 '19 at 01:46
  • @Roshan I dont think that is a problem on DB wrapper side. Query working well in described file and in other files. – StackOver666 Feb 19 '19 at 01:55
  • @tim, yes + logging all errors + debug_backtrace for all functions + logging every action(update, insert, select, changes, script steps) to database. Also I follow queries in real time at /server-status – StackOver666 Feb 19 '19 at 01:55
  • php5.5.10 you know that's no longer supported and should not bee used right? –  Feb 19 '19 at 02:10
  • @tim, yes but I think that the problem is not related to php version. I have alot of code which works great with this php version. I use that code for development "localhost" projects which I never interact with people. For temporary I moved SQL query to separate file and I will connect to thiis file using curl (ex localhost/file.php?ids=1,2,3,4,5. But it is not a solution for above problem. I need to know why it crashing. If you have any more ideas please write, i will describe final solution in this topic. – StackOver666 Feb 19 '19 at 02:19
  • We cannot debug your problem without access to logs/errors/data. So just 2 ideas: a white page is usually a result of a php error, so make sure you [display errors](https://stackoverflow.com/q/1053424) (and add them to your question). If this doesn't help to narrow it down: if it's a database problem and replacing q1 by q2 solves it, I'd suspect either the specific data (maybe you don't escape some character properly?) or a transaction lock (e.g. your code wants to update table1, but q1 locks table1 (but q2 doesn't)). I'd probably start debugging by replacing q1 with the hardcoded resultset. – Solarflare Feb 19 '19 at 08:38

0 Answers0