简体   繁体   中英

Error 500 when trying to import large file .txt to MysQL

We're using Yii framework for an internal tool.

What we have now : The user select a file .txt to upload on the server. The server clean the text file because it containts lots of characters such as """ and ;;;;

But when comes the time to import to database, server sends a 500 internal error with no more information.

The file size is 8.1 mo. The import seems to work if we delete manually some rows in order to make the file at less than 7 mo.

We took a look at the php.ini file and increased all the limits.

What is weird is that we made local server with easyphp (same config in php.ini) and it works.

Do you have an idea ??

Thanks !

With the information's you have provided, I can only suggest that turn on error_reporting and display_errors in your php.ini file. Increase maximum execution time and then see if any error displays or not?

Also do you have access to your log files in server? Then check php error_log for more information.

Do you have some error logging (preferably written on the server, as the 500 pages generally not show the error).

Many servers are configured to return a 500 internal error in case of an error in a mysql_query. So either there is omewhere in the 8MB in issue (which does not appear to be the case, if it works in exactly the same table on another server), or the query is too long (increasing the limits is not always possible on a shared server).

If you share some code and/or error message that may help to find the issue.

There is also a limit on the SQL server, defined by max_allowed_packet . Please take a look on the result of

show variables like 'max_allowed_packet';

Maybe this is set to low.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM