You can use MPOS or CK pool code which is available publicly.
MPOS - Mining Portal Open Source.
https://github.com/MPOS/php-mposCK Pool code
https://bitbucket.org/ckolivas/ckpoolCK Pool code is well tested and used on may pools.
Running pool is no easy and takes much work, Must know security to protect users and server from hack.
Good Luck
AsicWorld
Yeah MPOS is great, tested a few years ago. The other ones that I tested by Myself is NOMP