LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-22-2005, 02:04 PM   #1
DoobyWho
Member
 
Registered: Feb 2003
Posts: 50

Rep: Reputation: 15
Ready to pay someone to tell me how to fix this!! GRRRR


Okay, I'm extremely frustrated and I am ready to pay for someone to figure out what the hell my servers problem is because I need this fixed ASAP!!!!

I have a PHP script that uploads files. Whenever uploading files larger than 16M I get a message about "Got packet larger then 'max_allowed_packet'". Now, at first I was having a problem with getting my setting for max_allowed_packet to show up, then i read that mysql 3.2 only allows up to 16M for that value.

I read around and found that Plesk 7.5 supports MySQL 4. So I found instructions on how to upgrade to mysql 4 and did so via www.atomicrocketturtle.com and the plesk forums. I added the ART channels to my config and used "up2date mysql" to update mysql. Now i've checked and sure enough it's updated to mysql4 so it now shows that max_allowed_packet is set to 1GB. Still doesnt work with files larger than 16M! So I've changed every relative value in the php.ini file as well as putting a .htaccess file with LimitRequestBody set really high.

Still doesn't work! I've looked all around and the only thing I can find that might explain what is going on is the fact that my php is still linking to the mysql3 library. According to what I have read, there is a problem with sending packets over 16M between PHP and the MySQL 3x library. It is suggested that I rebuild PHP with the library for my mysql4 installation.

I've looked all around and cannot find good, detailed instructions on how to do this and I am afraid that if I do this I am going to break something w/ Plesk or something else on the server. I also don't want to do this and it not fix the problem.

Here is my relative php.ini settings and my.cnf

My.cnf
---------
[mysqld]
safe-show-database
innodb_data_file_path=ibdata1:10M:autoextend
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_allowed_packet=1G;

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid




PHP.ini relative settings (ive set everything really high just for now, once i get it working i'll tune the settings)
-----------------------
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 3000
max_input_time = 6000
memory_limit = 302M
post_max_size = 300M
upload_max_filesize = 300M


It couldn't have to do with "default_socket_timeout = 60" could it?

I also have a .htaccess file in the directory with LimitRequestBody set to 0 (which is supposed to be unlimited).


MySQL: 4.0.24
PHP: 4.3.11
MySQL Client API: 3.23.58
 
Old 07-22-2005, 02:22 PM   #2
AresXP
Member
 
Registered: Jun 2005
Location: New Brunswick, Canada
Distribution: Slackware
Posts: 34

Rep: Reputation: 15
well you could recompile/reinstall PHP to upgrade your mysql client api...
 
Old 07-22-2005, 02:25 PM   #3
DoobyWho
Member
 
Registered: Feb 2003
Posts: 50

Original Poster
Rep: Reputation: 15
And how do I do that?

This is my current configure according to phpinfo

'./configure' '--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-mhash=shared' '--with-mcrypt=shared' '--enable-xslt=shared' '--with-xslt-sablot' '--with-sablot-js=/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-apxs2=/usr/sbin/apxs'


I know i need to add in something like --with-mysql
is my mysql path, /var/lib/mysql?

Last edited by DoobyWho; 07-22-2005 at 02:29 PM.
 
Old 07-22-2005, 04:36 PM   #4
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Quote:
Originally posted by DoobyWho
And how do I do that?

I know i need to add in something like --with-mysql
is my mysql path, /var/lib/mysql?
Yes. There was a change in the MySQL authentication mechanisms in 4.1. When compiling PHP for use with versions of mysql >= 4.1, you need to tell the configure script where the mysql libs are by adding --with-mysql=/path/to/mysql/lib to the configure line.

*HOWEVER* I don't think that's your problem. If your PHP MySQL API wasn't working properly, you wouldn't be able to connect to the MySQL db at all. Show us the form that you are using to submit this document to the server.

BTW, why in the hell do you need to upload a 16Mb file??? Surely there must be a better way to accomplish what you are trying to do.
 
Old 07-22-2005, 04:39 PM   #5
DoobyWho
Member
 
Registered: Feb 2003
Posts: 50

Original Poster
Rep: Reputation: 15
it has nothing to do with authentication settings. their apparently is a bug with uploading files larger than 16M when your using php4 and a mysql 3.23 client api. in order to get it to work you have to recompile to use the mysql 4 library.

It's a secure file upload software. I have doctors uploading large health files.

Also - I have looked everywhere and i cant find a good tutorial on how to recompile php. my server came with plesk/mysql/php installed and i updated them with the ART rpm's. I know i need to recompile php from source but i have no idea how. i dont want to mess anything up.

Last edited by DoobyWho; 07-22-2005 at 04:41 PM.
 
Old 07-22-2005, 07:29 PM   #6
floppywhopper
Member
 
Registered: Aug 2004
Location: Albany, Western Australia
Distribution: Mageia , SME , IP Fire, LinuxMX
Posts: 631
Blog Entries: 2

Rep: Reputation: 114Reputation: 114
Can you copy and paste to here the entire and exact error message you are getting

floppy
 
Old 07-22-2005, 08:18 PM   #7
DoobyWho
Member
 
Registered: Feb 2003
Posts: 50

Original Poster
Rep: Reputation: 15
That is the entire and exact error message:

Got packet larger than 'max_allowed_packet'
 
Old 07-23-2005, 11:10 AM   #8
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Quote:
Originally posted by TruckStuff
Show us the form that you are using to submit this document to the server.
 
Old 07-23-2005, 11:28 AM   #9
DoobyWho
Member
 
Registered: Feb 2003
Posts: 50

Original Poster
Rep: Reputation: 15
I can't show you the exact form but basically the form itself is just a regular file upload form, like all the others. area to pick the file and push upload.

the php that processes it basically

PHP Code:
if( !is_uploaded_file($_FILES["uploadfile"]["tmp_name"]) )
    die(
"There is not an uploaded file");
$tempfile fopen($_FILES["uploadfile"]["tmp_name"], "rb");
$filedata fread($tempfile,filesize($_FILES["uploadfile"]["tmp_name"])); 
and then it just performs an insert query and inserts $filedata into a blob.

it's really nothing out of the ordinary.

works fine for anything under 16mb

The person in this thread seems to have had the same problem and devised a workaround for it, however, I don't want a "workaround". I want to fix the problem so I don't have to go and change the code and have all of my clients update their files.
http://www.codingforums.com/showthread.php?t=56289

Last edited by DoobyWho; 07-23-2005 at 11:32 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redhat Mail issues- Transport filter process failed -Will Pay$$ for fix. rixride00 Linux - Software 1 07-20-2005 08:10 AM
partition filling up...grrrr Kroenecker Linux - Newbie 8 11-02-2003 07:34 PM
Citrix client install...grrrr 3742Main Linux - Software 1 02-07-2003 06:46 PM
Kernel recompile issues..GRRRR jimmytango829 Linux - Software 2 11-19-2002 02:31 PM
grrrr gballard Linux - Networking 1 08-03-2002 02:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration