1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
Table of Contents:
---------------------------------------------------------------------
* Using php5 with threaded webservers (eg. apache2-mpm-worker, caudium)
* Problems starting apache2 with php5
* Session storage
* Other caveats
* php5-cgi and apache2
* Restarting your web server after installing modules
* Configuration layout
* Timezone data from system timezone database
* Further documentation, errata, etc
Using php5 with threaded webservers (eg. apache2-mpm-worker, caudium)
---------------------------------------------------------------------
After much back-and-forth with upstream (and even building our
packages thread-safe for a while), we're currently admitting defeat
on that front, and are NOT building any thread-safe versions of
PHP for any webservers. Our recommendation is that, if you need
to use a threaded webserver, you should use php5-cgi in either
'normal' CGI mode, or in FastCGI mode.
Adam Conrad <adconrad@0c3.net> Sun, 06 Feb 2005 08:24:56 -0700
Problems starting apache2 with php5
----------------------------------
At the time of writing, there are no *known* incompatibilities
between any of the php5 modules we ship. However, there have been
many bug reports in the past due to dynamically-loaded extensions,
and it's possible there are still bugs in the released packages. If
Apache fails to start after you install php5, check your list of
enabled extensions at the bottom of /etc/php5/apache2/php.ini (and in
the per-sapi configuration directory), and try commenting out or
reordering the extensions until you find a combination that works.
For example, in the past the mhash extension was incompatible with
some other common extensions. To work around this, you could list
the mhash extension first in php.ini.
If you find an extension-related bug in the Debian packages, and you
are willing to help debug the problem, please send us a bug report
that lists all enabled PHP5 extensions (extension=), in the order
in which they appear in php.ini, as well as all enabled Apache modules
(LoadModule), with version numbers where possible.
Steve Langasek <vorlon@debian.org> Fri, 26 Apr 2002 13:39:00 -0500
Session storage
---------------
Session files are stored in /var/lib/php5. For security purposes, this
directory is unreadable by non-root users. This means that php5 running
from apache2, for example, will not be able to clean up stale session
files. Instead, we have a cron job run every 30 mins that cleans up
stale session files; /etc/cron.d/php5. You may need to modify how
often this runs, if you've modified session.gc_maxlifetime in your
php.ini; otherwise, it may be too lax or overly aggressive in cleaning
out stale session files.
Andres Salomon <dilinger@debian.org> Fri, 03 Sep 2004 03:12:54 -0400
Other caveats
-------------
* extension_dir and include_path should be commented out, if you don't need
special settings for them so php will look in compiled-in paths. If you set
them, you should also add appropriate php install directories there.
php5-cgi and apache2
---------------------------
In 99% of cases, what you probably want isn't php5-cgi at all, but rather
the libapache2-mod-php5 package, which will configure itself on
installation and Just Work(tm). If, however, you have a need to use
the CGI version of php5 with apache2, the following should help
get you going, though there are dozens of different ways to do this.
Please note that this process will never be made automatic, as php5-cgi
is meant to be a webserver-agnostic package that can be used with any
httpd, and we don't want it to conflict with the httpd-specific packages
such as libapache2-mod-php5. If both were installed side-by-side and both
were automatically enabled, the results would be a bit confusing, obviously.
To use php5-cgi with apache2
1) activate CGI (it's on by default in default debian setups)
a) If using the prefork MPM, use 'a2enmod cgi'
b) If using a threaded MPM, use 'a2enmod cgid'
2) activate mod_actions (a2enmod actions)
3) Add the following to a config snippet in /etc/apache2/conf.d
<IfModule mod_actions.c>
Action application/x-httpd-php /cgi-bin/php5
</IfModule>
Adam Conrad <adconrad@0c3.net> Sat, 04 Sep 2004 23:04:26 -0600
Configuration Layout
---------------------------------------------------------------------
Each of the 3 SAPI's (apache2/cgi/cli) have a different
central configuration file /etc/php5/$SAPI/php.ini.
Additionally, each SAPI is configured with the compile-time option
--with-config-file-scan-dir=/etc/php5/$SAPI/conf.d
which for all SAPI's is actually a symlink pointing to a central
directory /etc/php5/conf.d. Any file found in this directory ending
in .ini will be treated as a configuration file by the php SAPI.
The rationale with this method is that each SAPI can thus be
identically configured with a minimal amount of conffile handling,
but at the same time if you want to have SAPI-specific configuration,
you can just remove the symlink.
sean finney <seanius@debian.org> Thu, 19 Oct 2006 23:33:05 +0200
Timezone data from system timezone database
---------------------------------------------------------------------
Debian PHP has been patched to use of the system wide timezone database
from the tzdata package, making sure any updates there are automatically
used by PHP aswell.
Note that this requires that the PHP process has access to /etc/localtime
and /usr/share/zoneinfo. For any regular installation this should be the
case, but in specific secured environments when reading the timezone
database is impossible PHP will give a "Timezone database is corrupt -
this should *never* happen!" error.
Thijs Kinkhorst <thijs@debian.org> Wed, 23 Jul 2008 17:42:06 +0200
Further documentation, errata, etc
---------------------------------------------------------------------
Errata and other general information about PHP in Debian can be found
in the debian wiki at:
http://wiki.debian.org/PHP
If after reading the documentation in this file you still have unanswered
questions, that's a good next place to go.
sean finney <seanius@debian.org> Thu, 19 Oct 2006 22:57:52 +0200
|