Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8549463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:43:04+00:00 2026-06-11T13:43:04+00:00

My web application lets user import an excel file and writes the data from

  • 0

My web application lets user import an excel file and writes the data from the file into the mysql database.
The problem is, when the excel file has lots of entries, even 1000 rows, i get an error saying PHP ran out of memory. This occurs while reading the file.
I have assigned 1024MB to PHP in the php.ini file.

My question is, how to go about importing such large data in PHP.

I am using CodeIgniter.
for reading the excel file, i am using this library.


SOLVED. I used CSV instead of xls. and I could import 10,000 rows of data within seconds.
Thank you all for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:43:05+00:00Added an answer on June 11, 2026 at 1:43 pm

    As others have said, 1000 records is not much. Make sure you process the records one at a time, or a few at a time, and that the variables you use for each iteration go out of scope after you’re finished with that row or you’re reusing the variables.

    If you can avoid the necessity of processing excel files by exporting them to csv, that’s even greater, cause then you wouldn’t need such a library (which might or might not have its own memory issues).

    Don’t be afraid of increasing memory usage if you need to and that solves the problem, buying memory is the cheapest option sometimes. And don’t let the 1 GB scare you, it is a lot for such a simple task, but if you have the memory and that’s all you need to do, then its good enough for the moment.

    And as a plus, if you are using an old version of PHP, try updating to PHP 5.4 which handles memory much better than its predecessors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple web application which lets the user upload local user data
I have a simple page in a PHP/MySQL web application that lets admin users
Say I have a page in my web application that lets a user update
In my web application I am using sessions for storing the user specific data
[edit] We're collecting credit application data from users on a web form. I have
I am writing a web application that lets a user create their own forms
When creating a web application, and lets say you have a User object denoting
So here's my premise: A web application has a basic homepage that lets a
I am creating a web application that lets the user store and retrieve information
I am creating a web-application which lets you select a template from the template

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.