Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Something limiting BLOB size besides max_allowed_packet? 1

Status
Not open for further replies.

frumpus

Programmer
Aug 1, 2005
113
0
0
US
I have a php page that uploads files into a mysql table. I need to be able to handle files up to 20MB. Initially, it would only take files up to 1MB, so I upped the global max_allowed_packet to 20MB (The current value shows 20,971,520)

Now, I can upload files up to 2 MB, but no larger.

Before I upped the max_allowed_packet, a file that was too large would cause an error 'mysql server has gone away' and no row would be inserted into the table at all.

Now, when I try to upload a file larger than 2MB it returns no error at all and it DOES insert a row into the table, but the file size is 0. So, the behavior has changed.

Is there another variable setting I need to address? Any idea what is going on here?
 
To be specific, it is a longblob.
 
This is one of 2 other settings you have to consider.
1)apache (guessing you're using this) this has a LimitRequestBody [size in bytes] which can affect what you can upload, this option can be removed.
2) php.ini change teh value set by upload_max_filesize



______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Well, that helped in a way.

I changed the upload_max_filesize in php.ini, but now I am back to getting the 'mysql server has gone away' error.

I have upped the 'wait timeout' variable on mysql to 1,000,000 but that has had no effect. Besides, the upload of a 2MB file goes very quickly so it really doesn't seem likt a timeout issue.

The access I have to the server (Win 2003 server) is through some godawful Plesk Control Panel so I'm not 100% certain about what web server it's running, but I'm 80% sure it's Microsoft IIS. I'm trying to find an equivalent setting for LimitRequestBody, but given the return of the mysql error, I'm thinking that is where my problem is.

further suggestions?
 
Welp. Looks like while I was addressing the php.ini issue, someone or something had reset the max_allowed_packet variable to 1MB. (And yes I had specified 'global' when I set it before.)

Very odd, but everything works now. Thanks for the help. Hopefully that won't happen again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top