Please tell me how you can receive error messages in the console (there is such a package that allows you to run php-scripts). for example, there is a code:
error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 1); if(!$parent_resources = $modx->getCollection('modResource', array( 'parent' => 3, 'published' => 1 ))){ return; }; $output = ''; foreach ($parent_resources as $parent_resource) { $parent_resource_id = $parent_resource->get('id'); $output .= $parent_resource_id; $child_resources = $modx->getCollection('modResource', array( 'parent' => $parent_resource_id, 'published' => 1 )); };
there is an error in it because as a result nothing is displayed on the screen. but I would like to receive at least some messages
As you can see, I included error_reporting and ini_set at the beginning of the script. I also registered in .htaccess:
php_flag display_errors On php_value error_reporting "E_ALL & ~E_NOTICE"
But it does not help.
ps: Please do not tell me how to fix the above script. The question is not how to fix it, the question is how to get error messages in principle.