php-fpm - file upload error

Discussion in 'General' started by, Mar 11, 2019.

  1. Member

    I have enabled php-fpm for my website, Does php-fpm process works as apache uid of actual uid of website ?

    I am trying to copy a file to another website path, i have added that path "/var/www/" in the PHP open_basedir texbox. Still I am getting this error.

    Please guide

    Warning: file_put_contents(): open_basedir restriction in effect. File(/var/www/ Sky Cargo-Chennai-20190311.xml) is not within the allowed path(s): (/var/www/clients/client51/web68/web:/var/www/clients/client51/web68/tmp:/var/www/ in /var/www/clients/client51/web68/web/jeenaSurcharge.php on line 437
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Seems as ify ou changed the domain name of the site. Change the path of the open_basedir in the options field to the new domain or add the new path /var/www/ to the open_basedir field at the end, separated by ':'
  3. Member

    I have added :/var/www/
    should I also add /var/www/ ?

    I have two separate websites, and I am trying to copy from one website to other website folder via file_put_contents
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You could try it.
  5. Member

    Warning: file_put_contents(/var/www/ Sky Cargo-Ahmedabad-20190311.xml): failed to open stream: Permission denied in /var/www/clients/client51/web68/web/jeenaSurcharge.phpon line 437

    I have add all paths in basedir


    My script is running as web68 client51 permissions in /var/www/ directory, and I am trying to create file in "/var/www/" directory with permission as
    drwxrwxrwx 2 web68 client51 4096 Mar 11 11:40 Surcharges
  6. Member

    /var/www/ and inside directories have 777 permissions
  7. Member

    I gave 777 permission to /var/www/, and now its working fine

Share This Page