LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   PHP and uploading files (https://www.linuxquestions.org/questions/linux-general-1/php-and-uploading-files-24754/)

Syncrm 07-01-2002 01:27 PM

PHP and uploading files
 
hi,
i'm very well versed in PHP and have used it for many web applications. i recently wrote a small uploading script which works perfectly for most files. however, whenever i try and upload a larger file (like an mp3) the script fails after so long.

i *think* the script is limiting my upload to 2 megs and cutting me off after that. but i changed the value from 2M to 45M in the php.ini file and still the same error. the error exactly is that the PHP script thinks a file was uploaded, but can't find the data.

i'm thinking this has something to do with my system. apache is installed in /usr/local/apache and the conf files are all in apache/conf. however, the only php.ini file i could find on my system was in /etc/apache, which is not where my apache conf files are (though i did find some old ones in there). so perhaps PHP is loading defaults? i copied /etc/apache/php.ini to /usr/local/apache/conf/ but still no effects.

any help is appreciated. :-)

crabboy 07-01-2002 10:24 PM

Call the phpinfo() function in a php file and you will see what settings are being picked up by php. There is a file size limit as well as a php timeout. You may be hitting the timeout while uploading the larger files.

pickledbeans 07-01-2002 10:55 PM

You might also want to check apache error_log and access_log. And of course cross post to php-general news-group.

Syncrm 07-02-2002 08:40 AM

crabboy, you're right... i hadn't thought of checking the phpinfo() function to see what the output would be. but despite making those changes to my php.ini file, my upload max is set to 2M, which is where i'm getting into trouble.

does anyone know how to change the php defaults? i tried putting my php.ini file in /etc/apache and /usr/local/apache/conf with no changes (restarted apache too). might i have to rebuild php?

pickledbeans 07-02-2002 08:53 AM

I don't intend this to be a flame, just practical advice.
This is a "general linux" forum, not a apache
or PHP forum.

http://php.net,
http://httpd.apache.org

Both have excellent support via mailing list and news groups. Post your PHP specifc question there, you'll stand a much metter change of getting the answer your looking for.

crabboy 07-02-2002 11:49 AM

On the top of the phpinfo() output you should see a line for Configuration File (php.ini) location. My ini file is in /usr/local/lib/php.ini


All times are GMT -5. The time now is 04:28 AM.