View Full Version : php.ini or file upload problems...
BinarySpike
2006.07.26, 01:52 AM
Hello, I have been building some php scripts for outsiders to run on my computer for use... along with mine.
Link parsers for right-click-downloding-to-disk. HTML viewers for browser testing. Message leaver. And now, a file uploading device.
I have Adium which doesn't allow me to get shared files. so instead of getting people to constantly e-mail me I started a file uploader. The uploader works up to 2MB but after that (around 3.5MB) it will error out. I have checked for a php.ini file and none exists except in MAMP and /private/etc/php.ini.default
Problem is when I change upload_max_file to 10M and post_max_size to 15M it still won't allow over 3MB. Thanks to someone's helpful hint I did "locate php.ini" and found this
>locate php.ini
/Applications/MAMP/bin/php4/lib/php.ini
/Applications/MAMP/bin/php5/lib/php.ini
/private/etc/php.ini.default
I did take the edited php.ini.default and place it in /usr/local/lib but that didn't work either.
First off my computer is screwed up big time, I tried installing cURL using Fink and also tried to get X11... they screwed up my $PATH and g++ now is broked for good. I don't think this would hurt my PHP but it still is making me mad.
Thanks
-BinarySpike
Make sure you're changing the right php.ini, based on what PHP version you're using in MAMP. I recall, a while back, having problems with MAMP and its PHP configuration. I haven't worked with MAMP in a while, though, so I don't recall the specific problem or whether they fixed it in later versions.
Are you serving this using MAMP, or just using MAMP to test it?
What sort of error is it giving? Is the script timing out? Permissions error? etc
Also... I'm not sure I'd recommend copying the php.ini.default from /private/etc/. It may not be MAMP-appropriate. And... those paths look wacky for the php.ini for MAMP. Is your installation of MAMP screwed? For me, they are in MAMP/conf. Again, though, I haven't used MAMP in a bit.
BinarySpike
2006.07.26, 12:12 PM
I tried running/installing MAMP but it didn't work, so I just forgot about it.
(after an IM with Carlos a looong time ago he told me about MAMP and I tried... I was trying to remember what I edit to make index.php another default like index.html)
Those three php.ini's I showed are the only ones locate found.
(after copying php.ini to /usr/local/lib I restarted terminal and it still didn't locate that one... so there might be one hiding somewhere I don't know about)
Let's say I just erase my computer and put Jaguar on again... where would php.ini be then?
Here's the only error it gives me.
Warning: chmod(): No such file or directory in /Users/nathan/Sites/file/file.php on line 21
chmod failed File upload done
MAMP might have done something but after trying MAMP nothing on the php side changed... I will go look though to see if I can like uninstall.
(after my short exposure to Win XP I came to love uninstallers and MSN Instant Messenger and hate the task bar :-P)
PowerMacX
2006.07.26, 01:46 PM
Problem is when I change upload_max_file to 10M and post_max_size to 15M it still won't allow over 3MB.
Try changing memory_limit, max_execution_time & max_input_time. Also, check phpinfo for the location of the ini file.
kelvin
2006.07.26, 02:19 PM
What version of Adium are you using? I've had some success with file transfer with recent versions.
BinarySpike
2006.07.26, 02:59 PM
Try changing memory_limit, max_execution_time & max_input_time. Also, check phpinfo for the location of the ini file.
Oh, I didn't know phpinfo gave you that info...
Kelvin: A little OT isn't it? I haven't upgraded in a long time... I don't care either.
This is part of a localhost homepage project... basically I set my browsers homepage to a php script and it checks your POP3 and IMAP e-mail and RSS feeds and other plugins every time you make a new page... and this is part of the file uploading part... people can upload files and you can see them and stuff...
Also, can I change those variables without editing php.ini? like max_input_time = 200; or something?
BinarySpike
2006.07.26, 03:12 PM
Thank you PowerMacX.
Here's what I did... after editing php.ini.default under /private/etc I did phpinfo like you said... it did not say anything about .default so I copied php.ini.default and renamed the copy php.ini
Then when I looked at phpinfo it said that upload_max_filesize was 11M just like I wanted instead of 2M like it had been saying
I will go and edit the ones you said cause I don't have the "best" connection right now... just got back from trip and parents don't touch the antenea so it just degrades unless you find the "hotspot"... *hates wireless*
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.