Jump to content


php.ini


8 replies to this topic

#1 Hooch

    Young Padawan

  • Members
  • Pip
  • 158 posts
  • Location:Brockville, Ontario

Posted 24 May 2006 - 08:39 AM

Hi all.
I am having problems uploading large files via php.
From some research I see it could be php's settings. It seems the larger files will time out.
I made a script to see what the settings are..
<?php 
phpinfo(); 
?>
This shows all settings.
The Host I have uses 4.3.11
I assume I need to edit the session section.

SESSION
Session Support enabled
Registered save handlers files user


session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid On On

Do I need to change the line in red?
Or what needs to be changed?
Can this be changed in an .htaccess file, or how can I do this?

Thank you..Hooch

#2 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 24 May 2006 - 08:44 AM

what size files are you talking about?

defauly php.ini has a set max upload size, if you are exceding that then that would be the problem

#3 Hooch

    Young Padawan

  • Members
  • Pip
  • 158 posts
  • Location:Brockville, Ontario

Posted 24 May 2006 - 08:51 AM

Update..
I just tried something off the cuff.
I made an .htaccess file then entered
php_value session.gc_maxlifetime 1000000

This did change the values in my servers settings.
This line (above in red) session.gc_maxlifetime 1440 1440
Was changed to session.gc_maxlifetime 1000000 1440

The file seemed to finish but it never did upload.
I'll keep working at it.


Deadly
I'm uploading up to 15 MB

#4 Hooch

    Young Padawan

  • Members
  • Pip
  • 158 posts
  • Location:Brockville, Ontario

Posted 24 May 2006 - 09:06 AM

Thanks Deadly..I think it's fixed due to your input.
I found this line in the CORE section of the PHP setup file
upload_max_filesize 2M 2M

I added this line to the .htaccess file
php_value upload_max_filesize 15M

So the new value for the PHP setup file is
upload_max_filesize 15M 2M

The file I tried earlier now works.

Thanks guy.

#5 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 24 May 2006 - 11:30 AM

no worries, glad to help

#6 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 24 May 2006 - 02:26 PM

Can you just edit the php.ini thru a .htacces document??? :) :)

#7 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 24 May 2006 - 02:50 PM

Yup, or you can just use ini_set().

#8 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 24 May 2006 - 03:01 PM

It's not as simple as just changing the settings through either of those methods, the guys who created PHP were smart enough to at least set permissions on which settings could be changed, and how.

http://php.net/manua...ion.changes.php
http://php.net/manua...i.php#AEN246538

p.s. i know the problem is solved, but for future reference:
http://php.net/manua...file-upload.php

Edited by rc69, 24 May 2006 - 03:02 PM.


#9 Hooch

    Young Padawan

  • Members
  • Pip
  • 158 posts
  • Location:Brockville, Ontario

Posted 24 May 2006 - 06:28 PM

View PostAvalanche, on May 24 2006, 02:26 PM, said:

Can you just edit the php.ini thru a .htacces document??? :P :o

That's what I did. In my previous posts I mentioned I added 2 lines to an .htaccess file.
B)

Edited by Hooch, 24 May 2006 - 06:29 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users