Find the answer to your Linux question:
Results 1 to 3 of 3
I've modified my /etc/php.ini file (specifically the upload_tmp_dir variable) and when I run phpinfo() I see the changes reflected. However, when I upload files the tmp_name var from the superglobal ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    3

    php.ini file changes in phpinfo but changes not used


    I've modified my /etc/php.ini file (specifically the upload_tmp_dir variable) and when I run phpinfo() I see the changes reflected.

    However, when I upload files the tmp_name var from the superglobal array $_FILES, it still indicates the value is /tmp.

    Thus far, I have tried the following:
    -from the root dir, ran a find ./ | grep php.ini ..../etc/php.ini is the only one
    -restarted apache
    -spent 2 hours on the web searching for an answer


    As an aside, I'm still receiving the following error in the /var/log/httpd/error_log file:

    [client 192.168.1.2] PHP Warning: move_uploaded_file() [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: Unable to move '/tmp/phpteRDZK' to '/var/www/html/pictures/temp/tempPic.jpg' in /var/www/html/admin/processInfo.php on line 15, referer: http://192.168.1.100/admin/pictureAd...cture&theMsg=2

    ...as you can see, it's still indicating the /tmp dirrectory is being used as the upload_tmp_dir despite the following being displayed when I run phpinfo():

    upload_tmp_dir => /var/www/html/pictures/temp => /var/www/html/pictures/temp

    I assume the Warning is just a permissions problem (Apache user which runs Apache does not have permissions to read from /tmp or write to the other dir).

    Thanks for any help.

  2. #2
    Just Joined!
    Join Date
    Jul 2008
    Posts
    3
    In case someone else has this problem later, I figured it out.

    The problem was SELinux. I'm not sure exactly what it was doing, and I had it configured to allow httpd file transfers AND I had rebooted several times since making those changes, but it wasn't working, so I figured the problem was elsewhere.

    What I did was disable SELinux, saw that I no longer had this problem, then enabled SELinux (without making any other changes at all to SELinux) and the problem went away.

  3. #3
    Just Joined! andriagutama's Avatar
    Join Date
    Jul 2008
    Location
    Batam, Indonesia
    Posts
    34
    Just make sure other users able to upload files in your upload directory..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •