Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > php config issues

php config issues
Thread Tools
Mac Enthusiast
Join Date: Nov 2001
Location: Washington, DC 20009
Status: Offline
Reply With Quote
Apr 1, 2003, 10:59 AM
 
I need a bit of help getting PHP configured the way I need it to be. I am trying to write an upload script for a friend, but the upload portions of the script always seem to fail. As far as I understand, PHP automatically uploads the temporary file to a default location. When I do a phpinfo(), this value is not set. I am using a build of PHP that does not have a default php.ini file, so I attempted to create my own. I added a file in /usr/local/lib and /usr/lib, but neither of them seem to change the value displayed in phpinfo().
Code:
upload_tmp_dir = /tmp
Is that the correct format for the php.ini file? Any help to get this working would be appreciated.
Just my $.02 :-)
Ti Powerbook 1Ghz w/ Superdrive ......and lovin' it! :)
     
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
Apr 1, 2003, 02:06 PM
 
I'm not sure that you need to specify a temporary upload directory, but make sure you set file_uploads to 1 (its a boolean). You can see more here:

http://www.php.net/manual/en/configu...directives.php

Under File Uploads.
     
milf  (op)
Mac Enthusiast
Join Date: Nov 2001
Location: Washington, DC 20009
Status: Offline
Reply With Quote
Apr 1, 2003, 04:12 PM
 
I think it is set to 1 by default. Regardless, when I print out the phpinfo() variables on my TiBook, it has file_uploads set to 1. I'm not sure why, but when I created the files /usr/lib/php.ini and /usr/local/lib/php.ini, neither of them seemed to take effect. Anyone?
Just my $.02 :-)
Ti Powerbook 1Ghz w/ Superdrive ......and lovin' it! :)
     
milf  (op)
Mac Enthusiast
Join Date: Nov 2001
Location: Washington, DC 20009
Status: Offline
Reply With Quote
Apr 1, 2003, 04:38 PM
 
Duh...needed to restart Apache
Just my $.02 :-)
Ti Powerbook 1Ghz w/ Superdrive ......and lovin' it! :)
     
milf  (op)
Mac Enthusiast
Join Date: Nov 2001
Location: Washington, DC 20009
Status: Offline
Reply With Quote
Apr 1, 2003, 05:16 PM
 
Okay, I'm getting close. I've gotten the script to work...almost. I do a check at the end that tests to see if the file was uploaded successfully and if not, to print the error code to the screen. Each time I attempt to upload a 24kb Word Document, 2 is displayed in the browser. I looked this up, and the PHP website says that is the error code indicating that max_file_size has been reached. I was successfully able to upload a 4kb document. I've read in various places that the max_file_size must be indicated as a hidden field in your HTML form. I've tried doing this. Is it that my max_file_size value just isn't big enough? I tried a 1 followed by about 15 zeros, but that didn't work either. Is there a way to make the max_file_size value infinitely large? Where do post_max_size and upload_file_size fit in to the picture? I set the latter two both to "50M" which should be 50MB, right?
Just my $.02 :-)
Ti Powerbook 1Ghz w/ Superdrive ......and lovin' it! :)
     
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
Apr 1, 2003, 11:22 PM
 
upload_max_filesize is a setting in the ini file, setting to "50M" will be 50 MB yes
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:20 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2