Shawn Kelly wrote: > hello php.general: > I want to send a file through an HTML form to my Linux server. > > Newbie to PHP, but I have been patient in inverse proportion to my > knowledge. I have seen many confused people with similar problems and their > respective solutions in my quest (!), but still no avail towards my own. > > > Here are my questions (first): > What sort of monster could possibly cause ini_get("file_uploads") to return > Off even though php.ini has file_uploads = On? - Apache's httpd.conf can use php_value directive to change ini settings - another php.ini that is the *actual* php.ini being used, instead of the php.ini that you *think* is being used. - if PHP doesn't find *any* php.ini file then it assumes a default set of options (file_uploads=On is the default though) http://php.net/manual/en/ini.php#ini.list The above link is the appendix for the php.ini directives - you might want to bookmark that page. It tells you what directives mean, where you can set the directives, and what the default values are. *Special Note* Be sure to check table H-2 at the very bottom as it explains the PHP_INI_* constants. > And how can I slay this monster? Depends on where the problem lies... but mainly just find where the directive is set to Off and change it to On. If you don't have control over that (because you can't / don't want to change the directive) then you are SOL. > > > Here is my history (last): > I am running redhat, apache 1.3.23, & PHP 4.3.9. upload_tmp_dir = > "/var/www/ultmp" and apache runs as user "apache". > Is PHP running as an Apache module? ... > > Second thought was that the cause was with php.ini or http.conf. > I have checked apache error_log: nothing. I tried setting upload_tmp_dir to > (nothing), to "/var/www/ultmp/", and to "/var/www/ultmp"; still nothing. I http://php.net/manual/en/ini.core.php#ini.upload-tmp-dir TMP needs to be writable for PHP user. Run `whoami` in PHP if you're not sure which user you are. ... > > But the spark in my curiousity: when I do phpinfo() in my > post-action-script, I see for the file_upload directive the "Local Value" > goes to Off. My guess is that what ever is causing "Local Value" to go to > Off even though "Master Value" is On (I did try restarting the server) is > also causing my $_FILES variable to be empty and my actual file data to be > thrown into the trash. Based on this information I am pretty sure httpd.conf is your culprit. http://php.net/configuration.changes > > > > > If you read all the way to the bottom, I must thank you for your time! > My respect and admiration to the PHP community! > > cudos, > Shawn Kelly. Yes it was a long, but very well-asked question. I hope that my comments help you solve your problem. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
Attachment:
signature.asc
Description: OpenPGP digital signature