{"id":2120,"date":"2022-08-30T15:22:13","date_gmt":"2022-08-30T15:22:13","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/02\/how-can-i-debug-segmentation-faults-in-the-php-cli-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:22:13","modified_gmt":"2022-08-30T15:22:13","slug":"how-can-i-debug-segmentation-faults-in-the-php-cli-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-can-i-debug-segmentation-faults-in-the-php-cli-collection-of-common-programming-errors\/","title":{"rendered":"How can I debug segmentation faults in the PHP CLI?-Collection of common programming errors"},"content":{"rendered":"<p>I have written some code that I run remotely on a server via the php-cli and a particular method within this code (I&#8217;m unsure <em>which method<\/em> at the moment) is causing a <code>segmentation fault<\/code>.<\/p>\n<p>Apart from adding <code>exit<\/code> and <code>echo<\/code> calls down through my methods and manually pinpointing the bad bits &#8211; <strong>is there a way to catch the segmentation fault as it happens<\/strong> and find out what piece of the puzzle is crashing? Standard PHP errors are displayed through the error shutdown handlers, I&#8217;m unsure where to start with this segmentation fault.<\/p>\n<p>Cheers!<\/p>\n<p id=\"rop\"><small>Originally posted 2014-01-02 12:06:52. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have written some code that I run remotely on a server via the php-cli and a particular method within this code (I&#8217;m unsure which method at the moment) is causing a segmentation fault. Apart from adding exit and echo calls down through my methods and manually pinpointing the bad bits &#8211; is there a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2120","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2120"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2120\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}