PHP

Revision as of 21:32, March 10, 2015 by Threesixes (Talk | contribs) (add clock info and other stuff)

dev-lang/php


No contents found at URL http://ports.funtoo.org/packages.xml.
Source Repository:Repository:Gentoo Portage Tree

http://php.net/

Summary: The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs

Use Flags

cli
Enable CLI SAPI
embed
Enable embed SAPI
enchant
Add supports Enchant spelling library.
fileinfo
Add fileinfo extension support
filter
Add filter extension support
fpm
Enable the FastCGI Process Manager SAPI
gd
Adds support for gd (bundled with PHP)
hash
Enable the hash extension
json
Enable JSON support
ldap-sasl
Add SASL support for the PHP LDAP extension
mysqlnd
Use native driver for mysql, mysqli, PDO_Mysql
libmysqlclient
Use libmyslclient driver for mysql, mysqli, PDO_Mysql (not recommended)
intl
Enables the intl extension for extended internalization support
opcache
Enables built-in opcode cache, replacing pecl-apc et.al
pdo
Enable the bundled PDO extensions
phar
Enables the phar extension to provide phar archive support
xmlreader
Enable XMLReader support
xmlwriter
Enable XMLWriter support
xslt
Enable the XSL extension
vpx
Enable webp suppoprt for GD
zip
Enable ZIP file support

News

Drobbins

Perl Updates

Gentoo has bumped perl from 5.20 to 5.22. Be sure to run perl-cleaner --all after the upgrade.
2015-07-25 by Drobbins
Drobbins

ARM Rebuild

ARM systems will use new stage3's that are not compatible with earlier versions.
2015-06-27 by Drobbins
Drobbins

ABI X86 64 and 32

Funtoo Linux has new 32-bit compatibility libraries inherited from Gentoo. Learn about them here.
2015-06-18 by Drobbins
More...

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. Many packages are php aware, set the php global use flag so other applications can interact with php.

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

Emerge

# emerge php

Fpm

Fpm is a php handler. It is php daemonized.

init

To start the php-fpm service:

# rc-service php-fpm start

To start the php-fpm service at boot:

# 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

tips

Change Php Fpm's User/Group

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

Limiting Workers

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

Date & Time

Set the time and date for php web applications. full list of php timezones

/etc/php/fpm-php5.6/php-fpm.conf - limit workers
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

the same procedures can be done for other php implementations at

  • /etc/php/cli-php5.6/php.ini
  • /etc/php/apache2-php5.6/php.ini
  • /etc/php/cgi-php5.6/php.ini

Media

Programming