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

前端 未结 13 2032
攒了一身酷
攒了一身酷 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 06:11

    Try this:

    1. open /etc/apache2/envvars

      sudo gedit /etc/apache2/envvars
      
    2. replace www-data with your your_username

      "export APACHE_RUN_USER=www-data" 
      

      replace with

      export APACHE_RUN_USER='your_username' 
      

提交回复
热议问题