I ran into the same issue. After a lot of trial and error, I ran across this thread and discovered the problem is the way that Text Editor on the Mac handles single quotes. If you look carefully, it’s a slightly different symbol.
I was able to get things to work by copying the single quote at the end of the
require( dirname( __FILE__ ) . '/wpfolder/wp-blog-header.php' );
line and then pasting that single quote at the beginning of the path. Everything worked then.