forked from php/web-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git.php
198 lines (169 loc) · 5.9 KB
/
git.php
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?php
$_SERVER['BASE_PAGE'] = 'git.php';
include_once __DIR__ . '/include/prepend.inc';
$SIDEBAR_DATA = '
<h3>What is Git?</h3>
<p>
You can find more information about Git and download clients for most major
platforms at <a href="http://git-scm.com/">the official Git site</a>.
</p>
<p>
The <a href="http://progit.org/">Pro Git book</a> may also be useful.
</p>
<h3>Contribute</h3>
<p>
If you would like to join PHP development or would like to
contribute to the PHP documentation, contact the relevant
group. You may want <a href="/git-php.php">your own Git account</a>
to contribute.
</p>
';
site_header("Git Access", ["current" => "community"]);
?>
<h1>Git Access</h1>
<p>
If you wish to get the latest PHP source tree, you can obtain it through Git.
You should be warned that the Git version is a development version, and as
such, is often unstable, and may not even compile properly. The advantage of
using Git, though, is that you can get the latest fixes and updates, without
having to wait for the official releases.
</p>
<p>
PHP uses an advanced configuration system that requires you to have
the following tools. re2c is only necessary for developers and can be found
<a href="http://re2c.org">here</a>.
All other utilities can be obtained from
<a href="ftp://ftp.gnu.org/pub/gnu/">the GNU FTP site</a>.
</p>
<ul>
<li><i>autoconf</i>:
<ul>
<li><i>PHP 5.4 - 7.1</i>: 2.59+</li>
<li><i>PHP 7.2</i>: 2.64+</li>
<li><i>PHP 7.3</i>: 2.68+</li>
</ul>
</li>
<li><i>libtool</i>: 1.4.x+ (except 1.4.2)</li>
<li><i>re2c</i>: 0.13.4+</li>
<li id="bison"><i>bison</i>:
<ul>
<li><i>PHP 5.4</i>: 1.28, 1.35, 1.75, 2.0 to 2.6.4</li>
<li><i>PHP 5.5 and 5.6</i>: 2.4 to 2.7</li>
<li><i>PHP 7.0 - 7.3</i>: 2.4+</li>
<li><i>PHP 7.4 - PHP 8.0</i>: 3.0.0+</li>
</ul>
</li>
</ul>
<p>
If you're experiencing problems, see also the section on
<a href="#buildconf_fail">buildconf failures</a>.
</p>
<h2>Steps for using PHP from Git</h2>
<ol>
<li>
You can retrieve the PHP source code from our
<a href="https://github.com/php/php-src.git">GitHub</a> with this
command:
<br><br>
<code>git clone https://github.com/php/php-src.git</code>
<br><br>
You can also download a snapshot from GitHub:<br><br>
<ul>
<li>Go to the <a href="https://github.com/php/php-src">php-src project page</a>.</li>
<li>Select the branch you're interested in from the branch dropdown.</li>
<li>Click on the <strong>Download ZIP</strong> button.</li>
</ul>
</li>
<li>
Make sure you're in the right directory to work on PHP:
<br><br>
<code>cd php-src</code>
<br><br>
</li>
<li>
You can then check out the branch you want to build, for example:
<br><br>
<strong>PHP 7.4</strong>:
<code>git checkout PHP-7.4</code>
<br>
<strong>PHP 8.0</strong>:
<code>git checkout PHP-8.0</code>
<br>
<strong>PHP 8.1</strong>:
<code>git checkout PHP-8.1</code>
<br>
<strong>PHP 8.2</strong>:
<code>git checkout PHP-8.2</code>
<br>
<strong>PHP HEAD</strong>:
<code>git checkout master</code>
<br><br>
</li>
<li>
<div class="tip" style="margin: 10px 0 10px 20px;">
<p>Note that certain combinations of autoconf and libtool may not
work when used together, particularly with historical versions of PHP. See
<a href="#buildconf_fail">below</a> for details.<br>
Also, certain versions of autoconf may generate warnings of <code>AC_PROG_CPP
called before AC_PROG_CC</code>. These messages can usually be ignored.</p>
</div>
</li>
<li>
Run <code>./buildconf</code> to generate the configure script. This may take several moments.
</li>
<li>
From this point onwards, installation is similar to the installation of one of
the official packages with one main difference – you will need
<a href="#bison">a version of bison that is supported for the PHP version you want to build</a>.
You may also require re2c if you intend to change any of the scanner and
parser files PHP uses.
</li>
</ol>
<p>
There are many other things, such as the XML source code
for the documentation, available via Git. See
<a href="https://github.com/php/">the web-based view of the Git
server</a> to see what is available.
</p>
<p>
The PHP Wiki has a useful
<a href="https://wiki.php.net/vcs/gitfaq">Git FAQ</a>, which provides useful
tips and cheatsheets for using the PHP Git repository, and if you want to
become involved in developing PHP, the
<a href="https://wiki.php.net/vcs/gitworkflow">Git Workflow</a> page is also
likely to be of interest.
</p>
<h2>PHP manual</h2>
<p>
The PHP manual is hosted on Git. To checkout the latest English version of the PHP
manual:<br>
<code>git clone https://github.com/php/doc-en.git ./phpdoc-en</code>
</p>
<h2>Historical issues</h2>
<h3 id="buildconf_fail">autoconf and libtool information for PHP 5.3 and below</h3>
<p>
There seem to be problems with libtool 1.4.2. It is suggested
that you use libtool 1.4, along with autoconf 2.13 and
automake 1.4. You should also ensure that autoconf, automake
and libtool are installed in the same directory. libtool 1.5
will not work.
</p>
<p>The following combinations are known to work with PHP 5.3 and below:</p>
<ul>
<li>autoconf 2.13, automake 1.4 and libtool 1.4.3</li>
<li>autoconf 2.13, automake 1.5 and libtool 1.4.3</li>
</ul>
<p>Since PHP 4.3 automake and its aclocal program are no longer needed to build PHP.</p>
<p>
If you have multiple versions of autoconf installed on your computer, as is
common for many UNIXes, you can set the PHP_AUTOCONF and PHP_AUTOHEADER
variables when running buildconf to indicate which versions it should use
e.g.:<br>
<code>PHP_AUTOCONF=autoconf213 PHP_AUTOHEADER=autoheader213 ./buildconf</code>
</p>
<h3 id="flex_fail">Zend/zend_language_scanner.c: No such file or directory</h3>
<p>
PHP only supports flex 2.5.4, <strong>not</strong> later versions as they broke backwards compatibility.
Please note that PHP 5.3 and later do not require flex at all.
</p>
<?php site_footer(); ?>