Load Woocommerce and WordPress Functions Outside

When I am using a php script in my WordPress installation, I have special functions in the child theme, in functions.php So I have to require that as well.

Also you want to make sure that SHORTINIT is not defined as TRUE, or else you lose many WordPress functions.

Here is how I do it.

ignore_user_abort(true);
$path = $_SERVER['DOCUMENT_ROOT'];
require( $path.'/wp-load.php' );
require_once( get_stylesheet_directory() . '/../Divi-child/functions.php' );
// now all my functions are loaded

error code: 523