Categories


Archives


Recent Posts


Categories


How PHP Runs a Program

astorm

Frustrated by Magento? Then you’ll love Commerce Bug, the must have debugging extension for anyone using Magento. Whether you’re just starting out or you’re a seasoned pro, Commerce Bug will save you and your team hours everyday. Grab a copy and start working with Magento instead of against it.

Updated for Magento 2! No Frills Magento Layout is the only Magento front end book you'll ever need. Get your copy today!

When I found the PHP Internals site a few months back, I noticed there was a small credit at the bottom.

Built by Thomas Punt & Liam Mann

Some Googling showed that Thomas Punt had written this How PHP Executes — from Source Code to Render article for sitepoint. While the article was accurate, like a lot of pro internet content it was a breezy, high level read that didn’t set out to get into the specifics of how all these systems worked.

Fortunatly, my Where’s the php-src/PHP-Internals Main Entry Point question over on Stack Overflow got a great response from axiac. Unfortunatly, that response demonstrates how challenging the PHP source code can be to deal with — mod_php, php-fpm, the php-cgi, and the PHP CLI each have their own specific entry points into the system. Each of those entry points also interacts with systems whose inner workings aren’t always simple, straight forward C code (I’m thinking specifically of the zend_vm_gen.php PHP program that’s used to generate C header files).

I continue to be struck with how much all this C wrangling had made me apprecaite simple things like MVC frameworks and a consensus on how code ought to be organized.

Copyright © Alan Storm 1975 – 2018 All Rights Reserved

Originally Posted: 26th February 2018