I'm uploading one csv file to the server. The file is reading the data and saving into the database but, the problem with my server is the maximum execution time is 180sec. I'm unable to upload all my data in the csv within 180sec. Server is showing like"**Service is unavailable**" after 180 sec. So i decided to complete the **csv upload in the background**. I tried few plugins but i'm getting errors like plugin not found and few other. I need a solution in the **cakephp.** Thanks in advance
['https://Stackoverflow.com/questions/37742717', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6448903/']
I doubt the upload itself takes 180 seconds. You should rethink your design and collect the data first and then write it to the database, maybe using bulk insert if available in cakephp.
You can extend the execution time like this.

```
ini_set('max_execution_time', 600); //600 seconds = 10 minutes

```

Put this at the top of the CSV upload script. You can change the second parameter according to your need.