I've written a PHP file that I use as a template for a WordPress page and I want to refer to some WordPress functions on the page so at the top I have:
require_once("/nas/wp/www/bb2/wp-blog-header.php"); global $wpdb;
"/nas/wp/www/bb2/" is the root of my site and I can clearly see that wp-blog-header.php is there in the root:
Yet, when the PHP file runs it throws the error:
Warning: require_once(/nas/wp/www/bb2/wp-blog-header.php): failed to open stream: No such file or directory . . .
Why doesn't it see wp-blog-header.php?
I have a staging copy of the site (the site is hosted on WP Engine, where it's easy to create staging sites) and it works there! The only difference is that I included "staging" in the path to wp-blog-header.php:
require_once("/nas/wp/www/staging/bb2/wp-blog-header.php"); global $wpdb;