<?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; solaris</title>
	<atom:link href="http://www.dotvoid.com/tag/solaris/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>MySQL 4, Apache 1.3 and PHP 4.3 on Solaris x86</title>
		<link>http://www.dotvoid.com/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/</link>
		<comments>http://www.dotvoid.com/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/#comments</comments>
		<pubDate>Thu, 02 Sep 2004 07:20:26 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=35</guid>
		<description><![CDATA[
Yesterday I decided it was time to get a proper PHP 4 environment configured on my new machine running the x86 version of Solaris 9. I know going outside Windows or Linux with PHP sometimes can be tricky. I haven&#8217;t used PHP on Solaris since my time at AOL in Dublin three years ago, so I decided to write down exactly [...]]]></description>
			<content:encoded><![CDATA[<div class="preamble">
<p>Yesterday I decided it was time to get a proper PHP 4 environment configured on my new machine running the x86 version of Solaris 9. I know going outside Windows or Linux with PHP sometimes can be tricky. I haven&#8217;t used PHP on Solaris since my time at AOL in Dublin three years ago, so I decided to write down exactly how, what and why I did things. I expected it to be a bit simpler then last time as I planned to use Apache rather than IPlanet (or whatever the name is today, it seems to change at least once a week). So my plan was to install a pretty standard LAMP environment. That is without the L ofcourse.</p></div>
<div class="itemview">
<h3>Preparations</h3>
<p>The first thing I had to do was to download the different GNU packages needed to compile MySQL, PHP and many other open source projects on Solaris. These packages can all be found on <a href="http://www.sunfreeware.com/">Sunfreeware.com</a>. The packages I installed, by default under /usr/local,  were:</p>
<ul>
<li>gcc</li>
<li>gmake</li>
<li>flex</li>
<li>bison</li>
<li>m4</li>
<li>autoconf</li>
<li>automake</li>
<li>gzip</li>
<li>tar</li>
<li>GNU sed</li>
<li>libiconv</li>
</ul>
<p>All packages are easy to install using <em>pkgadd</em>. Care needs to be taken to set the system paths correctly after the installation. I used the command <em>crle -u -l /usr/local/lib</em> to add the lib directory to the system defaults. Then I added <em>/usr/local/bin</em> first in my PATH to make sure GNU versions take precedence if there are any conflicts. For example the package m4 could be found on the system already. I also appended <em>/usr/ccs/bin</em> last to the PATH as there are programs there needed for compilation and linking.</p>
<h3>MySQL</h3>
<p>Having the environment setup as I wanted it I set my eyes on installing MySQL. I couldn&#8217;t find an official binary package for Solaris 9 x86 so I had to build it myself. I downloaded the source from <a href="http://www.mysql.com/">mysql.com</a>, quickly unpacked it and failed miserably at compiling it.</p>
<p>A quick research using Google gave me <a href="http://forum.sun.com/thread.jsp?forum=11&amp;thread=20228">the answer</a>. The command <span style="font-style: italic;">mkheaders</span> refused due to paths not being found. So additionally I had to create a softlink as the paths for some reason differed. After creating the symlink I could generate the gcc header files. The exact commands issued are as below.</p>
<pre># ln -s /usr/local/lib/gcc /usr/local/lib/gcc-lib
# cd /usr/local/libexec/gcc/i386-pc-solaris2.9/\
  3.4.1/install-tools
# ./mkheaders</pre>
<p>Then I tried compiling MySQL again. This time, everything could be done by the book. For sake of convenience &#8211; here&#8217;s a near copy from the MySQL manual.</p>
<pre># ./configure --prefix=/usr/local/mysql
# make &amp;&amp; make install
# cp support-files/my-medium.cnf /etc/my.cnf</pre>
<pre># cd /usr/local/mysql
# groupadd mysql
# useradd -g mysql mysql
# chown -R root .
# chown -R mysql var
# chgrp -R mysql .</pre>
<p>The only thing left then is to start the MySQL daemon and set the root password.</p>
<pre># bin/mysqld_safe --user=mysql
# bin/mysqladmin -u root password XXXXXX
# bin/mysqladmin -u root -h myhost password XXXXXX</pre>
<h3>Installing gd</h3>
<p>I need gd for, among other things, thumbnail generation. As I wanted to download and compile as little as possible a quick check revealed that freetype, libjpeg, libpng and libiconv already existed in my default Solaris 9 installation. The libraries can be found under the <em>/usr/sfw</em> directory.</p>
<p>I wanted the newest version of gd as GIF support is now added again after being removed for several years due to Unisys suddenly starting do demand licensing fees for their LZW patent a few years ago. So I could not use the slightly older gd available as a package at sunfreeware.</p>
<p>I downloaded version 2.0.28 and tried to compile it. However, I could not get it to compile using the libiconv already installed. Instead I had to download libiconv from sunfreeware and install it under <em>/usr/local</em>. The following configure command was what I ended up with to get gd to compile.</p>
<pre># ./configure \
  --prefix=/usr/local \
  --with-freetype=/usr/sfw \
  --with-png=/usr/sfw \
  --with-jpeg=/usr/sfw \
  --with-libiconv-prefix=/usr/local</pre>
<p>After that compiling the package was a breeze.</p>
<pre># make &amp;&amp; make install</pre>
<h3>On to apache</h3>
<p>Apache must be the easiest application around to build on different platforms. I have never experienced any problems building a stable apache release on any unix platform. I did once have problems getting it to run on NT 4 when the windows version still was marked unstable. I guess that could be expected though. So creating a standard build of apache is very straight forward.</p>
<pre># ./configure --prefix=/usr/local/apache-1.3.31 \
  --enable-module=so
# make &amp;&amp; make install</pre>
<h3>PHP &#8211; finally</h3>
<p>Compiling PHP became, as it turned out, a bit tricky becaused of my decision to enable gd support. The reason was that the PHP configure script didn&#8217;t list libiconv when checking that all the gd functions were correct. The configure script just said &#8220;no&#8221; to all the gd functions and refused to create the makefiles. After awhile I looked through the generated config.log. This revealed that what really failed was not actually gd. When loading gd to check what functions were available it failed to find symbols from libiconv. This must either be a bug in the configure script or more probable a problem with my Solaris 9 environment and the library paths.</p>
<p>So prior to running the configure script I had to manually amend the configure script and add <em>-liconv</em> in all places where <em>-lgd</em> could be found. That did the trick and the script happily trotted along as it should.</p>
<pre># ./configure \
  --with-apxs=/usr/local/apache-1.3.31/bin/apxs \
  --with-mysql=/usr/local/mysql/ \
  --with-gd=/usr/local \
  --with-freetype-dir=/usr/sfw \
  --enable-gd-native-ttf \
  --with-png-dir=/usr/sfw \
  --with-zlib-dir=/usr/sfw \
  --with-jpeg-dir=/usr/sfw</pre>
<pre># make &amp;&amp; make install</pre>
<p>After that I added the directives needed in httpd.conf to enable PHP4. Actually I only had to add the second line below as the LoadModule directive was already present.</p>
<pre>LoadModule php4_module libexec/libphp4.so
AddType application/x-httpd-php .php</pre>
<p>And finally, at 03:43 AM, I could verify the installation and configuration using the simple php script with a call to phpinfo(). Of course it worked like a charm.</p>
<p>All that remains now is to get Apache 2 and PHP 5 up and running alongside. I still haven&#8217;t figured out if the good PHP folks recommend Apache 2 for production yet. Anyways,<br />
that&#8217;ll be a project for another night.</p></div>


<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/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/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/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/&amp;title=MySQL+4%2C+Apache+1.3+and+PHP+4.3+on+Solaris+x86" 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/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/&amp;t=MySQL+4%2C+Apache+1.3+and+PHP+4.3+on+Solaris+x86" 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/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/&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/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/&amp;title=MySQL+4%2C+Apache+1.3+and+PHP+4.3+on+Solaris+x86&amp;summary=%0D%0A%0D%0AYesterday%20I%20decided%20it%20was%20time%20to%20get%20a%20proper%20PHP%204%C2%A0environment%20configured%20on%20my%20new%20machine%C2%A0running%C2%A0the%C2%A0x86%20version%20of%20Solaris%209.%C2%A0I%20know%20going%20outside%20Windows%20or%20Linux%20with%20PHP%20sometimes%C2%A0can%20be%20tricky.%20I%20haven%27t%20used%20PHP%20on%20Solaris%20since%20my%20time%20at%20AOL%20in%20Dublin%20three%20years%20ago%2C%20so%20I%20de&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/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/" 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/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/&amp;title=MySQL+4%2C+Apache+1.3+and+PHP+4.3+on+Solaris+x86" 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=MySQL+4%2C+Apache+1.3+and+PHP+4.3+on+Solaris+x86+-+http://b2l.me/w7g6z&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/2004/09/mysql-4-apache-13-and-php-43-on-solaris-x86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

