Difference between revisions of "Package:PHP"

From Funtoo
Jump to navigation Jump to search
m (threw in a few tips)
m (add media playlist)
Line 50: Line 50:
pm.max_spare_servers = 19
pm.max_spare_servers = 19
}}
}}
== Media ==
=== Programming ===
{{#widget:YouTube|playlist=PL00694B0DAD604DE6}}


{{EbuildFooter}}
{{EbuildFooter}}

Revision as of 04:24, October 29, 2014

PHP

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language.

Install

Use Flags

By default php does not have the cgi, FPM/FastCGI, mysql, mysqli, apache2 use flag turned on.

   /usr/portage/make.conf - insert desired use flags
USE="mysql mysqli apache2 fpm cgi......"

Emerge

root # emerge php

Fpm

Fpm is a php handler. It is php daemonized.

init

To start the php-fpm service:

root # rc-service php-fpm start

To start the php-fpm service at boot:

root # rc-update add php-fpm

Configuration

Php-fpm is controlled by /etc/php/fpm-php*.*/php-fpm.conf and /etc/php/fpm-php*.*/php.ini

pro tips

making php-fpm workers work as the apache user makes most apache permission configurations work with out a bother.

   /etc/php/fpm-php5.6/php-fpm.conf - make workers run as another user
;user = nobody
;group = nobody
user = apache
group = apache

limit worker numbers to 20 max. When your server is behind a reverse proxy it doesn't need many workers.

   /etc/php/fpm-php5.6/php-fpm.conf - limit workers
pm.max_children = 20
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 19

Media

Programming