Requesting to download file in the middle of execution

0

I have a small problem, I have a PHP run that generates an average of 34,000 insert's in MySQL, this being done via stored procedure .

But when I run it, it will run for about 5 minutes and nothing will ask you to download the file XPTO.php .

However, execution on the bank continues.

What can I do to solve the problem?

I use:

  • Zend Server - 7.0.0
  • MySQL - 5.5.40
  • PHP - 5.4.24
asked by anonymous 16.10.2014 / 14:46

2 answers

1

I found out how to resolve the issue.

In Zend Server we have this setting in the% default% of it:

<Timeouts connectionTimeout="60" requestTimeout="120" />

I ended up swapping for:

<Timeouts connectionTimeout="60" requestTimeout="1500" />

So solving my problem.

I'm grateful for everyone who tried to help.

    
19.10.2014 / 13:20
0

In this case, I think increasing the timeout time is not a good option. If the problem and INSERT number, instead of making 34,000 you can do just one:

 INSERT INTO example
    (example_id, name, value, other_value)
 VALUES
   (100, 'Name 1', 'Value 1', 'Other 1'),
   (101, 'Name 2', 'Value 2', 'Other 2'),
   (102, 'Name 3', 'Value 3', 'Other 3'),
   (103, 'Name 4', 'Value 4', 'Other 4');

Also, you need to know why you need to do 34,000 INSERT ... If and to solve a DUMP type problem, you can use SQL directly without using PHP.

To respond in Otto's comment, saying that he uses store_procedure, this:

 for ($test=0; $test<10; $test++)
 {
 $str = ""; 
     for ($w=0; $w < 3400; $w++)
     {
        $str .= "(".$w.",'Name1','Totpo','Name2'),\n";
    }
     $str .= "(".$w.",'Name1','Totpo','Name2');";

    $query_insert = "
    INSERT INTO EXEMPLE
    (champ1,champ2,champ3,champ4)
    VALUES ".$str;
    //echo $query_insert;
    $result = sql_query($db_so36,$query_insert);
 }

then, 34,000 INSERT, takes only 0.271 sec!

    
19.10.2014 / 14:26