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?
 
Dave BaldwinConnect With a Mentor Fixer 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
 
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
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.