Jump to content



Photo

php upload limit


  • Please log in to reply
20 replies to this topic

#1 capr

capr

    Neowinian Senior

  • Joined: 01-July 05

Posted 23 September 2013 - 07:54

ok so I have spent hours on this and am clearly a noobie missing something...

 

I want to change the php upload limit currently i can't upload a 6mb file.

 

I have read around and have played with all these values in the php.ini file

  • file_uploads
  • upload_max_filesize
  • max_input_time
  • memory_limit
  • max_execution_time
  • post_max_size

no luck... I am using ajaxplorer5 and in it's settings it correctly shows the upload max that I put into the php.ini file. but when i try to upload a tiny 6mb document. it says it's too big. kinda stuck and can't find a guide that talks about anything but those values

 

running ubuntu 13.04 and havent' really changed anything from default. (apache2.xxxx restarted it a few times, no luck)

 

thanks in advance




#2 +Nik L

Nik L

    Where's my pants?

  • Tech Issues Solved: 2
  • Joined: 14-January 03

Posted 23 September 2013 - 08:06

OK, so you have attempted to change it for PHP.  How about your web server config?



#3 Nashy

Nashy

    Neowinian Senior

  • Joined: 05-September 04
  • Location: Brisbane, Australia
  • OS: Windows 8.1
  • Phone: Samsung Galaxy S5 - SM-G900i

Posted 23 September 2013 - 08:08

Are you changing it in the correct location?

Have you created a phpinfo file to view what the actual config is showing?  This will also show the correct location.



#4 illage3

illage3

    Apprentice Game Designer

  • Joined: 07-June 13
  • Location: Manchester, UK
  • OS: Windows 8.1
  • Phone: Samsung Galaxy Note 2

Posted 23 September 2013 - 08:17

create a php.ini file on the root (public_html) folder and add the following code to it.

 

php_value upload_max_filesize ??M (M = MB) (?? = Number you want)



#5 OP capr

capr

    Neowinian Senior

  • Joined: 01-July 05

Posted 23 September 2013 - 08:28

OK, so you have attempted to change it for PHP.  How about your web server config?

not sure what you mean... do i need to change something in apache config files? I quickly googled and couldn't find what you mean

 

 

Are you changing it in the correct location?

Have you created a phpinfo file to view what the actual config is showing?  This will also show the correct location.

location is /etc/php5/cli/php.ini

I realized that there it one also located in /etc/php5/apache2/php.ini

I edited both, no luck. searched 

 

I tried doign a phpinfo file. basically made a file with .php and put this code in it

< ?php
echo phpinfo();
?>

 

don't REALLY know what to do after this... :(



#6 ashpowell

ashpowell

    Neowinian

  • Joined: 13-November 06
  • Location: UK
  • OS: Windows 8
  • Phone: Nexus 5

Posted 23 September 2013 - 08:49

Try what illage3 said.. I think this would work



#7 Ambroos

Ambroos

    Neowinian Senior

  • Tech Issues Solved: 4
  • Joined: 16-January 06
  • Location: Belgium

Posted 23 September 2013 - 08:53

What folders do you have in  /etc/php5?



#8 OP capr

capr

    Neowinian Senior

  • Joined: 01-July 05

Posted 23 September 2013 - 09:00

What folders do you have in  /etc/php5?

apache2, cli, conf.d, mods-available

 

 

Try what illage3 said.. I think this would work

trying, the directions aren't noob friendly so struggling a bit. .

 

I made a phpinfo.txt file it's 300 lines. looking in it, I am finding these lines that seem important

 

Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
...
Directive => Local Value => Master Value
cli.pager => no value => no value
cli.prompt => \b \>  => \b \> 
...
post_max_size => 2000M => 2000M
....
upload_max_filesize => 2000M => 2000M


#9 Nashy

Nashy

    Neowinian Senior

  • Joined: 05-September 04
  • Location: Brisbane, Australia
  • OS: Windows 8.1
  • Phone: Samsung Galaxy S5 - SM-G900i

Posted 23 September 2013 - 09:08

not sure what you mean... do i need to change something in apache config files? I quickly googled and couldn't find what you mean

 

 

location is /etc/php5/cli/php.ini

I realized that there it one also located in /etc/php5/apache2/php.ini

I edited both, no luck. searched 

 

I tried doign a phpinfo file. basically made a file with .php and put this code in it

< ?php
echo phpinfo();
?>

 

don't REALLY know what to do after this... :(

 

You should see a lines like this:

 

Loaded Configuration File	/usr/local/lib/php.ini
max_file_uploads	20	20
upload_max_filesize	40M	40M

That shows what file you need to change, and what two values.



#10 Nashy

Nashy

    Neowinian Senior

  • Joined: 05-September 04
  • Location: Brisbane, Australia
  • OS: Windows 8.1
  • Phone: Samsung Galaxy S5 - SM-G900i

Posted 23 September 2013 - 09:13

Try what illage3 said.. I think this would work

 

create a php.ini file on the root (public_html) folder and add the following code to it.

 

php_value upload_max_filesize ??M (M = MB) (?? = Number you want)

 

I have tried this many times over the years, and not once with the software I was using at the time did it work.



#11 ashpowell

ashpowell

    Neowinian

  • Joined: 13-November 06
  • Location: UK
  • OS: Windows 8
  • Phone: Nexus 5

Posted 23 September 2013 - 09:30

I have tried this many times over the years, and not once with the software I was using at the time did it work.

 

Hmm not sure then, It definitely works for me and clients on my server.

 

Maybe the setting to allow user php.ini files is disabled on yours?



#12 ashpowell

ashpowell

    Neowinian

  • Joined: 13-November 06
  • Location: UK
  • OS: Windows 8
  • Phone: Nexus 5

Posted 23 September 2013 - 09:32

I'm running CENTOS 6.4 x86_64 standard though so not sure if settings are the same



#13 illage3

illage3

    Apprentice Game Designer

  • Joined: 07-June 13
  • Location: Manchester, UK
  • OS: Windows 8.1
  • Phone: Samsung Galaxy Note 2

Posted 23 September 2013 - 09:32

Before doing anything in the php.ini file you need to ask the webhost to see if its okay to edit it.



#14 OP capr

capr

    Neowinian Senior

  • Joined: 01-July 05

Posted 23 September 2013 - 09:34

You should see a lines like this:

 

Loaded Configuration File	/usr/local/lib/php.ini
max_file_uploads	20	20
upload_max_filesize	40M	40M

That shows what file you need to change, and what two values.

my loaded file is different... path is /etc/php5/cli/php.ini

I have the other two lines, file uploads is how many files I upload at the same time, i left it at 20. upload max is set to 2000M which is where i want it. 

 

I looked in the usr directory and found php.ini-production, php.ini-development, php.ini-production.cli, and php.ini-production-dist

 

they are located under /usr/share/php5/

 

 

Before doing anything in the php.ini file you need to ask the webhost to see if its okay to edit it.

 

this is just a tiny ubuntu VM that I am running myself. so I can change whatever I want.



#15 Nashy

Nashy

    Neowinian Senior

  • Joined: 05-September 04
  • Location: Brisbane, Australia
  • OS: Windows 8.1
  • Phone: Samsung Galaxy S5 - SM-G900i

Posted 23 September 2013 - 11:52

Is this a home coded PHP script that you are using for the upload?





Click here to login or here to register to remove this ad, it's free!