1 |
mabi 10/04/23 23:42:19 |
2 |
|
3 |
Added: php-guide.xml |
4 |
Log: |
5 |
first raw cut version of the php guide |
6 |
|
7 |
Revision Changes Path |
8 |
1.1 xml/htdocs/proj/en/php/php-guide.xml |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/php/php-guide.xml?rev=1.1&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/php/php-guide.xml?rev=1.1&content-type=text/plain |
12 |
|
13 |
Index: php-guide.xml |
14 |
=================================================================== |
15 |
<?xml version="1.0" encoding="UTF-8"?> |
16 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
17 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/php/php-guide.xml,v 1.1 2010/04/23 23:42:19 mabi Exp $ --> |
18 |
|
19 |
<guide link="php-guide.xml" lang="en"> |
20 |
<title>Upgrading PHP</title> |
21 |
|
22 |
<author title="Author"> |
23 |
<mail link="akorthaus@×××.de">Andreas Korthaus</mail> |
24 |
<mail link="mabi@g.o">Matti Bickel</mail> |
25 |
</author> |
26 |
|
27 |
<abstract> |
28 |
This document describes how PHP is set up in Gentoo. |
29 |
</abstract> |
30 |
|
31 |
|
32 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
33 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
34 |
<license/> |
35 |
|
36 |
<version>1.0</version> |
37 |
<date>2010-04-22</date> |
38 |
|
39 |
<chapter> |
40 |
<title>PHP package</title> |
41 |
<section> |
42 |
<title>Basic PHP Packages Consolidated</title> |
43 |
<body> |
44 |
|
45 |
<p> |
46 |
There is only one php package (as opposed to one package for each SAPI like |
47 |
cgi, cli or apache). You can enable the SAPIs you want via USE flags in |
48 |
<c>dev-lang/php</c>. A list of available SAPIs is included below. |
49 |
You can combine them as you wish, but obviously you need at least one of |
50 |
them to make any use of your php installation. |
51 |
</p> |
52 |
|
53 |
<p> |
54 |
To choose the SAPI you want, use these USE flags: |
55 |
</p> |
56 |
|
57 |
<ul> |
58 |
<li><c>cgi</c> - builds & installs <path>/usr/bin/php-cgi</path></li> |
59 |
<li><c>cli</c> - builds & installs <path>/usr/bin/php</path></li> |
60 |
<li><c>apache2</c> - builds & installs <c>mod_php</c> for Apache 2.0</li> |
61 |
</ul> |
62 |
|
63 |
<note> |
64 |
There are requests to add <c>fpm</c> as a SAPI. The Gentoo PHP team will |
65 |
support this as soon as the PHP project includes this SAPI in an upstream |
66 |
release of php (most likely php-5.4). |
67 |
</note> |
68 |
|
69 |
</body> |
70 |
</section> |
71 |
|
72 |
<section> |
73 |
<title>Portage Categories</title> |
74 |
<body> |
75 |
|
76 |
<p> |
77 |
The PHP package have been moved from <c>dev-php</c> to <c>dev-lang/php</c>. |
78 |
You can find PECL extensions and other packages depending on the version of PHP |
79 |
in the <c>dev-php5</c> category. All version independent packages can be found |
80 |
in the <c>dev-php</c> category. This was introduced to support the parallel use |
81 |
of PHP4 and PHP5 and will continue with a <c>dev-php6</c> category once the PHP |
82 |
project releases a new major version. |
83 |
</p> |
84 |
|
85 |
</body> |
86 |
</section> |
87 |
|
88 |
<section> |
89 |
<title>Directories and configuration files</title> |
90 |
<body> |
91 |
|
92 |
<ul> |
93 |
<li>The PHP package installs its contents into <path>/usr/lib/php5</path> |
94 |
(the Apache modules go into the right place for Apache).</li> |
95 |
<li>The PEAR packages and other PHP libraries go into <path>/usr/share/php</path> (was |
96 |
<path>/usr/lib/php</path> before).</li> |
97 |
<li>PECL packages will no longer add configuration directives by adding them |
98 |
to the <path>php.ini</path> configuration file, but add a |
99 |
<path>[PACKAGE].ini</path> file to the <path>/etc/php/[SAPI]/ext</path> |
100 |
directory.</li> |
101 |
</ul> |
102 |
|
103 |
</body> |
104 |
</section> |
105 |
|
106 |
<section> |
107 |
<title>Symlinking of PHP binaries</title> |
108 |
<body> |
109 |
|
110 |
<p> The PHP package will create symlinks in <path>/usr/bin</path> for the |
111 |
version of PHP you installed most recently. Currently, your choice is |
112 |
restricted to PHP major version 5. However, the Gentoo PHP team may |
113 |
allow a more fine grained slotting or introduce PHP6 to the tree. You |
114 |
can then <uri link="#doc_chap3_sect5">use the php-select tool</uri> |
115 |
from <c>app-admin/php-toolkit</c> to change the symlinks. </p> |
116 |
|
117 |
</body> |
118 |
</section> |
119 |
</chapter> |
120 |
|
121 |
|
122 |
<chapter> |
123 |
<title>Configuration</title> |
124 |
|
125 |
<section> |
126 |
<title>USE flags</title> |
127 |
<body> |
128 |
<p> |
129 |
For a list of recommended USE flags look at <uri |
130 |
link="http://overlays.gentoo.org/proj/php/wiki/CommonQuestions"> |
131 |
Recommend USE flags</uri>. For a list of USE flags available for |
132 |
PHP have a look at the <uri |
133 |
link="http://overlays.gentoo.org/proj/php/wiki/NewUseFlags">USE |
134 |
flags table</uri> from overlay wiki. |
135 |
</p> |
136 |
</body> |
137 |
</section> |
138 |
|
139 |
<section> |
140 |
<title>Configuration files</title> |
141 |
<body> |
142 |
|
143 |
<p> |
144 |
The Gentoo PHP Package stores configuration in <path>/etc/php</path>, which |
145 |
contains one subdirectory for each SAPI for each PHP version (only PHP5 for |
146 |
now): |
147 |
</p> |
148 |
|
149 |
<pre caption="list PHP config directories"> |
150 |
$ <i>ls -1 /etc/php</i> |
151 |
apache2-php5 |
152 |
cli-php5 |
153 |
cgi-php5 |
154 |
</pre> |
155 |
|
156 |
<p> Every subdirectory contains an own <path>php.ini</path>, but external |
157 |
(shared) extension are now kept in their own |
158 |
<path>/etc/php/{apach2,cli,cgi}-php5/ext</path> directory. To enable/ |
159 |
disable shared extensions, symlinks from <path>/etc/php/*/ext-active</path> |
160 |
are used. If you want to enable an extension, create a symlink in |
161 |
<path>/etc/php/*/ext-active</path> to the corresponding |
162 |
<path>[EXTENSION].ini</path> file in <path>/etc/php/*/ext/</path>. If you |
163 |
want to disable an extension, remove the symlink. </p> |
164 |
|
165 |
<note> If you install PHP as an Apache module, make sure to restart Apache |
166 |
after installation and configuration. </note> |
167 |
|
168 |
</body> |
169 |
</section> |
170 |
|
171 |
<section> |
172 |
<title>Configure Apache to work with PHP5</title> |
173 |
<body> |
174 |
|
175 |
<p> To configure Apache to load your PHP5 module (mod_php), you have to add |
176 |
<c>-D PHP5</c> to <c>APACHE2_OPTS</c> variable in |
177 |
<path>/etc/conf.d/apache2</path>. </p> |
178 |
|
179 |
<pre caption="Configure Apache to load mod_php"> |
180 |
<comment>(settings for PHP5)</comment> |
181 |
<i>APACHE2_OPTS="-D PHP5"</i> |
182 |
</pre> |
183 |
|
184 |
<note>You can not use two different PHP modules with Apache at the same time.</note> |
185 |
|
186 |
</body> |
187 |
</section> |
188 |
</chapter> |
189 |
|
190 |
<chapter> |
191 |
<title>Support / Getting Help</title> |
192 |
<section> |
193 |
<body> |
194 |
|
195 |
<p> If you run into problems with the new Gentoo PHP packages, here's where you |
196 |
can get help: </p> |
197 |
|
198 |
<ul> |
199 |
<li> |
200 |
<uri link="http://overlays.gentoo.org/proj/php/wiki/CommonQuestions">Common |
201 |
Questions</uri> about PHP on Gentoo |
202 |
</li> |
203 |
<li> |
204 |
<uri link="http://overlays.gentoo.org/proj/php/">Development-Page of the PHP |
205 |
Overlay</uri> |
206 |
</li> |
207 |
<li> |
208 |
#gentoo-php on irc.freenode.net; this is the chatroom where the overlay's |
209 |
regular authors hang out. We'd love to see you there! |
210 |
</li> |
211 |
<li> |
212 |
<uri link="http://forums.gentoo.org/">Gentoo Forums</uri> are a popular |
213 |
place to ask for help. There are plenty of other Gentoo users reading the |
214 |
Forums round the clock, making it a great place to get help in a hurry. |
215 |
</li> |
216 |
</ul> |
217 |
|
218 |
<p> On the <uri link="http://overlays.gentoo.org/proj/php/">Development-Page</uri> |
219 |
you'll find a lot of documentation and <uri |
220 |
link="http://git.overlays.gentoo.org/gitweb/?p=proj/php.git">our git |
221 |
repository</uri> provides a test ground for packages, which will be moved |
222 |
to the official Portage tree later. </p> |
223 |
|
224 |
</body> |
225 |
</section> |
226 |
</chapter> |
227 |
</guide> |