ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$_SERVER['SERVER_SOFTWARE'] = 'Apache';
$_SERVER['HTTP_USER_AGENT'] = 'PHP';
$_SERVER['PHP_SELF'] = '/wp/wp-admin/admin-ajax.php';
require_once(__DIR__ . '/../misc/autoload.php');
define('WP_ADMIN', 1);
print_r("before");
require_once(__DIR__ . '/../public/wp-load.php');
require_once(__DIR__ . '/../public/wp-includes/rewrite.php');
require_once(__DIR__ . '/../public/wp-admin/includes/file.php');
require_once(__DIR__ . '/../public/wp-admin/includes/misc.php');
require_once(__DIR__ . '/../public/wp-admin/includes/plugin.php');
print_r("after");
Using some cronjobs in my wp site, and I need to run this block of code, but the code runs without any error, but the code just stops running before "after" gets printed. It's not outputting any error.
I get a warning:
Warning: Cannot modify header information - headers already sent by (output started at /home/alpha/version/ver/v4.3.11/cake.com/scripts/run-resource.php:2) in /home/alpha/version/ver/v4.3.11/cake.com/vendor/cakeauto/phplibs/hg/wordpress/Bootstrap.php on line 150
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
This bit of code doesn't seem to display any error.