-   Programming (
-   -   php.ini-dist to php.ini (

lord-fu 04-30-2006 09:17 PM

php.ini-dist to php.ini

If I move /usr/local/etc/php.ini-dist to /usr/local/etc/php.ini it seems to break file uploads to mysql I get an fread error on uploads. If I move it back to original name all is fine.
Is this because the original name means I am not reading from it and when I move it to php.ini it is reading from it and I need to correct something within it to enable file uploads?
file_uploads = On
is set within the file.
Many thanks for any help offered.

host# php -v
PHP 5.1.2 (cli) (built: Apr 1 2006 14:39:06)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

This is on freeBSD 6 I was not sure in what forum to post this thread.

bulliver 05-01-2006 11:18 AM

php.ini-dist is the config file that is 'distributed' with php. php.ini is the file that is actually used, and should have all the site-specific modifications to it. To see the differences between the two, use 'diff'.

lord-fu 05-02-2006 09:25 AM

Sure I understand that, and I have moved the php.ini-dist to php.ini and my uploads work again, I am not sure why they were not working after my first filename change. If I could ask another question though. I am aware of the 2mb upload limit on php so I corrected this to be
upload_max_filesize = 6500M
I know that is large but I do video editing for a small company and sometimes our video files get to be around 6 gigs. I still cannot upload anything larger than 2mb. This is why I posted my first question, because It seems as if that my filesize is still being limited. Is MySQL limiting my database entry?

Many thanks in advance.

graemef 05-02-2006 11:04 AM

What field type are you putting the video into?

There are four blob types:


tinyblob  upto 256 bytes
blob      upto 65536 bytes or 64Kb
mediumblob upto 16,777,216 bytes or 16Mb
longblog  upto 4,294,967,296 bytes or 4Gb

lord-fu 05-02-2006 01:58 PM

Thank you for the reply. I am storing it in a longblob. I didnt know that a longblob limits to 4Gb but I cant even upload a pdf file thats 2.14MB. I compress it to 1.84MB and it uploads fine.
Many thanks.

graemef 05-02-2006 02:35 PM

Have you set the post_max_size in your .ini file? That need to be larger than the upload_max_filesize?

lord-fu 05-02-2006 03:03 PM

I have that set to the same size as the upload limit. I will adjust now and give it a shot.
Many thanks.

lord-fu 05-02-2006 03:08 PM


post_max_size = 7000M
This did not correct it. I tried again to upload a file a little over 2MB, and recieved the same error.
Warning: fread(): supplied argument is not a valid stream resource in /usr/local/www/apache22/data/start/minion/upload.php on line 11

I only recieve this error on files > 2MB.
Many thanks.

[edit]When I try to upload the file it actually as far as file name and the like get entered into the db just with a size of 0.

graemef 05-02-2006 04:21 PM

When you do a phpinfo() are these values set?

lord-fu 05-02-2006 05:08 PM


Thank you for taking the time to assist me. Yes the values are set. Thank you for pointing me to the phpinfo(), I had forgotten about that and that would have saved me my first post. However I believe now this is pointing to an MySQL issue. I have double checked and tripple checked my table. Any other guidance?
Many thanks.

graemef 05-02-2006 05:24 PM

All I can think of is rather than save it to you database can you save it on a local directory. As a minimum it should help to confirm that it is a MySQL problem :)

If that is the case then maybe you want to store it in a directory and then just hold the path to the file in the database. But maybe there is a MySQL setting... I can't think of one but maybe Mr Google knows.

All times are GMT -5. The time now is 12:28 PM.