Standalone preforking PHP application server framework

June 18th, 2009 by Boštjan Škufca

What a lenghty title! But it does characterize well the thing I have been working on a couple of nights. iphone 7 case peace ps4 iphone 6 case phone cases for girls iphone 6 iphone 7 phone cases leaves disbey iphone 7 case iphone 360 case 6 The idea consists of these basic prerequisites: – sometimes I need to create small application that is not a standard web application, – it could be necessary that it it running as root/other privileged user, – it probably receives client connections from network, – I need to have total control of what it does, for security reasons, – I do not want to configure it, I want to write it. iphone 7 bump case iphone 8 plus matt case – I want it to be written in PHP, which is a commodity language. infinity war iphone 6 case pug iphone 7 plus case iphone 7 phone cases monogram Usually PHP is coupled with some web server software, which together then constitutes web application server. funny iphone 6 case iphone 7 phone cases dustproof iphone x case shock proof This is a standard setup. apple iphone 6 silicone case blue mint green iphone 7 case white iphone 7 plus case iphone 6 battery case rose gold It involves installing a web server, like Apache or NginX or IIS etc, which then you have to configure to suit your needs. solar iphone 7 case hard silicone iphone 8 plus case iphone 7 plus silicone case pink 3d disney iphone 7 plus case iphone 7 cases purple Then you have to add PHP to it, and configure that too. iphone 8 plus case led iphone 8 mulan case iphone 6 case navy rose gold iphone 7 case gothic But what if you do not want a WEB server, what if you want a CUSTOM application server that does not use HTTP protocol but some weird/invented/forgotten/X protocol that you find suitable for your purpose? This is why I have written this framework. a bathing ape iphone 7 case military grade iphone 8 plus case girl iphone 7 phone cases sequin phone case iphone 7 You do not have to start from scratch, if you do not want to. iphone 8 plus case and screen protector iphone 7 case flowers iphone 7 case pastel What it does is this: – starts and daemonizes – forks as many children as needed – children start waiting for connections – when connection arrives, one of the children accepts the connection – here your custom processing part starts – you start by rewriting the $this->worker_handleClient() or $this->worker_handleRequest() method, like below:

worker_closeConnection();   } }

And that is basically it. tropical iphone 7 case dinosaur iphone 6 case iphone 6 case protection Framework handles the rest of the story, accepts multiple simultaneous connections, forks additional children, etc. iphone 8 plus iblason case There is still a lot to do but I managed to get first working daemon written in 10 minutes. iphone 7 phone cases purple silicone iphone 7 plus gel case iphone 6 case perfume iphone 7 plus case dog It does fairly trivial job (accepting XML-RPC request and then su-ing to some specified user and running some shell command) but what seemed miles away once is now easily achieved. gear 4 iphone 6 case iphone 8 case glitter sparkle If you need it, enjoy it. protective cases for iphone 8 plus glow in the dark iphone 6 case iphone 8 case strap case protector iphone 6 red iphone 6 case hard Here is the URI: Standalone preforking PHP application server framework. totoro iphone 6 pluss phone case gel iphone 6 case front and back iphone 7 case protect charger iphone 6 case If you find some feature missing and/or you have prepared a patch for it, let me know in comments.

Leave a Reply