LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-30-2006, 09:17 PM   #1
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Rep: Reputation: 30
php.ini-dist to php.ini


Hello,

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.

Last edited by lord-fu; 04-30-2006 at 09:20 PM.
 
Old 05-01-2006, 11:18 AM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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'.
 
Old 05-02-2006, 09:25 AM   #3
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Original Poster
Rep: Reputation: 30
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.
 
Old 05-02-2006, 11:04 AM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
What field type are you putting the video into?

There are four blob types:

Code:
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
 
Old 05-02-2006, 01:58 PM   #5
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Original Poster
Rep: Reputation: 30
graemef,
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.

Last edited by lord-fu; 05-02-2006 at 02:04 PM.
 
Old 05-02-2006, 02:35 PM   #6
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Have you set the post_max_size in your .ini file? That need to be larger than the upload_max_filesize?
 
Old 05-02-2006, 03:03 PM   #7
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Original Poster
Rep: Reputation: 30
I have that set to the same size as the upload limit. I will adjust now and give it a shot.
Many thanks.
 
Old 05-02-2006, 03:08 PM   #8
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Original Poster
Rep: Reputation: 30
Hello,

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.

Last edited by lord-fu; 05-02-2006 at 03:24 PM.
 
Old 05-02-2006, 04:21 PM   #9
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
When you do a phpinfo() are these values set?
 
Old 05-02-2006, 05:08 PM   #10
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Original Poster
Rep: Reputation: 30
graemef,

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.
 
Old 05-02-2006, 05:24 PM   #11
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is php.ini? Penguin_5333 Linux - Software 8 09-01-2012 08:19 PM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
Upgraded PHP from 4.3.4 to 4.3.10 and now it won't read php.ini gregmcavoy Linux - Software 11 01-22-2005 12:16 PM
php: different mail server from php.ini rayds Programming 0 09-14-2004 03:48 AM
Where's php.ini? XxAndyxX Linux - General 1 06-14-2003 09:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration