<?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>Connecting the dots... &#187; protocol</title>
	<atom:link href="http://blog.rajatpandit.com/tag/protocol/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rajatpandit.com</link>
	<description>Thoughts on Web Development, Infrastructure and Application Scalability</description>
	<lastBuildDate>Thu, 29 Dec 2011 13:21:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Enabling HTTPS support in curl installed through MacPorts on OSX</title>
		<link>http://blog.rajatpandit.com/2009/03/31/enabling-https-support-in-curl-installed-through-macports-on-osx/</link>
		<comments>http://blog.rajatpandit.com/2009/03/31/enabling-https-support-in-curl-installed-through-macports-on-osx/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 22:27:40 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Clean]]></category>
		<category><![CDATA[dependencies]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[variants]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=250</guid>
		<description><![CDATA[While doing development just noticed that if you have installed php with curl support using macports it does&#8217;nt install ssl support in curl by default which is quite frustrating. Especially...]]></description>
			<content:encoded><![CDATA[<p>While doing development just noticed that if you have installed php with curl support using macports it does&#8217;nt install ssl support in curl by default which is quite frustrating. Especially I just spent 30mins of my life trying to debugging what had gone wrong.</p>
<p>This is what you would get if you have a similar problem:</p>
<pre class="brush: bash; title: ; notranslate">
% curl -k https://www.yahoo.com
curl: (1) Protocol https not supported or disabled in libcurl
</pre>
<p>The problem is that you would usually have something that depends on curl so you cant install the version of curl with its variant straightaway, so you will first need to remove the dependent first, then remove curl and clean up the install and then finally install curl with its ssl variant followed by its dependents.</p>
<p>The steps are something like this:</p>
<pre class="brush: bash; title: ; notranslate">
busybox:web rp$ sudo port uninstall curl @7.19.3_0 curl @7.19.3_0+ssl
---&gt;  Unable to uninstall curl 7.19.3_0, the following ports depend on it:
---&gt;  	php5
Error: port uninstall failed: Please uninstall the ports that depend on curl first.
busybox:web rp$ sudo port uninstall curl @7.19.3_0 curl @7.19.3_0+ssl
busybox:web rp$ sudo port uninstall php5
---&gt;  Deactivating php5 @5.2.9_0+apache2+macosx+mysql5+pear+sqlite
---&gt;  Uninstalling php5 @5.2.9_0+apache2+macosx+mysql5+pear+sqlite
busybox:web rp$ sudo port uninstall curl @7.19.3_0 curl @7.19.3_0+ssl
---&gt;  Deactivating curl @7.19.3_0
---&gt;  Uninstalling curl @7.19.3_0
---&gt;  Uninstalling curl @7.19.3_0+ssl
busybox:web rp$ sudo port install php5 @5.2.9_0+apache2+macosx+mysql5+pear+sqlite
Error: Requested variants do not match original selection.
Please perform 'port clean curl' or specify the force option.
Error: The following dependencies failed to build: curl
Error: Status 1 encountered during processing.
busybox:web rp$ sudo port clean curl
---&gt;  Cleaning curl
busybox:web rp$ sudo port clean php5
---&gt;  Cleaning php5
busybox:web rp$ sudo port clean php5
---&gt;  Cleaning php5
busybox:web rp$ sudo port clean curl
---&gt;  Cleaning curl
busybox:web rp$ sudo port clean php5
busybox:web rp$ sudo port install curl +ssl
---&gt;  Fetching curl
---&gt;  Verifying checksum(s) for curl
---&gt;  Extracting curl
---&gt;  Configuring curl
---&gt;  Building curl
---&gt;  Staging curl into destroot
---&gt;  Installing curl @7.19.3_0+ssl
---&gt;  Activating curl @7.19.3_0+ssl
---&gt;  Cleaning curl
busybox:web rp$ sudo port install php5 @5.2.9_0+apache2+macosx+mysql5+pear+sqlite
---&gt;  Fetching php5
---&gt;  Verifying checksum(s) for php5
---&gt;  Extracting php5
---&gt;  Applying patches to php5
---&gt;  Configuring php5
---&gt;  Building php5
---&gt;  Staging php5 into destroot
Warning: php5 requests to install files outside the common directory structure!
---&gt;  Installing php5 @5.2.9_0+apache2+macosx+mysql5+pear+sqlite

If this is your first install, you might want
cd /opt/local/apache2/modules
/opt/local/apache2/bin/apxs -a -e -n &quot;php5&quot; libphp5.so

* copy  /opt/local/etc/php.ini-dist to  /opt/local/etc/php.ini
---&gt;  Activating php5 @5.2.9_0+apache2+macosx+mysql5+pear+sqlite
---&gt;  Cleaning php5
</pre>
<div id="in_post_ad_bottom_1" style="clear:both;margin:0;padding:0;"><div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-bp */
google_ad_slot = "7787511801";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-BP-1 */
google_ad_slot = "9111022353";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2009/03/31/enabling-https-support-in-curl-installed-through-macports-on-osx/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using macport to setup php5 / apache2 on Leopard</title>
		<link>http://blog.rajatpandit.com/2009/03/12/using-macport-to-setup-php5-apache2-on-leopard/</link>
		<comments>http://blog.rajatpandit.com/2009/03/12/using-macport-to-setup-php5-apache2-on-leopard/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 23:49:11 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache 2]]></category>
		<category><![CDATA[darwin]]></category>
		<category><![CDATA[dependencies]]></category>
		<category><![CDATA[deps]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac ports]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[port search]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[variants]]></category>
		<category><![CDATA[web server support]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=237</guid>
		<description><![CDATA[As you can tell I got myself a new macbook and its pretty much ritualistic to install apache/php5 on it for me. I agree it comes with both of them...]]></description>
			<content:encoded><![CDATA[<p> As you can tell  I got myself a new macbook and its pretty much ritualistic to install apache/php5 on it for me. I agree it comes with both of them pre-installed but really I just like to do it for the easy of configuration. I have written earlier <a href="http://blog.rajatpandit.com/2008/01/31/compiling-apache-php-for-mac/">how I compiled everything</a> on Leopard in the past. This time I plan on trying something different.<br />
I am using mac ports (possibly coz I am getting lazier). Here are a couple of quick start guides of port.</p>
<pre class="brush: bash; title: ; notranslate">
# Selfupdate
$sudo port selfupdate

# selfupdate, if you want to see what's going on.
$sudo port -d selfupdate

#search for a particular package
$sudo port search apache2

#search for variants like for instance, mysql and its server
$sudo port install mysql 

#search information about package
$sudo port info php5

#get info about dependencies for a package
$sudo port deps php5

#install package
$sudo port install apache2

#install package with variant like mysql and its server
$sudo port install mysql +server

#clean all the guff
$sudo port clean --all

#get the contents of a package
$sudo port contents apache2

#get installed packages
$sudo port installed

#upgrade package
$sudo port upgrade apache2

#update all outdated packages
$sudo port upgrade outdated
</pre>
<p>So back to setting up apache2 and php5</p>
<pre class="brush: bash; title: ; notranslate">
$sudo port install apache2
</pre>
<p>It does its standard business and then confirms the installation, similarly for installing php5, it has the following variants available that might interest you.</p>
<pre class="brush: bash; title: ; notranslate">
rp@busybox:~ rp$ sudo port variants php5
Password:
php5 has the variants:
	darwin_6: Platform variant, do not select manually
	darwin_7: Platform variant, do not select manually
	macosx: Platform variant, do not select manually
	no_web: Don't include any web server support
	apache: Add Apache 1 web server module
	apache2: Add Apache 2.2 web server module (default)
	fastcgi: Add FastCGI web server binary
	gmp: Add GNU MP functions
	dbase: Add dBase file format support
	imap: enable operation with IMAP protocol
	pspell: Add pspell spell-checking functions
	tidy: add Tidy support
	mssql: add support for MS-SQL server
	snmp: use Apple snmp
	macports_snmp: use MacPorts snmp
	mysql3: build MySQL 3 support
	mysql4: build MySQL 4 support
	mysql5: build MySQL 5 support
	oracle: Add Oracle oci8 database functions with the Oracle Instant Client
	postgresql82: provide postgresql82 support
	postgresql83: provide postgresql83 support
	sqlite: build sqlite support
	ipc: build IPC support
	pcntl: provide process control
	pear: add pear stuff
	readline: Add GNU readline functions
	sockets: Add socket communication functions
	t1lib: Add PostScript Type 1 font support with t1lib
	universal: Build for multiple architectures
</pre>
<p>I would go with just the basics. </p>
<pre class="brush: bash; title: ; notranslate">
$sudo port install php5 +apache2 +mysql5 +pear
</pre>
<p>With that done, now you can create your own copy of apaches httpd.conf</p>
<pre class="brush: bash; title: ; notranslate">
sudo cp /opt/local/apache2/conf/httpd.conf.sample /opt/local/apache2/conf/httpd.conf
</pre>
<p>Activate the php5 module.</p>
<pre class="brush: bash; title: ; notranslate">
cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n &quot;php5&quot; libphp5.so
[activating module 'php5' in /opt/local/apache2/conf/httpd.conf]
</pre>
<p>and then you can play around with the config files as much as you like to set it up the way you prefer and then fire up the server using the following command:</p>
<pre class="brush: bash; title: ; notranslate">
apache2ctl start
</pre>
<p>and it should all work fine in your browsers. try out the config with the standard php testing function.</p>
<pre class="brush: bash; title: ; notranslate">
phpinfo();
</pre>
<p>Have fun, port is easy and simple, lets you get to the point where you can do something productive and creative. </p>
<p>Photo credit to my esteemed collegue: <a href="http://www.flickr.com/photos/thevoicewithin">Neil Crosby</a>.</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin:0;padding:0;"><div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-bp */
google_ad_slot = "7787511801";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-BP-1 */
google_ad_slot = "9111022353";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2009/03/12/using-macport-to-setup-php5-apache2-on-leopard/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

