Modified smpss based on SlightPHP.