-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathINSTALL.REDHAT
More file actions
222 lines (151 loc) · 7.97 KB
/
INSTALL.REDHAT
File metadata and controls
222 lines (151 loc) · 7.97 KB
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
Some notes for RedHat 5.x/6.x users
===================================
These instructions assume you want to use pre-built RPM's as much as
possible. There is nothing stopping you from grabbing the Apache and
PHP tarballs and working completely from sources. Simply follow the
instructions in the INSTALL file. But if you like having most things
under rpm control, read on.
*Warning* these instructions will not work with the stock Apache rpm
that comes with RedHat-6.1 due to a bug introduced by RedHat. If you
are using RH-6.1, make the following change before continuing:
On or around line 81 of your /usr/sbin/apxs file, you will see a
line like this:
my $CFG_LIBEXECDIR = 'modules'; # substituted via APACI install
Change this to be:
my $CFG_LIBEXECDIR = '/usr/lib/apache'; # substituted via APACI install
While you are looking at this file, make sure the $CFG_LD_SHLIB and
$CFG_LDFLAGS_SHLIB are set to something close to this:
my $CFG_LD_SHLIB = 'gcc'; # substituted via Makefile.tmpl
my $CFG_LDFLAGS_SHLIB = q(-shared); # substituted via Makefile.tmpl
If your /usr/sbin/apxs script has these lines along with the change to
the $CFG_LIBEXECDIR line, you are ready to proceed.
The first thing you need to do is upgrade your Apache to at least
version 1.3.6. You need the apache-1.3.6 rpm along with the apache-devel
RPM. RedHat-6.0 comes with apache-1.3.6, but by default it does not seem
to install the apache-devel rpm. Grab that one and install it as well.
While you are at it, upgrade to Apache-1.3.9 or later. There are a
number of fixes, and if you are running glibc-2.1.1 you will definitely
need it.
RedHat also has an annoying habit of not installing other -devel packages.
The one that gets the most people is freetype-devel. Save yourself some
trouble and grab the freetype-devel rpm and install it before configuring
PHP. You can check if you have it installed by typing:
rpm -q freetype-devel
You will also need the PHP tarball. The PHP rpm available from RedHat is
ok if you don't need database support or any of the other PHP add-ons. If
you do need to add your own set of features, download the latest PHP tarball
and follow the steps below:
Step 1: Remove old Apache packages, if older version is installed.
rpm -e apache
rpm -e apache-devel
Step 2: Install new Apache packages if necessary and any missing -devel packages
rpm -i apache-1.3.6-7.i386.rpm
rpm -i apache-devel-1.3.6-7.i386.rpm
rpm -i freetype-devel-1.2.6.i386.rpm
Step 3: Determine which PHP extensions you want to use
./configure --help
This will give you a list of all the available options. See
the "PHP Extensions" section of this file for specific instructions
on how to build in support for each extension.
Step 4: Build PHP
A typical configure line would look like this:
./configure --with-apxs=/usr/sbin/apxs --with-mysql --with-ldap
(note that you may need /usr/bin/apxs here - check where your apxs is)
(Add --with-xml if you are using Apache-1.3.9 or later)
Then type:
make
make install
The 'make install' step should produce something very similar to:
/usr/sbin/apxs -i -n php3 libphp3.so
cp libphp3.so /usr/lib/apache/libphp3.so
chmod 755 /usr/lib/apache/libphp3.so
At this point you just need to tell your server to load and activate
the php module. Your /etc/httpd/conf/httpd.conf and /etc/httpd/conf/srm.conf
files already have the appropriate lines in them to do this. You simply have
to uncomment them. Edit these two files and make sure the following lines
are uncommented:
in /etc/httpd/conf/httpd.conf:
LoadModule php3_module libexec/libphp3.so
AddModule mod_php3.c
And in /etc/httpd/conf/srm.conf:
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
(Uncommenting these lines means you need to remove the # character at
the beginning of each of these lines)
Once you have done this you need to restart your server with a command
like the following:
/etc/rc.d/init.d/httpd restart
NOTE: If you get an error at this point saying that the libphp3.so
file could not be found, it is likely because you are using
the RedHat rawhide apache-1.3.4 rpm. To fix it, type:
ln -s /usr/lib /etc/httpd
and then start your server with:
/etc/rc.d/init.d/httpd start
If you see something like this error:
"Cannot load /usr/modules/mod_env.so into server: /usr/modules/mod_env.so: cannot open shared object file: No such file or directory"
You need a link like this:
ln -s /usr/lib/apache /usr/modules
Apache and apxs don't always seem to agree on where to load the modules from, so
look at the error message and create the appropriate link.
Also, make sure you have both a LoadModule *and* and AddModule line for php. The
LoadModule line has to appear before the AddModule line, and it needs to be in the
same order with respect to the other AddModule lines as the LoadModule line. That
is, if your LoadModule line is the last of its kind, then the AddModule line needs
to be the same. The lines themselves should look something like:
LoadModule php3_module modules/libphp3.so
AddModule mod_php3.c
Also, doublecheck that you have a line like this in one of your .conf files:
AddType application/x-httpd-php3 .php3
You do not need to use the .php3 extension. Set this to whatever you like.
Whichever extension you choose here will be the one that tells Apache to feed
the file through the PHP parser.
Step 5: Test your setup
Create a file in your document root directory. I usually call
it info.php3 and in it put this single line:
<?phpinfo()?>
Then load it up in your browser:
http://your.machine/info.php3
You should see a nice summary page showing all sorts of information
about your setup. You probably shouldn't leave this file around on
a production server, but for debugging and general info during
development, it is very handy.
PHP Extensions
==============
In all cases, it is a good idea to remove the 'config.cache' when
trying to reconfigure PHP to include new options.
Package Suggested ./configure swicth
------- ----------------------------
GD <none>
You need the standard gd-devel RPM installed. PHP will automatically
detect it and include support for it if the gd-devel RPM has been
installed.
FreeType (libttf) <none>
You need to install the freetype and freetype-devel RPM's available
from any RedHatContrib mirror site. Once installed PHP will
automatically detect them and add TTF stuff. Note that you also need
GD support for TTF support to be activated.
ImageMagick -with-imagick
You need the bzip2 RPM along with the ImageMagick-devel-4.2.0-1 RPM
or later.
IMAP --with-imap
Get the latest imap-devel RPM from a RedHatContrib mirror site and
install it.
LDAP --with-ldap
Get the latest openldap-libs and openldap-devel RPM's from any
RedHatContrib mirror site.
mSQL --with-msql=/usr/lib/Hughes
Get the msql RPM from a RedHatContrib mirror
MySQL --with-mysql
Grab the latest rpm packages directly from http://www.tcx.se or a mirror.
You should get all three. MySQL, MySQL-client and MySQL-devel, but the
only package required in order to compile in MySQL support in PHP is the
MySQL-devel RPM.
PostgreSQL --with-pgsql
You need the postgresql-devel RPM
SNMP --with-snmp
You need the ucd-snmp-devel RPM
YP --with-yp
libnsl contains the functions for this one and should already be installed.
It is usually part of the glibc-devel RPM.
Zlib --with-zlib
You need the standard zlib-devel RPM (version >= 1.0.9) installed.