<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>blazt.com &#187; php recompilation</title>
	<atom:link href="http://merlyscaria.wordpress.com/category/php-recompilation/feed/" rel="self" type="application/rss+xml" />
	<link>http://merlyscaria.wordpress.com</link>
	<description></description>
	<lastBuildDate>Wed, 15 Jul 2009 05:33:42 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='merlyscaria.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/c31d1c09edbc8e5b7c0729dceed093df?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>blazt.com &#187; php recompilation</title>
		<link>http://merlyscaria.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://merlyscaria.wordpress.com/osd.xml" title="blazt.com" />
		<item>
		<title>php recompilation</title>
		<link>http://merlyscaria.wordpress.com/2008/05/01/php-recompilation/</link>
		<comments>http://merlyscaria.wordpress.com/2008/05/01/php-recompilation/#comments</comments>
		<pubDate>Thu, 01 May 2008 05:06:53 +0000</pubDate>
		<dc:creator>merly</dc:creator>
				<category><![CDATA[php recompilation]]></category>
		<category><![CDATA[complie php]]></category>
		<category><![CDATA[php compilation]]></category>
		<category><![CDATA[recompile php]]></category>

		<guid isPermaLink="false">http://merlyscaria.wordpress.com/?p=42</guid>
		<description><![CDATA[Before starting the installation, first you need to know what do you want to use PHP for. There are three main fields you can use PHP, as described in the What can PHP do?
* Websites and web applications (server-side scripting)
* Command line scripting
* Desktop (GUI) applications
For the first and most common form, you need three [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merlyscaria.wordpress.com&blog=2300345&post=42&subd=merlyscaria&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Before starting the installation, first you need to know what do you want to use PHP for. There are three main fields you can use PHP, as described in the What can PHP do?</p>
<p>* Websites and web applications (server-side scripting)<br />
* Command line scripting<br />
* Desktop (GUI) applications</p>
<p>For the first and most common form, you need three things: PHP itself, a web server and a web browser. You probably already have a web browser, and depending on your operating system setup, you may also have a web server (e.g. Apache on Linux and MacOS X; IIS on Windows). You may also rent webspace at a company. This way, you don&#8217;t need to set up anything on your own, only write your PHP scripts, upload it to the server you rent, and see the results in your browser.</p>
<p>In case of setting up the server and PHP on your own, you have two choices for the method of connecting PHP to the server. For many servers PHP has a direct module interface (also called SAPI). These servers include Apache, Microsoft Internet Information Server, Netscape and iPlanet servers. Many other servers have support for ISAPI, the Microsoft module interface (OmniHTTPd for example). If PHP has no module support for your web server, you can always use it as a CGI or FastCGI processor. This means you set up your server to use the CGI executable of PHP to process all PHP file requests on the server.</p>
<p>If you are also interested to use PHP for command line scripting (e.g. write scripts autogenerating some images for you offline, or processing text files depending on some arguments you pass to them), you always need the command line executable.<br />
Installation on Unix systems</p>
<p>Installation Instructions (Apache Shared Module Version) for PHP</p>
<p>1.  gunzip apache_xxx.tar.gz<br />
2.  tar -xvf apache_xxx.tar<br />
3.  gunzip php-xxx.tar.gz<br />
4.  tar -xvf php-xxx.tar<br />
5.  cd apache_xxx<br />
6.  ./configure &#8211;prefix=/www &#8211;enable-module=so<br />
7.  make<br />
8.  make install<br />
9.  cd ../php-xxx</p>
<p>10. Now, configure your PHP.  This is where you customize your PHP<br />
with various options, like which extensions will be enabled.  Do a<br />
./configure &#8211;help for a list of available options.  In our example<br />
we&#8217;ll do a simple configure with Apache 1 and MySQL support.  Your<br />
path to apxs may differ from our example.</p>
<p>./configure &#8211;with-mysql &#8211;with-apxs=/www/bin/apxs</p>
<p>11. make<br />
12. make install</p>
<p>If you decide to change your configure options after installation,<br />
you only need to repeat the last three steps. You only need to<br />
restart apache for the new module to take effect. A recompile of<br />
Apache is not needed.</p>
<p>Note that unless told otherwise, &#8216;make install&#8217; will also install PEAR,<br />
various PHP tools such as phpize, install the PHP CLI, and more.</p>
<p>13. Setup your php.ini file:</p>
<p>cp php.ini-dist /usr/local/lib/php.ini</p>
<p>You may edit your .ini file to set PHP options.  If you prefer your<br />
php.ini in another location, use &#8211;with-config-file-path=/some/path in<br />
step 10.</p>
<p>If you instead choose php.ini-recommended, be certain to read the list<br />
of changes within, as they affect how PHP behaves.</p>
<p>14. Edit your httpd.conf to load the PHP module.  The path on the right hand<br />
side of the LoadModule statement must point to the path of the PHP<br />
module on your system.  The make install from above may have already<br />
added this for you, but be sure to check.</p>
<p>For PHP 4:</p>
<p>LoadModule php4_module libexec/libphp4.so</p>
<p>For PHP 5:</p>
<p>LoadModule php5_module libexec/libphp5.so</p>
<p>15. And in the AddModule section of httpd.conf, somewhere under the<br />
ClearModuleList, add this:</p>
<p>For PHP 4:</p>
<p>AddModule mod_php4.c</p>
<p>For PHP 5:</p>
<p>AddModule mod_php5.c</p>
<p>16. Tell Apache to parse certain extensions as PHP.  For example,<br />
let&#8217;s have Apache parse the .php extension as PHP.  You could<br />
have any extension(s) parse as PHP by simply adding more, with<br />
each separated by a space.  We&#8217;ll add .phtml to demonstrate.</p>
<p>AddType application/x-httpd-php .php .phtml</p>
<p>It&#8217;s also common to setup the .phps extension to show highlighted PHP<br />
source, this can be done with:</p>
<p>AddType application/x-httpd-php-source .phps</p>
<p>17. Use your normal procedure for starting the Apache server. (You must<br />
stop and restart the server, not just cause the server to reload by<br />
using a HUP or USR1 signal.)</p>
<p>Installation Instructions (Static Module Installation for Apache) for PHP</p>
<p>1.  gunzip -c apache_1.3.x.tar.gz | tar xf -<br />
2.  cd apache_1.3.x<br />
3.  ./configure<br />
4.  cd ..</p>
<p>5.  gunzip -c php-5.x.y.tar.gz | tar xf -<br />
6.  cd php-5.x.y<br />
7.  ./configure &#8211;with-mysql &#8211;with-apache=../apache_1.3.x<br />
8.  make<br />
9.  make install</p>
<p>10. cd ../apache_1.3.x</p>
<p>11. ./configure &#8211;prefix=/www &#8211;activate-module=src/modules/php5/libphp5.a<br />
(The above line is correct! Yes, we know libphp5.a does not exist at this<br />
stage. It isn&#8217;t supposed to. It will be created.)</p>
<p>12. make<br />
(you should now have an httpd binary which you can copy to your Apache bin dir if<br />
it is your first install then you need to &#8220;make install&#8221; as well)</p>
<p>13. cd ../php-5.x.y<br />
14. cp php.ini-dist /usr/local/lib/php.ini</p>
<p>15. You can edit /usr/local/lib/php.ini file to set PHP options.<br />
Edit your httpd.conf or srm.conf file and add:<br />
AddType application/x-httpd-php .php</p>
<p>commands for restarting Apache</p>
<p>1. Several Linux and SysV variants:<br />
/etc/rc.d/init.d/httpd restart</p>
<p>2. Using apachectl scripts:<br />
/path/to/apachectl stop<br />
/path/to/apachectl start</p>
<p>3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl:<br />
/path/to/httpsdctl stop<br />
/path/to/httpsdctl start</p>
<p>4. Using mod_ssl, or another SSL server, you may want to manually<br />
stop and start:<br />
/path/to/apachectl stop<br />
/path/to/apachectl startssl</p>
<p>Different examples of compiling PHP for apache are as follows:</p>
<p>./configure &#8211;with-apxs &#8211;with-pgsql</p>
<p>This will create a libphp5.so (or<br />
libphp4.so in PHP 4) shared library that is loaded<br />
into Apache using a LoadModule line in Apache&#8217;s httpd.conf file. The<br />
PostgreSQL support is embedded into this library.</p>
<p>./configure &#8211;with-apxs &#8211;with-pgsql=shared</p>
<p>This will create a libphp4.so shared<br />
library for Apache, but it will also create a<br />
pgsql.so shared library that is loaded into<br />
PHP either by using the extension directive in<br />
php.ini file or by loading it explicitly in<br />
a script using the dl() function.</p>
<p>./configure &#8211;with-apache=/path/to/apache_source &#8211;with-pgsql</p>
<p>This will create a libmodphp5.a library, a mod_php5.c and some accompanying files and copy this into the src/modules/php5 directory in the Apache source tree. Then you compile Apache using &#8211;activate-module=src/modules/php5/libphp5.a and the Apache build system will create libphp5.a and link it statically into the httpd binary (replace php5 by php4 in PHP 4). The PostgreSQL support is included directly into this httpd binary, so the final result here is a single httpd binary that includes all of Apache and all of PHP.</p>
<p>./configure &#8211;with-apache=/path/to/apache_source &#8211;with-pgsql=shared</p>
<p>Note: Apache&#8217;s default httpd.conf currently ships with a section that looks like this:</p>
<p>User nobody<br />
Group &#8220;#-1&#8243;</p>
<p>Unless you change that to &#8220;Group nogroup&#8221; or something like that (&#8220;Group daemon&#8221; is<br />
also very common) PHP will not be able to open files.</p>
<p>Note:</p>
<p>Make sure you specify the installed version of apxs when using<br />
&#8211;with-apxs=/path/to/apxs.<br />
You must NOT use the apxs version that is in the apache sources but the one<br />
that is actually installed on your system.</p>
<p>Installation Instructions (Apache 2 Shared Module Version)</p>
<p>1.  gzip -d httpd-2_0_NN.tar.gz<br />
2.  tar xvf httpd-2_0_NN.tar<br />
3.  gunzip php-NN.tar.gz<br />
4.  tar -xvf php-NN.tar<br />
5.  cd httpd-2_0_NN<br />
6.  ./configure &#8211;enable-so<br />
7.  make<br />
8.  make install</p>
<p>Now you have Apache 2.0.NN available under /usr/local/apache2,<br />
configured with loadable module support and the standard MPM prefork.<br />
To test the installation use your normal procedure for starting<br />
the Apache server, e.g.:<br />
/usr/local/apache2/bin/apachectl start<br />
and stop the server to go on with the configuration for PHP:<br />
/usr/local/apache2/bin/apachectl stop.</p>
<p>9.  cd ../php-NN</p>
<p>10. Now, configure your PHP.  This is where you customize your PHP<br />
with various options, like which extensions will be enabled.  Do a<br />
./configure &#8211;help for a list of available options.  In our example<br />
we&#8217;ll do a simple configure with Apache 2 and MySQL support.  Your<br />
path to apxs may differ, in fact, the binary may even be named apxs2 on<br />
your system.</p>
<p>./configure &#8211;with-apxs2=/usr/local/apache2/bin/apxs &#8211;with-mysql</p>
<p>11. make<br />
12. make install</p>
<p>If you decide to change your configure options after installation,<br />
you only need to repeat the last three steps. You only need to<br />
restart apache for the new module to take effect. A recompile of<br />
Apache is not needed.</p>
<p>Note that unless told otherwise, &#8216;make install&#8217; will also install PEAR,<br />
various PHP tools such as phpize, install the PHP CLI, and more.</p>
<p>13. Setup your php.ini</p>
<p>cp php.ini-dist /usr/local/lib/php.ini</p>
<p>You may edit your .ini file to set PHP options.  If you prefer having<br />
php.ini in another location, use &#8211;with-config-file-path=/some/path in<br />
step 10.</p>
<p>If you instead choose php.ini-recommended, be certain to read the list<br />
of changes within, as they affect how PHP behaves.</p>
<p>14. Edit your httpd.conf to load the PHP module.  The path on the right hand<br />
side of the LoadModule statement must point to the path of the PHP<br />
module on your system.  The make install from above may have already<br />
added this for you, but be sure to check.</p>
<p>For PHP 4:</p>
<p>LoadModule php4_module modules/libphp4.so</p>
<p>For PHP 5:</p>
<p>LoadModule php5_module modules/libphp5.so</p>
<p>15. Tell Apache to parse certain extensions as PHP.  For example,<br />
let&#8217;s have Apache parse the .php extension as PHP.  You could<br />
have any extension(s) parse as PHP by simply adding more, with<br />
each separated by a space.  We&#8217;ll add .phtml to demonstrate.</p>
<p>AddType application/x-httpd-php .php .phtml</p>
<p>It&#8217;s also common to setup the .phps extension to show highlighted PHP<br />
source, this can be done with:</p>
<p>AddType application/x-httpd-php-source .phps</p>
<p>16. Use your normal procedure for starting the Apache server, e.g.:</p>
<p>/usr/local/apache2/bin/apachectl start</p>
<p>Apache 2.0 on Unix systems</p>
<p>If you install PHP as an Apache module, you can consider the following. Instead of adding:<br />
application/x-httpd-php php<br />
application/x-httpd-php-source phps<br />
into Apache mime.types, you can add:<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
into Apache httpd.conf, OR you can add:<br />
AddHandler application/x-httpd-php .php<br />
AddHandler application/x-httpd-php-source .phps<br />
into Apache httpd.conf. The last one is the preferred way of configuration, but it does not work in previous Apache versions.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/merlyscaria.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/merlyscaria.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/merlyscaria.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/merlyscaria.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/merlyscaria.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/merlyscaria.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/merlyscaria.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/merlyscaria.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/merlyscaria.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/merlyscaria.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/merlyscaria.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/merlyscaria.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=merlyscaria.wordpress.com&blog=2300345&post=42&subd=merlyscaria&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://merlyscaria.wordpress.com/2008/05/01/php-recompilation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669e31be3d236b5be22af924547d7b5a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">merly</media:title>
		</media:content>
	</item>
	</channel>
</rss>