LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-06-2017, 04:33 AM   #1
R.N.RAM KANNAN
LQ Newbie
 
Registered: Oct 2009
Posts: 28

Rep: Reputation: 0
Smile Unable to increasing upload file size in PHP


Dear All,

I have installed net2ftp "web-based FTP client written in PHP" in Red Hat Enterprise Linux Server release 5.11 (Tikanga) operating system.

I've installed PHP 5.1.6 in my server.

[root@Kannan ~]# php -v
PHP 5.1.6 (cli) (built: Oct 28 2014 09:19:42)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
[root@Kannan ~]#

I can able to upload file less than 1GB file in webftp.

My goal is to upload files more than 1GB zip file in webftp. So i have changed the below setting in /etc/php.ini file.

post_max_size = 1024M
upload_max_filesize = 2048M
max_execution_time = 36000
memory_limit = 32M

After changing the above values we have restarted Apache service.

Even after changing the upload max_filesize value to 2048M, we are getting the below error.

[Thu Apr 06 10:20:41 2017] [error] [client 172.16.239.65] PHP Warning: POST Content-Length of 1737927603 bytes exceeds the limit of 1073741824 bytes in Unknown on line 0, referer: https://ecaree.kannan.com/webftp/index.php

I have googled regarding this issue but no luck.

Could please help me on this issue.

Thanks
Ram kannan

Last edited by R.N.RAM KANNAN; 04-06-2017 at 04:42 AM.
 
Old 04-06-2017, 07:02 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
post_max_size = 1024M

This setting needs to be at least the value of upload_max_filesize because a file upload is a POST request. Set it to 2G?
 
Old 04-06-2017, 07:41 AM   #3
R.N.RAM KANNAN
LQ Newbie
 
Registered: Oct 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Hi

Thanks

Now the below setting is fine ?

post_max_size = 2048M
upload_max_filesize = 1024M

Regards
Ram Kannan
 
Old 04-06-2017, 07:56 AM   #4
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
No not fine because you changed upload max to 1 gig again. What was meant both post and upload needs to be 2048.
 
Old 04-06-2017, 08:12 AM   #5
R.N.RAM KANNAN
LQ Newbie
 
Registered: Oct 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Hi

I'm getting the below error when i made the below changes in php.ini file.

post_max_size = 2048M
upload_max_filesize = 2048M

[Thu Apr 06 16:05:44 2017] [error] [client 172.16.239.65] PHP Warning: Unknown: POST Content-Length of 161 bytes exceeds the limit of -2147483648 bytes in Unknown on line 0, referer: https://ecaree.kannan.com/webftp/

[Thu Apr 06 16:06:06 2017] [error] [client 172.16.239.65] PHP Warning: Unknown: POST Content-Length of 123 bytes exceeds the limit of -2147483648 bytes in Unknown on line 0, referer: https://ecaree.kannan.com/webftp/index.php

More over iam unable to login to webftp when i enter correct username and password.

PLease advise me

Thanks
Ram Kannan

Last edited by R.N.RAM KANNAN; 04-06-2017 at 08:14 AM.
 
Old 04-06-2017, 08:15 AM   #6
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
It looks like you are on a 32bit system, where 2GB is a limit. So you need to set both of them a little lower:

post_max_size = 2047M
upload_max_filesize = 2047M
 
Old 04-06-2017, 08:28 AM   #7
R.N.RAM KANNAN
LQ Newbie
 
Registered: Oct 2009
Posts: 28

Original Poster
Rep: Reputation: 0
My system is 64bit system. Please see the below output.

[root@Kannan ~]# file /sbin/init
/sbin/init: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), stripped
[root@informatix ~]#

[root@Kannan ~]# arch
x86_64

Kindly advice

Thanks
Ram Kannan
 
Old 04-06-2017, 09:11 AM   #8
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
The error message says the limit is -2147483648 which I think is because of a 32bit signed int is overflowing. PHP version 5.1.6 is very old, and and I think that's the reason. You need to set it slightly lower than 2048Mb or use a newer version of PHP.
 
Old 04-07-2017, 05:52 AM   #9
R.N.RAM KANNAN
LQ Newbie
 
Registered: Oct 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Hi Guttorm,

Thanks a lot !!

As per your suggestion i have configured maximum upload limit post max limit 2047M. And now i'm able to upload files less than 2 GB.

So i'll upgrade my PHP to latest, So that i can i upload more than 2 GB zip files.

My issue has been resolved.

Regards
Ram Kannan.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
increasing root file system size in solaris 10 smsc Solaris / OpenSolaris 1 12-28-2012 04:02 AM
Unable to upload files through PHP gokultm Red Hat 5 01-12-2012 04:46 AM
/var/adm/wtmp file is increasing its size...? johnsanty Linux - General 2 09-28-2006 11:05 PM
Increasing Maximum upload size in php aarajthomas Programming 8 01-16-2006 12:46 AM
increasing max file size arokh AIX 4 08-31-2004 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:14 AM.

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
Open Source Consulting | Domain Registration