php script to import csv file into mysql is being truncated - PHP, MySql, Apache

We recently moved to a new host and a new virtual server.

We have a script that is setup to download and import a file and then import into MySQL.

The script was working fine on the old server so I'm assuming it's a php.ini setting but I'm not sure. The downloaded file is complete so that's not the issue. The issue is in importing it into MySql. The file size is about 35mb and the import is cutting off at approximately 7mb.

Any ideas of where to look to solve this one?

Thanks,
MHenry
LVL 7
MHenryAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
Use phpinfo() to look at the PHP setting.  Look at the execution timeouts and the upload filesize settings.  'max_execution_time' seems to default to 30 seconds and 'post_max_size' defaults to 8MB.  'upload_max_filesize' default is 2MB.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MHenryAuthor Commented:
DaveBaldwin,

Yes, I saw those settings. I wasn't sure if importing into MySql counts as a file upload. I think all of these settings apply only to uploads. And like I said, the file is fine on the server, it's the import that is breaking.
0
Dave BaldwinFixer of ProblemsCommented:
Execution time can cause the PHP to time out and close the connection.  ??  What error messages are you getting?
0
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

MHenryAuthor Commented:
DaveBaldwin,

That's the problem, no error message. The script that is running says everything is fine. I looked for error messages on the server, but nothing was there either.

I was thinking the same thing about the max_execution_time. But after looking at all the other items, I thought maybe it was just referring to uploads.

I'm going to give the max_execution a try. Let you know asap.

Best,
MHenry
0
MHenryAuthor Commented:
DaveBaldwin,

Well, I increased both the max_time and file size.

Still doing the same thing.

Any other ideas?
0
MHenryAuthor Commented:
DaveBaldwin,

Turns out it was the max_time thing. I doubled it but that wasn't nearly enough. I set it for 30 minutes as a test and it worked fine.

Thanks!
MHenry
0
Dave BaldwinFixer of ProblemsCommented:
You're welcome.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.