Score:0

Debugging and logging php cronjobs

dk flag
timeout -s9 1h php -d memory_limit=4096M run-action.php --host=www.goodbuys.ca --action=import_hook --lock=import;

Every time I run this, I get:

Exception detail: /var/log/goodbuys/goodbuys-goodbuys-exp_30272b7e17.json
Class: gb\php\PHPErrorException
Line: 12

Documentation Link: No Documentation
Message: PHP Error #2: Invalid argument supplied for foreach()

====================================
Stack trace:
#0 /home/goodbuys/version/ver/v1.3.131/goodbuys.com/vendor/goodbuys/libraries/gb/php/ErrorHandler.php(35): gb\php\PHPErrorException::create(2, 'Invalid argumen...', '/home/gbvim...', 91)
#1 /home/goodbuys/version/ver/v1.3.131/goodbuys.com/vendor/goodbuys/libraries/gb/thirdparty/gbsolution/InventoryReader.php(91): gb\php\ErrorHandler->handle(2, 'Invalid argumen...', '/home/gbvim...', 91, Array)
#2 /home/goodbuys/version/ver/v1.3.131/goodbuys.com/vendor/goodbuys/libraries/gb/thirdparty/gbsolution/InventoryMsSQLSync.php(70): gb\thirdparty\gbsolution\InventoryReader->getIterator()
#3 /home/goodbuys/version/ver/v1.3.131/goodbuys.com/scripts/run-resource.php(50): gb\thirdparty\gbsolution\InventoryMsSQLSync->run()
#4 {main}

I keep getting errors, but when I put print_r() inside InventoryReader.php and InventoryMsSQLSync.php, I don't get anything, even if I add > debug.log at the end. Is there a way to print everything?

I put the print_r() before the error, and still I don't get anything. I want to print the logs on the console.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.