0

I'm having a problem with PHP CodeIgniter (using JetBrains PhpStorm). I want to upload a song, but I got the message:

The uploaded file exceeds the maximum allowed size in your PHP configuration file.

I successfully uploaded other file types (smaller), but when I try to upload this song I got an error.

I've set this in my php.ini but it still fails:

upload_max_filesize = 128M;  
post_max_size = 128M

Anyone got some idea about solving this problem?

Gordon
  • 312,688
  • 75
  • 539
  • 559
luka032
  • 925
  • 4
  • 12
  • 34
  • 1
    When I echo: phpversion() and ini_get('post_max_size')) I got answers: Current PHP version: 7.0.0; Max size: 8M. Btw evern if it's 8M max size, I'm trying to upload ~ 4MB song i got error The uploaded file exceeds the maximum allowed size in your PHP configuration file. – luka032 Apr 25 '16 at 20:39
  • 1
    Hard to say anything definite, what if you try to set directives in a .user.ini or .htacces file and check max_size config param from CI_Upload class just to start? – ConstantineUA Apr 25 '16 at 21:14
  • 1
    Can help me about first suggestion? And about CI_Upload I've put $config['max_size'] = 128; but nothing helps? – luka032 Apr 25 '16 at 21:36
  • 2
    Try to put 0 in max_size, if I'm not mistaken, it means that CI doesn't check filesize, regarding my first suggestion, this post describes every possible option: http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size – ConstantineUA Apr 25 '16 at 22:00
  • 1
    I've put 0 in config['max_size'] and I successfully now upload files (even mp3 songs) up to 2MB size, if I try to upload >2MB I got message The uploaded file exceeds the maximum allowed size in your PHP configuration file. I'm in trouble, can't find out where is max size set to 2MB, I've set in php.ini 128MB upload and post max size? btw. I am using wamp (php 7 and apache 2.4.17) maybe that info can help – luka032 Apr 26 '16 at 10:24
  • 1
    OK, now it isn't a problem of CI anymore, please check the linked post about upload file size and set params so that ini_get will return right values in a script, I believe it's gonna be the end of trouble – ConstantineUA Apr 26 '16 at 13:03
  • 1
    Also I wanted to tell you that ini_get prints me: post_max_size = 128M. But still when i try > 2M song, can you tell me why am I $finfo = $this->upload->data(); when I try to echo $finfo['file_size'] i realize that that variable is empty? – luka032 Apr 26 '16 at 15:33
  • 1
    Well, if both directives are set and you see their value in a script, I don't know what may cause a problem. Could it be a client-side validation? To be honest, I don't have any other idea – ConstantineUA Apr 26 '16 at 20:46
  • 1
    Constantine thanks for all support, I've just put all files from wamp/bin, then I've searched "2M" and I found 2 times I think one was in some apache settings, changed them to 128M now it works great! Thanks again! – luka032 Apr 28 '16 at 11:00

0 Answers0