<?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>The Netocracy &#187; php</title>
	<atom:link href="http://www.thenetocracy.com/tags/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thenetocracy.com</link>
	<description>Liberty Prime is go</description>
	<lastBuildDate>Mon, 21 Dec 2009 07:01:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing PHP5.3 beta on Ubuntu 8.10</title>
		<link>http://www.thenetocracy.com/2009/03/06/installing-php53-beta-on-ubuntu-810/</link>
		<comments>http://www.thenetocracy.com/2009/03/06/installing-php53-beta-on-ubuntu-810/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 12:38:55 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5.3]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.thenetocracy.com/?p=69</guid>
		<description><![CDATA[I wanted to try out the new feature available in PHP 5.3 a while ago. And ran into a few obstacles trying get it installed. Since then I&#8217;ve installed it a few times successfully. In each case I already has &#8230; <a href="http://www.thenetocracy.com/2009/03/06/installing-php53-beta-on-ubuntu-810/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wanted to try out the new feature available in PHP 5.3 a while ago. And ran into a few obstacles trying get it installed. Since then I&#8217;ve installed it a few times successfully.</p>
<p>In each case I already has apache, php and mysql installed according to the instructions in the <a href="https://help.ubuntu.com/community/ApacheMySQLPHP">Ubuntu Documentation</a>.</p>
<p>Download the latest release candidate or snapshot of PHP 5.3. Extract the source.</p>
<p>The first issue I had was with apxs2, to get PHP installed for Apache. I didn&#8217;t have the expected apxs2 file. To resolve this I installed apache2-threaded-dev<br />
<code>sudo apt-get install apache2-threaded-dev</code></p>
<p>Then I was ready to run (with any addition options you need/want)<br />
<code>./configure --with-apxs2=usr/bin/apxs2 --with-mysql</code></p>
<p>I got the error &#8220;xml2-config not found. Please check your libxml2 installation.&#8221;<br />
I needed to install libxml2-dev<br />
<code>sudo apt-get install libxml2-dev</code></p>
<p>Running the configure command again, it succeeded.</p>
<p>Next to run the make file <code>sudo make</code><br />
Followed by <code>sudo make install</code><br />
However it alerts you that you need to have at least one LoadModule in your httpd.conf. Ubuntu doesn&#8217;t use httpd.conf to load modules so unless you have added something already, then your httpd.conf will be blank. All you need to do is add a LoadModule line. It doesn&#8217;t matter if the module exists or not. I simply added LoadModule whatever.</p>
<p>Now the install should work. Finally you might need to enable the php5 module, and restart apache.<br />
<code>a2enmod php5<br />
apache2ctl restart</code><br />
Checking phpinfo(), you should now be running PHP 5.3</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thenetocracy.com/2009/03/06/installing-php53-beta-on-ubuntu-810/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple Releases Security Update 2008-007 and Breaks my Apache</title>
		<link>http://www.thenetocracy.com/2008/10/11/apple-releases-security-update-2008-007-breaks-my-apache/</link>
		<comments>http://www.thenetocracy.com/2008/10/11/apple-releases-security-update-2008-007-breaks-my-apache/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 13:23:16 +0000</pubDate>
		<dc:creator>Jesse</dc:creator>
				<category><![CDATA[Everything Everything]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5.3]]></category>

		<guid isPermaLink="false">http://www.thenetocracy.com/?p=45</guid>
		<description><![CDATA[As soon as I installed the Apple Security Update 2008-007 this afternoon, restarted and re-opened firefox to all my previous tabs I knew something was up  when my localhost suddenly wasn&#8217;t responding. According to Apple, this fix updates to a &#8230; <a href="http://www.thenetocracy.com/2008/10/11/apple-releases-security-update-2008-007-breaks-my-apache/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As soon as I installed the <a title="Apple" href="http://support.apple.com/kb/HT3216">Apple Security Update 2008-007</a> this afternoon, restarted and re-opened firefox to all my previous tabs I knew something was up  when my localhost suddenly wasn&#8217;t responding.</p>
<p>According to Apple, this fix updates to a new version of Apache 2:</p>
<blockquote><p>Apache is updated to version 2.2.9 to address several vulnerabilities, the most serious of which may lead to cross site request forgery.</p></blockquote>
<p>In order to get Apache Running, the first thing I tried was openening System Preferences and enabling/disabling web sharing a couple of times  &#8211; <i>which did nothing.</i></p>
<p>Second thing was trying to run <strong>httpd</strong> from the command line. Again, no success but it gave me some useful errors. For some reason it was attempting to load some old set of config files that I hadn&#8217;t used for ages &#8211; so I promptly removed those and solved those &#8216;syntax errors&#8217; (cleanups are good!)</p>
<p>Once my config files were in order, I was back to square one with this error&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">httpd: Syntax error on line <span style="color: #000000;">116</span> of <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>httpd.conf: Cannot load <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>libphp5.so into server: dlopen<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>libphp5.so, <span style="color: #000000;">10</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: no suitable image found.  
Did <span style="color: #c20cb9; font-weight: bold;">find</span>:\n\t<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>libphp5.so: mach-o, but wrong architecture</pre></div></div>

<p>All this meant was that the compiled version of PHP5.3 I had (<a href="http://www.thenetocracy.com/2008/10/06/installing-php-53-on-mac-os-x-leopard/">see my other post on running php 5.3</a>) was compiled at 32bit, and Apple had set Apache back to 64Bit. Two commands solved this problem&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>httpd <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>httpd-fat
<span style="color: #c20cb9; font-weight: bold;">sudo</span> lipo <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>httpd <span style="color: #660033;">-thin</span> i386 <span style="color: #660033;">-output</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>httpd</pre></div></div>

<p>Note that the first command simply backs up httpd.</p>
<p>Since I&#8217;ve got web-sharing enabled, I assume that there&#8217;s some system that keeps track of the httpd processes, &#8211; as soon as killed the running 64bit httpd processes in Activity Monitor, it all seemed to be working again.</p>
<p>Just one note here: I did re-compile PHP again with the command line I posted earlier. There were no errors, and no differences so I don&#8217;t think that it was necessary, but I did try it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thenetocracy.com/2008/10/11/apple-releases-security-update-2008-007-breaks-my-apache/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing PHP 5.3 on Mac OS X Leopard</title>
		<link>http://www.thenetocracy.com/2008/10/06/installing-php-53-on-mac-os-x-leopard/</link>
		<comments>http://www.thenetocracy.com/2008/10/06/installing-php-53-on-mac-os-x-leopard/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 03:20:24 +0000</pubDate>
		<dc:creator>Jesse</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5.3]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.thenetocracy.com/?p=5</guid>
		<description><![CDATA[After many frustrating hours and three separate attempts I am finally running PHP 5.3.0alpha3 on my MacBook Pro using the default Leopard Apache installation (the one you can turn on/off with web sharing). This post is as much a summary &#8230; <a href="http://www.thenetocracy.com/2008/10/06/installing-php-53-on-mac-os-x-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After many frustrating hours and <em>three</em> separate attempts I am finally running PHP 5.3.0alpha3 on my MacBook Pro using the default Leopard Apache installation (the one you can turn on/off with web sharing). This post is as much a summary for my own records as it is how-to to people in the same boat. I&#8217;d like to point out that I&#8217;m not very experienced with compiling software from source, and for some reason I was determined to utilise the default Leopard installation of Apache.</p>
<p>The problem with the whole process was the Apple compiled version of Apache runs at 64Bit, and at present it&#8217;s not possible to compile the  PHP 5.3 Apache module to be compatible. The solution is to cut the Apache binary back to run at 32Bit. That can be done quite simply and is explained by Tony Bibbs back in June with <a title="PHP 5.3 on Mac OS X 10.5" href="http://www.tonybibbs.com/article.php/PHP-5_3-on-10.5">PHP 5.3 on Mac OS X 10.5</a>.</p>
<p>Once you&#8217;ve cut Apache back to 32Bit, you just need to install MySQL.<em> Before I read Tony&#8217;s post I went to all the effort of compiling MySQL 5.1RC in 64Bit, then found out that PHP wasn&#8217;t compatible with the 64bit. </em>Installing a released version of MySQL is simple, and in my opinion not worth going through the effort of compiling from source (unless you need some special functionality). I just took the latest release from the <a title="Mysql Download" href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg">MySQL download site</a> and installed it (<em>after removing numerious other versions first, see below</em>).</p>
<p>After MySQL was running, I downloaded the latest snapshot of PHP 5.3 from <a href="http://snaps.php.net/">snaps.php.net</a> , extracted, then ran the following configure command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php53 \
<span style="color: #660033;">--with-apxs2</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apxs <span style="color: #660033;">--with-config-file-scan-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php53<span style="color: #000000; font-weight: bold;">/</span>php.d \
<span style="color: #660033;">--with-iconv</span> <span style="color: #660033;">--with-openssl</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-ftp</span> <span style="color: #660033;">--enable-sockets</span> \
<span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--enable-calendar</span> <span style="color: #660033;">--enable-bcmath</span> \
<span style="color: #660033;">--with-curl</span>=shared,<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php53 <span style="color: #660033;">--with-zlib-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr  \
<span style="color: #660033;">--with-mysqli</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql_config</pre></div></div>

<p>Note my use of &#8211;prefix=/usr/local/php53 &#8211; this was my choice, as I didn&#8217;t want it to potentially overwrite my php 5.2 installation that was there.</p>
<p>The important elements here are &#8211;prefix and &#8211;with-mysqli</p>
<p>Also &#8211; I&#8217;m not 100% on what &#8211;with-config-file-scan-dir does, but it caused no problems.</p>
<p>After configure succeeds I ran</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>Then after a cofee/beer I ran</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>From what I could gather, the install procedure created the libphp5.so file inside the /libexec/apache2/ directory (overwriting the one that was previously there), and also added the &#8216;loadModule&#8217; line within the apache config file @ /private/etc/apache2/httpd.conf. If I did this again, I would backup previous php libraries.</p>
<p>Finally, a sudo apachectl restart restarts the apache server and I was on my way.</p>
<p><strong>Footnotes: </strong></p>
<p>Here&#8217;s some locations I found useful</p>
<p>Apache&#8217;s Httpd.conf is @ /private/etc/apache2/httpd.conf</p>
<p>The APXS libraries are @ /usr/sbin/apxs</p>
<p>PHP &#038; MySQL (by default) install to /usr/local/</p>
<p><strong>MySQL</strong></p>
<p>Throughout this whole trial and error process, I think I installed MySQL about three different times. Before finally just downloading the latest 5.0 release I took some steps to remove the previous installations. If you&#8217;ve installed MySQL many times (like I did) and you&#8217;re a bit conscious about having junk all over the place then best place to start looking for information on what&#8217;s installed where is the <strong>Readme.txt</strong> file that comes with the OS X package installer,  and also the <a href="http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html">Mysql Installation notes for OS X</a>.  </p>
<p>An article I found that also helped me search for some lost MySQL installs, and shed some light on what to do was this post titled <a title="Removing / Uninstalling MySQL" href="http://lee.hambley.name/archives/31">Removing MySql &#8211; by Lee Hambly</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thenetocracy.com/2008/10/06/installing-php-53-on-mac-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
