See which linux user WordPress is using


Add the following line to the top of your index.php file and it will print to the screen the name of the linux user on your box which WordPress is running under.

This can be handy when trying to solve permissioning problems such as WordPress not being able to write software updates, install new themes, media files and the like.

When you identify the Linux user WordPress is using to try to perform the action (usually ‘www-data’) it’s then simply a case of giving ownership and folder (uploads, themes, etc) write permissions to the said user account which WordPress is using.

echo(exec("whoami"));die();

PS – Remember to either delete or comment out the line of code after you get the name!

Contact Me