I am using wordpress functions in a custom php file including wp-load.php
, run from browser it is fine, but run from command line with php /path/.php
wp-load.php
causes problems:
Warning: Cannot modify header information - headers already sent in /../wp-includes/ms-settings.php on line 162
code example to reproduce:
echo 'something';
require "/../wp-load.php";
wp-load.php
directly?echo
, you send headers, so you can not send them again or modified them. This is a pure PHP related problem not specifically related with WordPress.