Cannot Find Var/WWW folder

Hi,

I wanted to edit my theme for adding a piece of code. However, i am unable to find www folder in /var directory. I have searched /home as well, but the home folder is empty. I am looking for WP-content folder to edit my theme.

Any idea where I can locate the www folder or directly access wp-content folder?

7 Replies

Check if there's a /srv, specifically /srv/www, that's becoming a somewhat common alternative to the old /var/www

Yes, there is /SRV directory, but when I open it, it shows empty.

I used access it earlier without any problem. Now don't know what causing this.

Could this be a permission issue?

If you could access it before, what did you change to make it so you can't now?

@tashreef:

Yes, there is /SRV directory, but when I open it, it shows empty.

I used access it earlier without any problem. Now don't know what causing this.

Could this be a permission issue?

Depending what user you're trying to access it as, potentially. Though root or the www-data user (usually named by default) should be able to see into it fine, are you using either one of those to attempt to access the folder? (Though using root to edit/modify web files would be a bad idea, but to simply 'check' if things exist you can't get more permission than root for the most part.)

You may also want to try for the hell of it, https://wordpress.org/plugins/wordpress-php-info/

Use that plugin temporarily to see phpinfo(), which will tell you what your document path is, specifically you'll want to look towards the bottom for a SERVER["DOCUMENTROOT"] value, that will show you the general path where your wordpress is installed.

Just disable/remove that plugin after using it (no point in keeping plugins only needed once installed forever).

Oh my Goodness, thank you so much for that plugin :)

Found it here /usr/share/nginx/html/my-blog (Document Root)

something I never expected.

You're not supposed to put your own files in /usr/share/nginx/html. Move them somewhere sane like /srv/www now. /usr/share is under the control of your package manager and your files may be deleted next time you upgrade Nginx.

@mnordhoff:

You're not supposed to put your own files in /usr/share/nginx/html. Move them somewhere sane like /srv/www now. /usr/share is under the control of your package manager and your files may be deleted next time you upgrade Nginx.

Thank you for the input.

Any guide to do the same?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct