Skip to content

Instantly share code, notes, and snippets.

@janikvonrotz
Last active August 29, 2015 13:56

Revisions

  1. janikvonrotz revised this gist Sep 30, 2014. No changes.
  2. janikvonrotz revised this gist Sep 29, 2014. No changes.
  3. janikvonrotz revised this gist Sep 29, 2014. 1 changed file with 0 additions and 71 deletions.
    71 changes: 0 additions & 71 deletions Install php5-fpm.md
    Original file line number Diff line number Diff line change
    @@ -7,77 +7,6 @@
    Install the package with aptitude.

    sudo aptitude install php5-fpm

    Edit the default pool config file.

    sudo vi /etc/php5/fpm/pool.d/www.conf

    Comment out these lines as we split them into different configuration files.

    ;listen = 127.0.0.1:9000
    ;pm.max_children = 10
    ;pm.start_servers = 4
    ;pm.min_spare_servers = 2
    ;pm.max_spare_servers = 6

    Now create the following configuration files in the `/etc/php5/fpm/pool.d/` folder.

    **ping.conf**
    Health check for php-fpm process. Uses special URL that will simply return "pong".
    ```
    [www]
    ping.path = /ping
    ```

    **processes.conf**
    Defines exactly how many processes php-fpm is allowed to spawn. Update these settings based on your requirements.
    ```
    [www]
    ; at any time, there can be no more than 5 child processes
    ; if you know how much memory each process consumes regularly
    ; and how much free memory you have on your system, this is how
    ; you set a "hard limit" on the amount of memory php-fpm will be able to consume
    pm.max_children = 5
    ; when php-fpm first starts, how many processes should
    ; it immediately generate to handle requests?
    ; when you restart php-fpm, there may be an influx of requests.
    ; spawning a new process can take time (albeit very small), so we want
    ; to go ahead and have this many ready to go
    pm.start_servers = 2
    ; if there are no requests currently, how many spare
    ; processes should we always make sure to keep around?
    ; again, there is a delay in spawning new processes,
    ; so having a few always ready to go is a good idea.
    ; the offset is that they will be taking up memory that your system
    ; might otherwise be able to use for other things
    pm.min_spare_servers = 1
    ; the inverse of the former. if there's nothing going on,
    ; how many spare processes are we allowed to keep around?
    ; again, fewer means more memory on the system for other things,
    ; but more means less of a delay if an influx of requests comes in
    pm.max_spare_servers = 3
    ```

    **socket.conf**
    Socke configuration for the php-fpm listener.
    ```
    [www]
    listen = /var/run/php5-fpm.socket
    ```

    **status.conf**
    Status monitoring for php-fpm.
    ```
    [www]
    pm.status_path = /status
    ```

    Restart the php5-fpm service.

    sudo service php5-fpm restart

    Check the php5-fpm version.

  4. janikvonrotz revised this gist Mar 18, 2014. 1 changed file with 0 additions and 21 deletions.
    21 changes: 0 additions & 21 deletions Install php5-fpm.md
    Original file line number Diff line number Diff line change
    @@ -8,27 +8,6 @@ Install the package with aptitude.

    sudo aptitude install php5-fpm

    Optionally add this packages.

    hp5-idn
    php5-curl
    php5-gd p
    php5-imagick
    php5-imap
    php5-mcrypt
    php5-memcache
    php5-ming
    php5-mysql
    php5-ps
    php5-pspell
    php5-recode
    php5-snmp
    php5-sqlite
    php5-tidy
    php5-xmlrpc
    php5-xsl
    php-pear

    Edit the default pool config file.

    sudo vi /etc/php5/fpm/pool.d/www.conf
  5. janikvonrotz revised this gist Mar 18, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install php5-fpm.md
    Original file line number Diff line number Diff line change
    @@ -96,7 +96,7 @@ Status monitoring for php-fpm.
    pm.status_path = /status
    ```

    Restart the php-fpm service.
    Restart the php5-fpm service.

    sudo service php5-fpm restart

  6. janikvonrotz revised this gist Mar 18, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install php5-fpm.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    # Installation

    Install PHP.
    Install the package with aptitude.

    sudo aptitude install php5-fpm

  7. janikvonrotz renamed this gist Mar 11, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. janikvonrotz renamed this gist Mar 11, 2014. 1 changed file with 0 additions and 0 deletions.
  9. janikvonrotz renamed this gist Mar 11, 2014. 1 changed file with 0 additions and 0 deletions.
  10. janikvonrotz renamed this gist Mar 11, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  11. janikvonrotz revised this gist Mar 10, 2014. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Install php5-fpm.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    # Requirements

    * Ubuntu server

    # Installation

    Install PHP.
  12. janikvonrotz revised this gist Mar 9, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Install php5-fpm.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Installation

    Install PHP.

    sudo aptitude install php5-fpm
  13. janikvonrotz revised this gist Mar 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install php5-fpm.md
    Original file line number Diff line number Diff line change
    @@ -80,7 +80,7 @@ pm.max_spare_servers = 3
    Socke configuration for the php-fpm listener.
    ```
    [www]
    listen = localhost:9000
    listen = /var/run/php5-fpm.socket
    ```

    **status.conf**
  14. janikvonrotz renamed this gist Mar 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install php-fpm.md → Install php5-fpm.md
    Original file line number Diff line number Diff line change
    @@ -80,7 +80,7 @@ pm.max_spare_servers = 3
    Socke configuration for the php-fpm listener.
    ```
    [www]
    listen = /var/run/php5-fpm.socket
    listen = localhost:9000
    ```

    **status.conf**
  15. janikvonrotz revised this gist Mar 6, 2014. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Install php-fpm.md
    Original file line number Diff line number Diff line change
    @@ -93,6 +93,10 @@ pm.status_path = /status
    Restart the php-fpm service.

    sudo service php5-fpm restart

    Check the php5-fpm version.

    php5-fpm -v

    # Source

  16. janikvonrotz revised this gist Mar 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install php-fpm.md
    Original file line number Diff line number Diff line change
    @@ -80,7 +80,7 @@ pm.max_spare_servers = 3
    Socke configuration for the php-fpm listener.
    ```
    [www]
    listen = /var/run/php5-fpm.sock
    listen = /var/run/php5-fpm.socket
    ```

    **status.conf**
  17. janikvonrotz revised this gist Mar 6, 2014. 1 changed file with 21 additions and 4 deletions.
    25 changes: 21 additions & 4 deletions Install php-fpm.md
    Original file line number Diff line number Diff line change
    @@ -4,21 +4,38 @@ Install PHP.

    Optionally add this packages.

    php5-cli php5-curl php5-mcrypt php5-mysqlnd php5-sqlite
    hp5-idn
    php5-curl
    php5-gd p
    php5-imagick
    php5-imap
    php5-mcrypt
    php5-memcache
    php5-ming
    php5-mysql
    php5-ps
    php5-pspell
    php5-recode
    php5-snmp
    php5-sqlite
    php5-tidy
    php5-xmlrpc
    php5-xsl
    php-pear

    Edit the default pool config file.

    sudo vi /etc/php5/fpm/pool.d/www.conf

    Comment out these configuration as we split the configuration files.
    Comment out these lines as we split them into different configuration files.

    ;listen = 127.0.0.1:9000
    ;pm.max_children = 10
    ;pm.start_servers = 4
    ;pm.min_spare_servers = 2
    ;pm.max_spare_servers = 6

    Now create the following configuration file in the `/etc/php5/fpm/pool.d/` folder.
    Now create the following configuration files in the `/etc/php5/fpm/pool.d/` folder.

    **ping.conf**
    Health check for php-fpm process. Uses special URL that will simply return "pong".
    @@ -75,7 +92,7 @@ pm.status_path = /status

    Restart the php-fpm service.

    sudo service php5-fpm restart
    sudo service php5-fpm restart

    # Source

  18. janikvonrotz revised this gist Mar 6, 2014. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions Install php-fpm.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,3 @@
    Update the list of available packages and upgrade any that have updates available.

    sudo aptitude update
    sudo aptitude safe-upgrade

    Install PHP.

    sudo aptitude install php5-fpm
  19. janikvonrotz renamed this gist Mar 4, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  20. janikvonrotz revised this gist Mar 4, 2014. No changes.
  21. janikvonrotz revised this gist Mar 4, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Install PHP-FPM.md
    Original file line number Diff line number Diff line change
    @@ -25,14 +25,14 @@ Comment out these configuration as we split the configuration files.

    Now create the following configuration file in the `/etc/php5/fpm/pool.d/` folder.

    *ping.conf*
    **ping.conf**
    Health check for php-fpm process. Uses special URL that will simply return "pong".
    ```
    [www]
    ping.path = /ping
    ```

    *processes.conf*
    **processes.conf**
    Defines exactly how many processes php-fpm is allowed to spawn. Update these settings based on your requirements.
    ```
    [www]
    @@ -64,14 +64,14 @@ pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    ```

    *socket.conf*
    **socket.conf**
    Socke configuration for the php-fpm listener.
    ```
    [www]
    listen = /var/run/php5-fpm.sock
    ```

    *status.conf*
    **status.conf**
    Status monitoring for php-fpm.
    ```
    [www]
  22. janikvonrotz revised this gist Mar 4, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Install PHP-FPM.md
    Original file line number Diff line number Diff line change
    @@ -25,14 +25,14 @@ Comment out these configuration as we split the configuration files.

    Now create the following configuration file in the `/etc/php5/fpm/pool.d/` folder.

    *ping.conf*
    *ping.conf*
    Health check for php-fpm process. Uses special URL that will simply return "pong".
    ```
    [www]
    ping.path = /ping
    ```

    *processes.conf*
    *processes.conf*
    Defines exactly how many processes php-fpm is allowed to spawn. Update these settings based on your requirements.
    ```
    [www]
    @@ -64,14 +64,14 @@ pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    ```

    *socket.conf*
    *socket.conf*
    Socke configuration for the php-fpm listener.
    ```
    [www]
    listen = /var/run/php5-fpm.sock
    ```

    *status.conf*
    *status.conf*
    Status monitoring for php-fpm.
    ```
    [www]
  23. janikvonrotz revised this gist Mar 4, 2014. 1 changed file with 87 additions and 1 deletion.
    88 changes: 87 additions & 1 deletion Install PHP-FPM.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,87 @@
    _
    Update the list of available packages and upgrade any that have updates available.

    sudo aptitude update
    sudo aptitude safe-upgrade

    Install PHP.

    sudo aptitude install php5-fpm

    Optionally add this packages.

    php5-cli php5-curl php5-mcrypt php5-mysqlnd php5-sqlite

    Edit the default pool config file.

    sudo vi /etc/php5/fpm/pool.d/www.conf

    Comment out these configuration as we split the configuration files.

    ;listen = 127.0.0.1:9000
    ;pm.max_children = 10
    ;pm.start_servers = 4
    ;pm.min_spare_servers = 2
    ;pm.max_spare_servers = 6

    Now create the following configuration file in the `/etc/php5/fpm/pool.d/` folder.

    *ping.conf*
    Health check for php-fpm process. Uses special URL that will simply return "pong".
    ```
    [www]
    ping.path = /ping
    ```

    *processes.conf*
    Defines exactly how many processes php-fpm is allowed to spawn. Update these settings based on your requirements.
    ```
    [www]
    ; at any time, there can be no more than 5 child processes
    ; if you know how much memory each process consumes regularly
    ; and how much free memory you have on your system, this is how
    ; you set a "hard limit" on the amount of memory php-fpm will be able to consume
    pm.max_children = 5
    ; when php-fpm first starts, how many processes should
    ; it immediately generate to handle requests?
    ; when you restart php-fpm, there may be an influx of requests.
    ; spawning a new process can take time (albeit very small), so we want
    ; to go ahead and have this many ready to go
    pm.start_servers = 2
    ; if there are no requests currently, how many spare
    ; processes should we always make sure to keep around?
    ; again, there is a delay in spawning new processes,
    ; so having a few always ready to go is a good idea.
    ; the offset is that they will be taking up memory that your system
    ; might otherwise be able to use for other things
    pm.min_spare_servers = 1
    ; the inverse of the former. if there's nothing going on,
    ; how many spare processes are we allowed to keep around?
    ; again, fewer means more memory on the system for other things,
    ; but more means less of a delay if an influx of requests comes in
    pm.max_spare_servers = 3
    ```

    *socket.conf*
    Socke configuration for the php-fpm listener.
    ```
    [www]
    listen = /var/run/php5-fpm.sock
    ```

    *status.conf*
    Status monitoring for php-fpm.
    ```
    [www]
    pm.status_path = /status
    ```

    Restart the php-fpm service.

    sudo service php5-fpm restart

    # Source

    [Configuring and Optimizing PHP-FPM and Nginx on Ubuntu](http://blog.chrismeller.com/configuring-and-optimizing-php-fpm-and-nginx-on-ubuntu-or-debian)
  24. janikvonrotz revised this gist Mar 4, 2014. 1 changed file with 1 addition and 12 deletions.
    13 changes: 1 addition & 12 deletions Install PHP-FPM.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1 @@
    Update the list of available packages and upgrade any that have updates available.

    sudo aptitude update
    sudo aptitude safe-upgrade

    Install PHP

    sudo aptitude install php5-fpm

    Optional add this packages

    hp5-cli php5-curl php5-mcrypt php5-mysqlnd php5-sqlite
    _
  25. janikvonrotz created this gist Mar 4, 2014.
    12 changes: 12 additions & 0 deletions Install PHP-FPM.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    Update the list of available packages and upgrade any that have updates available.

    sudo aptitude update
    sudo aptitude safe-upgrade

    Install PHP

    sudo aptitude install php5-fpm

    Optional add this packages

    hp5-cli php5-curl php5-mcrypt php5-mysqlnd php5-sqlite