failed to open stream: Permission denied for WordPress plugin


I’m installing my website on a new hosting company. All WordPress directories are chmod to 775 and the owner (plus group) is my account username, the same owner as when I create new files manually.

Files created by a a non WordPress related PHP script gets another owner ID, I’m guessing that’s the webbserver? If I manually create a file and want the same script to write in that I also get this permission denied. Should the WordPress installation have the webbserver owner? Can I change this?

On a side note, WordPress also asks for FTP credentials every time a new theme installs or a plugin updates. If I specify define( 'FS_METHOD', 'direct' ); I get “Installation failed: Could not create directory.” instead.

This is the full message:

Warning: file_put_contents(/home/vhosts/ failed to open stream: Permission denied in /home/vhosts/ on line 24
, BootUp 3 years 2019-02-13T10:47:12-05:00 0 Answers 93 views 0

Leave an answer