<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GIS and Web Tricks &#187; PHP</title>
	<atom:link href="http://www.bernawebdesign.ch/byteblog/tagged/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bernawebdesign.ch/byteblog</link>
	<description>Thougts and tricks on GIS, web development and FOSS</description>
	<lastBuildDate>Tue, 31 Jan 2012 23:52:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Custom PHP 5.3.1 with APC and XDEBUG on (Dreamhost) Shared Host</title>
		<link>http://www.bernawebdesign.ch/byteblog/2010/02/17/custom-php-5-3-1-with-apc-and-xdebug-on-dreamhost-shared-hosting/</link>
		<comments>http://www.bernawebdesign.ch/byteblog/2010/02/17/custom-php-5-3-1-with-apc-and-xdebug-on-dreamhost-shared-hosting/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 09:35:38 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[custom php]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://www.bernawebdesign.ch/byteblog/?p=116</guid>
		<description><![CDATA[I&#8217;ve recently been setting up my new dreamhost for symfony projects deployment and the only thing the default PHP is missing is the support for APC (alternate php cache). So after looking at the dreamhost wiki I cleaned up and added some features to the one of the install scripts. Here it is for your/mine [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been setting up my new dreamhost for symfony projects deployment and the only thing the default PHP is missing is the support for APC (alternate php cache). <span id="more-116"></span>So after looking at the <a href="http://wiki.dreamhost.com/index.php/Installing_PHP5">dreamhost wiki</a> I cleaned up and added some features to the <a href="http://wiki.dreamhost.com/index.php/Installing_PHP5#Improved_script_for_a_minimal_PHP_5.3.x_install_with_APC">one of the install scripts</a>. Here it is for your/mine (future) commodity.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># update 16.2.2010 </span>
<span style="color: #666666; font-style: italic;"># @author Marco Bernasocchi &lt;marco@bernawebdesign.ch&gt;</span>
<span style="color: #666666; font-style: italic;"># - Added OPENSSL LIBMCRYPT LIBTOOL and a promt for installing XDEBUG</span>
<span style="color: #666666; font-style: italic;">#   (still uses XDEBUG 2.05, which has basic PHP 5.3.1 support. 2.1.0 is on its way)</span>
<span style="color: #666666; font-style: italic;"># - removed unsupported php configure switches</span>
<span style="color: #666666; font-style: italic;"># - disabled --with-xsl, if you want to use it you'll probably need to install</span>
<span style="color: #666666; font-style: italic;">#   libxslt (http://xmlsoft.org/XSLT/) version 1.1.0 or greater.</span>
<span style="color: #666666; font-style: italic;"># - sets the ini files into the install directory instead than on cgi-bin</span>
<span style="color: #666666; font-style: italic;"># - to add more domains just copy the cgi binary to the new domain</span>
<span style="color: #666666; font-style: italic;">#   cp &quot;$PHP_BIN_DIR/php-cgi&quot; &quot;$NEW_CGI_BIN_DIR/php.cgi&quot; and modifiy the .htaccess</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Script for a minimal PHP 5.3.x install with APC</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#- Prompts for the domain to build for</span>
<span style="color: #666666; font-style: italic;">#- PHP configure line contains only valid PHP5 options</span>
<span style="color: #666666; font-style: italic;">#- Displays colourful status messages</span>
<span style="color: #666666; font-style: italic;">#- Many build messages, which aren't helpful to most people, are now suppressed</span>
<span style="color: #666666; font-style: italic;">#- Procedurised, making it cleaner and easier to follow</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#The only things you may want to change in here are marked with &quot;@todo&quot;s</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#Derived form the original PHP 5.3 install script at</span>
<span style="color: #666666; font-style: italic;">#http://wiki.dreamhost.com/Installing_PHP5</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#@author Dan Bettles &lt;dan@danbettles.net&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Exit on error</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">-e</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">clear</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Enter the domain for which you want to build PHP and press [ENTER]: &quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> DOMAIN
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Enable XDEBUG (y|n): &quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> ENABLEXDEBUG
&nbsp;
<span style="color: #666666; font-style: italic;">#===============================================================================</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@todo Update versions, if necessary</span>
<span style="color: #007800;">M4</span>=<span style="color: #ff0000;">&quot;m4-1.4.13&quot;</span>
<span style="color: #007800;">AUTOCONF</span>=<span style="color: #ff0000;">&quot;autoconf-2.65&quot;</span>
<span style="color: #007800;">OPENSSL</span>=<span style="color: #ff0000;">&quot;openssl-0.9.8l&quot;</span>   
<span style="color: #007800;">CURL</span>=<span style="color: #ff0000;">&quot;curl-7.20.0&quot;</span>
<span style="color: #007800;">LIBMCRYPT</span>=<span style="color: #ff0000;">&quot;libmcrypt-2.5.8&quot;</span>
<span style="color: #007800;">LIBTOOL</span>=<span style="color: #ff0000;">&quot;libtool-2.2.6b&quot;</span>
<span style="color: #007800;">PHP</span>=<span style="color: #ff0000;">&quot;php-5.3.1&quot;</span>
<span style="color: #007800;">APC</span>=<span style="color: #ff0000;">&quot;APC-3.1.3p1&quot;</span>
<span style="color: #007800;">XDEBUG</span>=<span style="color: #ff0000;">&quot;xdebug-2.0.5&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@todo Update install paths, if necessary</span>
<span style="color: #007800;">WEB_ROOT</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/<span style="color: #007800;">$DOMAIN</span>/web&quot;</span>
<span style="color: #007800;">CGI_BIN_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$WEB_ROOT</span>/cgi-bin&quot;</span>
<span style="color: #007800;">HTACCESS</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$WEB_ROOT</span>/.htaccess&quot;</span>
&nbsp;
<span style="color: #007800;">INSTALL_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/mycompiles&quot;</span>
<span style="color: #007800;">BUILD_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$INSTALL_DIR</span>/build&quot;</span>
<span style="color: #007800;">DOWNLOADS_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$INSTALL_DIR</span>/downloads&quot;</span>
<span style="color: #007800;">PHP_BASE_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$INSTALL_DIR</span>/<span style="color: #007800;">$PHP</span>&quot;</span>
<span style="color: #007800;">PHP_BIN_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$PHP_BASE_DIR</span>/bin&quot;</span>
<span style="color: #007800;">PHP_EXTENSIONS_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$PHP_BASE_DIR</span>/extensions&quot;</span>
<span style="color: #007800;">PHP_CONFIG_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$PHP_BASE_DIR</span>/etc/php5/config&quot;</span>
<span style="color: #007800;">PHP_INI</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$PHP_CONFIG_DIR</span>/php.ini&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@todo Alter features, if necessary</span>
<span style="color: #007800;">PHP_FEATURES</span>=<span style="color: #ff0000;">&quot;--prefix=<span style="color: #007800;">$PHP_BASE_DIR</span> <span style="color: #000099; font-weight: bold;">\
</span> --with-config-file-path=<span style="color: #007800;">$PHP_CONFIG_DIR</span> <span style="color: #000099; font-weight: bold;">\
</span> --with-config-file-scan-dir=<span style="color: #007800;">$PHP_CONFIG_DIR</span> <span style="color: #000099; font-weight: bold;">\
</span> --bindir=<span style="color: #007800;">$PHP_BIN_DIR</span> <span style="color: #000099; font-weight: bold;">\
</span> --enable-zip <span style="color: #000099; font-weight: bold;">\
</span> --with-xmlrpc <span style="color: #000099; font-weight: bold;">\
</span> --with-freetype-dir=/usr <span style="color: #000099; font-weight: bold;">\
</span> --with-zlib-dir=/usr <span style="color: #000099; font-weight: bold;">\
</span> --with-jpeg-dir=/usr <span style="color: #000099; font-weight: bold;">\
</span> --with-png-dir=/usr <span style="color: #000099; font-weight: bold;">\
</span> --with-curl=<span style="color: #007800;">$PHP_BASE_DIR</span> <span style="color: #000099; font-weight: bold;">\
</span> --with-gd <span style="color: #000099; font-weight: bold;">\
</span> --enable-gd-native-ttf <span style="color: #000099; font-weight: bold;">\
</span> --enable-ftp <span style="color: #000099; font-weight: bold;">\
</span> --enable-exif <span style="color: #000099; font-weight: bold;">\
</span> --enable-sockets <span style="color: #000099; font-weight: bold;">\
</span> --enable-wddx <span style="color: #000099; font-weight: bold;">\
</span> --enable-sqlite-utf8 <span style="color: #000099; font-weight: bold;">\
</span> --enable-calendar <span style="color: #000099; font-weight: bold;">\
</span> --enable-mbstring <span style="color: #000099; font-weight: bold;">\
</span> --enable-mbregex <span style="color: #000099; font-weight: bold;">\
</span> --enable-bcmath <span style="color: #000099; font-weight: bold;">\
</span> --with-mysql=/usr <span style="color: #000099; font-weight: bold;">\
</span> --with-mysqli <span style="color: #000099; font-weight: bold;">\
</span> --without-pear <span style="color: #000099; font-weight: bold;">\
</span> --with-gettext <span style="color: #000099; font-weight: bold;">\
</span> --with-pdo-mysql <span style="color: #000099; font-weight: bold;">\
</span> --with-openssl=<span style="color: #007800;">$PHP_BASE_DIR</span> <span style="color: #000099; font-weight: bold;">\
</span> #--with-xsl=$=<span style="color: #007800;">$PHP_BASE_DIR</span> <span style="color: #000099; font-weight: bold;">\
</span> --with-mcrypt=<span style="color: #007800;">$PHP_BASE_DIR</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#===============================================================================</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@param string $1 Message</span>
<span style="color: #000000; font-weight: bold;">function</span> echoL1 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>\033[1;37;44m$1\033[0;0;0m<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@param string $1 Message</span>
<span style="color: #000000; font-weight: bold;">function</span> echoL2 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>\033[0;37;44m$1\033[0;0;0m<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@param string $1 URL</span>
<span style="color: #666666; font-style: italic;">#@param string $2 Output directory</span>
<span style="color: #000000; font-weight: bold;">function</span> downloadTo <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-c</span> <span style="color: #007800;">$1</span> <span style="color: #660033;">--directory-prefix</span>=<span style="color: #007800;">$2</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@param string $1 TAR filename</span>
<span style="color: #666666; font-style: italic;">#@param string $2 Output directory</span>
<span style="color: #000000; font-weight: bold;">function</span> untarTo <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$2</span>
    <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzf</span> <span style="color: #007800;">$1</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> -
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@param string $1 Source directory</span>
<span style="color: #666666; font-style: italic;">#@param string $2 Output directory</span>
<span style="color: #666666; font-style: italic;">#@param string $3 configure arguments</span>
<span style="color: #000000; font-weight: bold;">function</span> configureAndMake <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$1</span>
    <span style="color: #007800;">COMMAND</span>=<span style="color: #ff0000;">&quot;./configure --quiet --prefix=$2 $3&quot;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$1</span> = <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$OPENSSL</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #666666; font-style: italic;">#special command for OPEN SSL</span>
      <span style="color: #007800;">COMMAND</span>=<span style="color: #ff0000;">&quot;./config --prefix=$2 $3&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COMMAND</span>&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #007800;">$COMMAND</span>
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">--quiet</span> 
    <span style="color: #7a0874; font-weight: bold;">cd</span> -
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@param string $1 Source directory</span>
<span style="color: #666666; font-style: italic;">#@param string $2 Output directory</span>
<span style="color: #666666; font-style: italic;">#@param string $3 configure arguments</span>
<span style="color: #000000; font-weight: bold;">function</span> makeAndInstall <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    configureAndMake <span style="color: #007800;">$1</span> <span style="color: #007800;">$2</span> <span style="color: #ff0000;">&quot;$3&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$1</span>
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--quiet</span> 
    <span style="color: #7a0874; font-weight: bold;">cd</span> -
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@param string $1 Directory</span>
<span style="color: #000000; font-weight: bold;">function</span> mkdirClean <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #007800;">$1</span>
    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#@param string $1 Message</span>
<span style="color: #000000; font-weight: bold;">function</span> echoWarning <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>\033[1;37;41m$1\033[0;0;0m<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$PATH</span>:<span style="color: #007800;">$PHP_BIN_DIR</span>&quot;</span>
&nbsp;
echoL1 <span style="color: #ff0000;">&quot;-&gt; DOWNLOADING...&quot;</span>
&nbsp;
mkdirClean <span style="color: #007800;">$BUILD_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Downloading <span style="color: #007800;">$M4</span>...&quot;</span>
downloadTo <span style="color: #ff0000;">&quot;http://ftp.gnu.org/gnu/m4/<span style="color: #007800;">$M4</span>.tar.gz&quot;</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
untarTo <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DOWNLOADS_DIR</span>/<span style="color: #007800;">$M4</span>.tar.gz&quot;</span> <span style="color: #007800;">$BUILD_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Downloading <span style="color: #007800;">$AUTOCONF</span>...&quot;</span>
downloadTo <span style="color: #ff0000;">&quot;http://ftp.gnu.org/gnu/autoconf/<span style="color: #007800;">$AUTOCONF</span>.tar.gz&quot;</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
untarTo <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DOWNLOADS_DIR</span>/<span style="color: #007800;">$AUTOCONF</span>.tar.gz&quot;</span> <span style="color: #007800;">$BUILD_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Downloading <span style="color: #007800;">$OPENSSL</span>...&quot;</span>
downloadTo <span style="color: #ff0000;">&quot;http://www.openssl.org/source/<span style="color: #007800;">$OPENSSL</span>.tar.gz&quot;</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
untarTo <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DOWNLOADS_DIR</span>/<span style="color: #007800;">$OPENSSL</span>.tar.gz&quot;</span> <span style="color: #007800;">$BUILD_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Downloading <span style="color: #007800;">$CURL</span>...&quot;</span>
downloadTo <span style="color: #ff0000;">&quot;http://curl.haxx.se/download/<span style="color: #007800;">$CURL</span>.tar.gz&quot;</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
untarTo <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DOWNLOADS_DIR</span>/<span style="color: #007800;">$CURL</span>.tar.gz&quot;</span> <span style="color: #007800;">$BUILD_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Downloading <span style="color: #007800;">$LIBMCRYPT</span>...&quot;</span>
downloadTo <span style="color: #ff0000;">&quot;http://easynews.dl.sourceforge.net/sourceforge/mcrypt/<span style="color: #007800;">$LIBMCRYPT</span>.tar.gz&quot;</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
untarTo <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DOWNLOADS_DIR</span>/<span style="color: #007800;">$LIBMCRYPT</span>.tar.gz&quot;</span> <span style="color: #007800;">$BUILD_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Downloading <span style="color: #007800;">$LIBTOOL</span>...&quot;</span>
downloadTo <span style="color: #ff0000;">&quot;http://ftp.gnu.org/gnu/libtool/<span style="color: #007800;">$LIBTOOL</span>.tar.gz&quot;</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
untarTo <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DOWNLOADS_DIR</span>/<span style="color: #007800;">$LIBTOOL</span>.tar.gz&quot;</span> <span style="color: #007800;">$BUILD_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Downloading <span style="color: #007800;">$PHP</span>...&quot;</span>
downloadTo <span style="color: #ff0000;">&quot;http://www.php.net/get/<span style="color: #007800;">$PHP</span>.tar.gz/from/this/mirror&quot;</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
untarTo <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DOWNLOADS_DIR</span>/<span style="color: #007800;">$PHP</span>.tar.gz&quot;</span> <span style="color: #007800;">$BUILD_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Downloading <span style="color: #007800;">$APC</span>...&quot;</span>
downloadTo <span style="color: #ff0000;">&quot;http://pecl.php.net/get/<span style="color: #007800;">$APC</span>.tgz&quot;</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
untarTo <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DOWNLOADS_DIR</span>/<span style="color: #007800;">$APC</span>.tgz&quot;</span> <span style="color: #007800;">$BUILD_DIR</span> 
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$ENABLEXDEBUG</span> = <span style="color: #ff0000;">&quot;y&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  echoL2 <span style="color: #ff0000;">&quot;--&gt; Downloading <span style="color: #007800;">$XDEBUG</span>...&quot;</span>
  downloadTo <span style="color: #ff0000;">&quot;http://xdebug.org/files/<span style="color: #007800;">$XDEBUG</span>.tgz&quot;</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
  untarTo <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DOWNLOADS_DIR</span>/<span style="color: #007800;">$XDEBUG</span>.tgz&quot;</span> <span style="color: #007800;">$BUILD_DIR</span> 
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span>
&nbsp;
echoL1 <span style="color: #ff0000;">&quot;-&gt; BUILDING...&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$PHP_BASE_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Building <span style="color: #007800;">$M4</span>...&quot;</span>
makeAndInstall <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$M4</span>&quot;</span> <span style="color: #007800;">$PHP_BASE_DIR</span>
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Building <span style="color: #007800;">$AUTOCONF</span>...&quot;</span>
makeAndInstall <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$AUTOCONF</span>&quot;</span> <span style="color: #007800;">$PHP_BASE_DIR</span>
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Building <span style="color: #007800;">$OPENSSL</span>...&quot;</span>
makeAndInstall <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$OPENSSL</span>&quot;</span> <span style="color: #007800;">$PHP_BASE_DIR</span>
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Building <span style="color: #007800;">$CURL</span>...&quot;</span>
makeAndInstall <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$CURL</span>&quot;</span> <span style="color: #007800;">$PHP_BASE_DIR</span> <span style="color: #ff0000;">&quot;--enable-ipv6 --enable-cookies<span style="color: #000099; font-weight: bold;">\
</span> --enable-crypto-auth --with-ssl&quot;</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Building <span style="color: #007800;">$LIBMCRYPT</span>...&quot;</span>
makeAndInstall <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$LIBMCRYPT</span>&quot;</span> <span style="color: #007800;">$PHP_BASE_DIR</span> <span style="color: #ff0000;">&quot;--disable-posix-threads&quot;</span>
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Building <span style="color: #007800;">$LIBTOOL</span>...&quot;</span>
makeAndInstall <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$LIBTOOL</span>&quot;</span> <span style="color: #007800;">$PHP_BASE_DIR</span> 
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Building <span style="color: #007800;">$PHP</span>...&quot;</span>
<span style="color: #666666; font-style: italic;">#Fixes compile error</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EXTRA_LIBS</span>=<span style="color: #ff0000;">&quot;-lresolv&quot;</span>
makeAndInstall <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$PHP</span>&quot;</span> <span style="color: #007800;">$PHP_BASE_DIR</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PHP_FEATURES</span>&quot;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span>
&nbsp;
echoL1 <span style="color: #ff0000;">&quot;-&gt; INSTALLING PHP...&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-m</span> 0755 <span style="color: #007800;">$CGI_BIN_DIR</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-m</span> 0755 <span style="color: #007800;">$PHP_CONFIG_DIR</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PHP_BIN_DIR</span>/php-cgi&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CGI_BIN_DIR</span>/php.cgi&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$PHP</span>/php.ini-production&quot;</span> <span style="color: #007800;">$PHP_INI</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$PHP_EXTENSIONS_DIR</span>
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Building <span style="color: #007800;">$APC</span>...&quot;</span>
<span style="color: #007800;">APC_SOURCE_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$APC</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$APC_SOURCE_DIR</span>
<span style="color: #007800;">$PHP_BIN_DIR</span><span style="color: #000000; font-weight: bold;">/</span>phpize
configureAndMake <span style="color: #007800;">$APC_SOURCE_DIR</span> <span style="color: #007800;">$PHP_BASE_DIR</span> <span style="color: #ff0000;">&quot;--enable-apc --enable-apc-mmap<span style="color: #000099; font-weight: bold;">\
</span> --with-php-config=<span style="color: #007800;">$PHP_BIN_DIR</span>/php-config&quot;</span> 
<span style="color: #c20cb9; font-weight: bold;">cp</span> modules<span style="color: #000000; font-weight: bold;">/</span>apc.so <span style="color: #007800;">$PHP_EXTENSIONS_DIR</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;extension=<span style="color: #007800;">$PHP_EXTENSIONS_DIR</span>/apc.so&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$PHP_CONFIG_DIR</span><span style="color: #000000; font-weight: bold;">/</span>apc.ini
<span style="color: #7a0874; font-weight: bold;">cd</span> -
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$ENABLEXDEBUG</span> = <span style="color: #ff0000;">&quot;y&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  echoL2 <span style="color: #ff0000;">&quot;--&gt; Building <span style="color: #007800;">$XDEBUG</span>...&quot;</span>
  <span style="color: #007800;">XDEBUG_SOURCE_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$BUILD_DIR</span>/<span style="color: #007800;">$XDEBUG</span>&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$XDEBUG_SOURCE_DIR</span>
  <span style="color: #007800;">$PHP_BIN_DIR</span><span style="color: #000000; font-weight: bold;">/</span>phpize
  configureAndMake <span style="color: #007800;">$XDEBUG_SOURCE_DIR</span> <span style="color: #007800;">$PHP_BASE_DIR</span> <span style="color: #ff0000;">&quot;--enable-xdebug<span style="color: #000099; font-weight: bold;">\
</span>   --with-php-config=<span style="color: #007800;">$PHP_BIN_DIR</span>/php-config&quot;</span> 
  <span style="color: #c20cb9; font-weight: bold;">cp</span> modules<span style="color: #000000; font-weight: bold;">/</span>xdebug.so <span style="color: #007800;">$PHP_EXTENSIONS_DIR</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;zend_extension=<span style="color: #007800;">$PHP_EXTENSIONS_DIR</span>/xdebug.so&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$PHP_CONFIG_DIR</span><span style="color: #000000; font-weight: bold;">/</span>xdebug.ini
  <span style="color: #7a0874; font-weight: bold;">cd</span> -
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;">#-------------------------------------------------------------------------------</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$HTACCESS</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">HTACCESS_NEW</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HTACCESS</span>.old&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$HTACCESS</span> <span style="color: #007800;">$HTACCESS_NEW</span>
    echoWarning <span style="color: #ff0000;">&quot;--&gt; Copied <span style="color: #007800;">$HTACCESS</span> to <span style="color: #007800;">$HTACCESS_NEW</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#The backslash prevents a newline being inserted at the start</span>
<span style="color: #007800;">HTACCESS_CONTENT</span>=<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\
</span>Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi
&nbsp;
#Deny access to the PHP CGI executable and config files
&lt;FilesMatch <span style="color: #000099; font-weight: bold;">\&quot;</span>^php5?\.(cgi|ini)$<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;
    Order Deny,Allow
    Deny from All
    Allow from env=REDIRECT_STATUS
&lt;/FilesMatch&gt;&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Preserve newlines in the content by quoting the variable name</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;#######ADDED BY installPHP script&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$HTACCESS</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$HTACCESS_CONTENT</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$HTACCESS</span>
&nbsp;
echoL2 <span style="color: #ff0000;">&quot;--&gt; Created <span style="color: #007800;">$PHP_INI</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #007800;">$BUILD_DIR</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Delete the downloads directory? (y/n): &quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> DELETE_DOWNLOADS_DIR
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$DELETE_DOWNLOADS_DIR</span> = <span style="color: #ff0000;">&quot;y&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #007800;">$DOWNLOADS_DIR</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
echoL1 <span style="color: #ff0000;">&quot;DONE&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bernawebdesign.ch/byteblog/2010/02/17/custom-php-5-3-1-with-apc-and-xdebug-on-dreamhost-shared-hosting/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

