linux

Correct file permissions for WordPress

What permissions should I have for the following:

  • root folder storing all the WordPress content
  • wp-admin
  • wp-content
  • wp-includes

And then all the files in each of those folders?

Here is the correct file permissions for WordPress:
To set correct permissions you need to use these commands:
chown www-data:www-data -R * # Let apache be owner
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--

Setting locale to en_US.UTF-8 failed

While trying to install Owncloud I encountered the following error:
Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed

Please install one of theses locales on your system and restart your webserver.
For Debian Linux the solution is very simple, just run the following command:
dpkg-reconfigure locales
And mark at least one of the locales you need.

imagick Cannot locate header file MagickWand.h

For some odd reason I did not understand why imagick 2.3.0 did not want to install with ImageMagick 6.8.9-7. Apparently the directory structure changed in the last versions of ImageMagick.

The solution is pretty simple:
ln -s /usr/local/include/ImageMagick-6 /usr/local/include/ImageMagick

After this just follow the next steps and you’re in business:
wget http://pecl.php.net/get/imagick-2.3.0.tgz
pecl install imagick-2.3.0.tgz

I’m running PHP 5.3.28, however keep in mind that this particular version of imagick (2.3.0) won’t work in PHP 5.4 and higher.