<?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>dotvoid.com &#187; netscape</title>
	<atom:link href="http://www.dotvoid.com/tag/netscape/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotvoid.com</link>
	<description>Experiments and thoughts in PHP and javascript</description>
	<lastBuildDate>Tue, 11 Oct 2011 12:49:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP 4 as a NSAPI module on Solaris</title>
		<link>http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/</link>
		<comments>http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/#comments</comments>
		<pubDate>Wed, 10 Jan 2001 20:01:07 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[iplanet]]></category>
		<category><![CDATA[netscape]]></category>
		<category><![CDATA[nsapi]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=7</guid>
		<description><![CDATA[This article describes how to install PHP 4.0.4 as a NSAPI module on a Solaris box. The version of Solaris is 2.8 using iPlanet Web Server 4.1. Additionally PHP is going to have support for MySQL and use Sablotron for parsing XML using XSL stylesheets.
Requirements
The packages below are necessary for the compilation and installation of [...]]]></description>
			<content:encoded><![CDATA[<p>This article describes how to install PHP 4.0.4 as a NSAPI module on a Solaris box. The version of Solaris is 2.8 using iPlanet Web Server 4.1. Additionally PHP is going to have support for MySQL and use Sablotron for parsing XML using XSL stylesheets.</p>
<h3>Requirements</h3>
<p>The packages below are necessary for the compilation and installation of php. You probably have most packages allready installed. Most packages can be obtained from www.sunfreeware.com.</p>
<p>* flex-2_5_4a-sol26-sparc-local<br />
* gcc-2_95_2-sol26-sparc-local<br />
* gzip-1.2.4-sol26-sparc-local<br />
* perl-5_005_03-sol26-sparc-local<br />
* bison-1_25-sol26-sparc-local<br />
* make-3_76_1-sol26-sparc-local<br />
* m4-1_4-sol26-sparc-local<br />
* autoconf-2.13<br />
* automake-1.4<br />
* tar-1.13 (GNU tar)</p>
<p>For this tutourial you also need MySQL and Sablotron installed. The MySQL version I have used is 3.23.27-beta-sun-solaris2.7-sparc which you can obtain from www.mysql.com. The Sablotron is the binary distribution of version 0.44. Download it from www.gingerall.com. I will leave the installation of these packages to you since it is not the focus of the article.</p>
<h3>Unpack php</h3>
<p>Unpack php and go into the directory created.</p>
<pre>gunzip php-4.0.4.tar.gz
tar -c php-4.0.4.tar
cd php-4.0.4</pre>
<h3>Preparing to compile</h3>
<p>MySQL is installed in /usr/mysql and Sablotron in /usr/local. Netscape iPlanet Web Server (NES) is installed in the directory /data/nesdir/nes4.1/. The default installation directory for php is /usr/local<br />
which normally is sufficient. (You can force it to install somewhere else with the prefix switch, for example: &#8211;prefix=/usr/www) . To configure php enter the following command (all on one line):</p>
<pre>./configure --with-nsapi=/data/nesdir/nes4.1/ --with-mysql=/usr/mysql --with-sablot=/usr/local</pre>
<h3>Compiling</h3>
<p>Before compiling we need to do some editing of the source. Php 4.0.4 have a bug regarding it&#8217;s use as a NSAPI module. The bug number is 7286. This is now fixed in CVS though. This will not be an issue the next release (current is 4.0.4). The workaround is to add a line to the file php_config.h. This file you will find in the directory php-4.0.4/main. Add the line below anywhere in the file.</p>
<pre>#define HAVE_IEEEFP_H</pre>
<p>Finally we can compile the php.</p>
<pre>make &amp;&amp; make install</pre>
<h3>Configuring iPlanet</h3>
<p>For iPlanet to load and use php to parse php pages we need to do three separate things. First we need to make sure the web server find all the libaries it needs in order to load php. Then we need to add the php mime-type. Third we edit the configuration of the web server. The last step will make sure the web server loads the php module, initialises it and creaes a binding between the php mime type and the php module. In this example I have a server instance named myserver. All the relevant files then resides in /data/nesdir/nes4.1/https-myserver/.</p>
<p>All this is also described in a readme file that comes with the php distribution. This file is found in the directory php-4.0.4/sapi/nsapi/.</p>
<p>Include path for libraries We need to tell iPlanet where to look for shared libraries. This can be done by altering the environment variable LD_LIBRARY_PATH for the user the web server is run under. But it is easier to do in the start script by changing the variable LD_LIBRARY_PATH there. In our example, /data/nesdir/nes4.1/https-myserver/start</p>
<p>In our case we want to add /usr/local/lib to the path. Example (one line):</p>
<pre>LD_LIBRARY_PATH=${SERVER_ROOT}/bin/${PRODUCT_NAME}/lib: ${LD_LIBRARY_PATH}:/usr/local/lib;</pre>
<p>And then export it:</p>
<pre>export LD_LIBRARY_PATH</pre>
<p>Add the mime-type</p>
<p>All that is left now is to configure the web server to load php and hand over php files. This is done in the file /data/nesdir/nes4.1/https-myserver/config/obj.conf. These two lines are to be added after mime types init. First line (one line):</p>
<pre>Init fn="load-modules"
funcs="php4_init,php4_close,php4_execute,php4_auth_trans"
shlib="/usr/local/lib/libphp4.so"</pre>
<p>Directly after that you write:</p>
<pre>Init fn=php4_init errorString="Failed to initialize PHP!"</pre>
<p>After that we will tell the Netscape Server to forward php files to the php-parser. This is done in the &#8220;default&#8221; object further down in the obj.conf file. The following line should be written after all ObjectType definitions and before all the AddLog definitions.</p>
<pre>&lt;object&gt;
ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
Service fn=php4_execute
&lt;/object&gt;</pre>
<p>That&#8217;s it! Restart the server and hopefully you will have a working NSAPI installation of PHP.</p>
<h3>Optional authenticaton</h3>
<p>This step is not necessary for it to work but anyway, you might need it. PHP authentication cannot be used with any other authentication. All authentication is passed to the php script. To configure PHP Authentication for the entire server you add the following line in the default object definition:</p>
<p>AuthTrans fn=php4_auth_trans</p>
<p>However if you want to use PHP authentication on a signle directory you create a new directory like this:</p>
<pre>&lt;object phpath="/data/docs/php/*"&gt;
AuthTrans fn=php4_auth_trans
&lt;/object&gt;</pre>
<h3>More bugs.</h3>
<p>There is another bug that, no 7163 which you might encounter. Aki Hakkila developed this further in a mail to the php dev list. It seems that the web server never check to see that a php file really exists before handing the path over to php. This is not a big deal but you might run into it.</p>
<p>If you use software virtual servers you might encounter the same strange errors when including files. Aki provided a suggested solution for both of these issues. I&#8217;ll update this article when I&#8217;ve tested them.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/&amp;title=PHP+4+as+a+NSAPI+module+on+Solaris" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/&amp;t=PHP+4+as+a+NSAPI+module+on+Solaris" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/&amp;title=PHP+4+as+a+NSAPI+module+on+Solaris&amp;summary=This%20article%20describes%20how%20to%20install%20PHP%204.0.4%20as%20a%20NSAPI%20module%20on%20a%20Solaris%20box.%20The%20version%20of%20Solaris%20is%202.8%20using%20iPlanet%20Web%20Server%204.1.%20Additionally%20PHP%20is%20going%20to%20have%20support%20for%20MySQL%20and%20use%20Sablotron%20for%20parsing%20XML%20using%20XSL%20stylesheets.%0D%0ARequirements%0D%0AThe%20packages%20below%20are%20necessary&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/&amp;title=PHP+4+as+a+NSAPI+module+on+Solaris" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=PHP+4+as+a+NSAPI+module+on+Solaris+-+http://b2l.me/wuyys&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2001/01/php-4-as-a-nsapi-module-on-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

