I am using the WordPress method $wp_filesystem->put_contents()
to write a file to the server. When I use an absolute path like the following no file will be put to that location:
/www/htdocs/w423fe4/wordpress/wp-content/plugins/file.zip
However when I change the path to start only after the user name (w423fe4) the file is indeed put to the server. So my question is is there any way to programmatically get the server path starting from the root of the user account in PHP? So basically what I like to get in the above case is this:
/wordpress/wp-content/plugins/file.zip
Or is this not possible because every server somehow has a different structure?