move_uploaded_file gives “failed to open stream: Permission denied” error

前端 未结 13 2259
攒了一身酷
攒了一身酷 2020-11-22 05:36

I keep getting this error when trying to configure the upload directory with Apache 2.2 and PHP 5.3 on CentOS.

In php.ini:

upload_tmp_dir = /var/www/ht         


        
13条回答
  •  爱一瞬间的悲伤
    2020-11-22 05:57

    You can also run this script to find out the Apache process owner:

    And then change the owner of the destination directory to what you've got. Use the command:

    chown user destination_dir
    

    And then use the command

    chmod 755 destination_dir
    

    to change the destination directory permission.

提交回复
热议问题