0

New to OpenLiteSpeed, I received a permission denied warning error when trying to write a file in the website subdirectory using file_put_contents() API from PHP. I thought perhaps I needed to adjust the open_basedir in /usr/local/lsws/lsphp73/etc/php/7.3/litespeed/php.ini and restarted OpenLiteSpeed, but the warning persisted. I then did chown -R www-data:www-data /var/www where I had the websites in my configuration, but that didn't seem to help. I then played with chown to open up permissions for the directory of the file I wanted to edit, and then the file itself. Nothing seems to work. What's wrong?

ServerChecker
  • 1,518
  • 2
  • 14
  • 35

1 Answers1

1

So, as it turns out, the proper folder permission with OpenLiteSpeed for where you place the files should be nobody:nogroup, not www-data:www-data like it would be with Apache. So, since I was placing all my web files under some path in /var/www, I did chown -R nobody:nogroup /var/www and the problem went away.

ServerChecker
  • 1,518
  • 2
  • 14
  • 35