Skip to content

yookoala/gophpfpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gophpfpm Travis GoDoc

gophpfpm is a minimalistic php-fpm process manager written in go.

It generates config file for a simple php-fpm process with 1 pool and listen to 1 address only.

This is a fringe case, I know. Just hope it might be useful for someone else.

Usage

package main

import "github.com/yookoala/gophpfpm"

func main() {

  phpfpm := gophpfpm.NewProcess("/usr/sbin/php5-fpm")

  // config to save pidfile, log to "/home/foobar/var"
  // also have the socket file "/home/foobar/var/php-fpm.sock"
  phpfpm.SetDatadir("/home/foobar/var")

  // save the config file to basepath + "/etc/php-fpm.conf"
  phpfpm.SaveConfig(basepath + "/etc/php-fpm.conf")
  phpfpm.Start()

  go func() {

    // do something that needs phpfpm
    // ...
    phpfpm.Stop()

  }()

  // will wait for phpfpm to exit
  phpfpm.Wait()

}

License

This software is license under MIT License. You may find a copy of the license in this repository.

About

Simple process manager for php-fpm in go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published