<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/templates/php-blogger/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://www.phpblogger.de/feeds/atom.xml" rel="self" title="php-Blogger" type="application/atom+xml" />
    <link href="http://phpblogger.de/"                        rel="alternate"    title="php-Blogger" type="text/html" />
    <link href="http://phpblogger.de/rss.php?version=2.0"     rel="alternate"    title="php-Blogger" type="application/rss+xml" />
    <title type="html">php-Blogger</title>
    <subtitle type="html">php-Blogger</subtitle>
    <icon>http://phpblogger.de/templates/php-blogger/img/s9y_banner_small.png</icon>
    <id>http://phpblogger.de/</id>
    <updated>2011-01-28T10:13:53Z</updated>
    <generator uri="http://www.s9y.org/" version="1.5.3">Serendipity 1.5.3 - http://www.s9y.org/</generator>
    <dc:language>de</dc:language>

    <entry>
        <link href="http://phpblogger.de/archives/299-OSX-10.5.x-+-PHP-+-pecl_ncurses.html" rel="alternate" title="OSX 10.5.x + PHP + pecl_ncurses" />
        <author>
            <name>Harald Lapp</name>
                    </author>
    
        <published>2010-07-09T13:32:57Z</published>
        <updated>2011-01-28T10:13:53Z</updated>
        <wfw:comment>http://phpblogger.de/wfwcomment.php?cid=299</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://phpblogger.de/rss.php?version=atom1.0&amp;type=comments&amp;cid=299</wfw:commentRss>
    
            <category scheme="http://phpblogger.de/categories/17-PHP" label="PHP" term="PHP" />
    
        <id>http://phpblogger.de/archives/299-guid.html</id>
        <title type="html">OSX 10.5.x + PHP + pecl_ncurses</title>
        <content type="xhtml" xml:base="http://phpblogger.de/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>After several days playing around with newt i am quite disappointed to come to a point where i have to say, that newt has not only a <a target="_blank" href="http://www.whoow.org/people/Jean-Marc.Lienher/gnewt/tutorial.html">very limited documentation</a> (i think there's only documentation of about 50% of the newt functionality) -- which would not be that of a problem, though. The bigger problem is, that things are very unstable. "Segmentation faults" reproducable on different operating systems and platforms -- not sure though, if the problem is newt or pecl_newt. However: this is definitly not what i want. So, let's move on to something better.</p>

<p>I had a look at the apple's <a target="_blank" href="http://opensource.apple.com">opensource repository</a> the other day and stumbled over a ncurses package. I had problems with the normal gnu ncurses package before, it would not install but hang when building the terminfo database. With the ncurses package i found at apple's opensource repository, i get it to install. Here is the howto:</p>

<p><b>Note:</b> The first three steps below are for osx 10.5.x. For osx 10.6.6 simply download <a href="http://opensource.apple.com/source/ncurses/ncurses-27/ncurses-5.7.tar.gz">ncurses 5.7</a> and build it using <tt>./configure --with-shared</tt>.</p>

<ol>
<li>Download ncurses from apple's <a target="_blank" href="http://opensource.apple.com">opensource repository</a>. You can find it by clicking on the link of the Mac OSX version you are running, eg. <a target="_blank" href="http://opensource.apple.com/release/mac-os-x-1058/">10.5.8</a>.</li>
<li>Unpack the package und you get a directory called something like "ncurses-21" or so. Next <i>cd</i> into this direktory and run <tt>make</tt> and <tt>sudo make install</tt>. If make complains about a missing directory <i>/tmp/ncurses/Build</i>, just create it <tt>mkdir -p /tmp/ncurses/Build</tt> and start again.</li>
<li>Now an intermediate build should have been generated. Next <tt>cd /tmp/ncurses/Build</tt>, <tt>make</tt> and <tt>sudo make install</tt>. Now ncurses should have been successfully installed.</li>
<li>Ready to install the  ncurses php extension by either executing <tt>sudo pecl install ncurses</tt> or downloading ncurses from <a target="_blank" href="http://pecl.php.net/package/ncurses">pecl.php.net</a> and building manually.</li>
<li>Don't forget to add <tt>ncurses.so</tt> to your php.ini</li>
</ol>

<p>Now everything should be ready to start writing ncurses apps -- however: for me it sill did not work. The simplest ncurses app resultet in the following error message:</p>

<p><tt>Error opening terminal: vt100.</tt></p>

<p>What's going on? dtruss might be your friend to figure this out. Execute the following command, where <i>example.php</i> is your ncurses app you want to run: <tt>sudo dtruss php example.php</tt>. You should see output like:</p>

<p><pre style="font-size: 9px;">
[...]
lstat("/Users/harald\0", 0xBFFFE41C, 0xFFFFFFFFBFFFEFC8)                 = 0 0
lstat("/Users\0", 0xBFFFE2EC, 0xFFFFFFFFBFFFEFC8)                = 0 0
ioctl(0x3, 0x4004667A, 0xBFFFF17C)               = -1 Err#25
ioctl(0x3, 0x402C7413, 0xBFFFF150)               = -1 Err#25
fstat(0x3, 0xBFFFF1B0, 0xBFFFF150)               = 0 0
mmap(0x0, 0x226, 0x1, 0x2, 0x3, 0x100000000)             = 0x17FA000 0
lseek(0x3, 0x0, 0x1)             = 518 0
munmap(0x17FA000, 0x1F3)                 = 0 0
close_nocancel(0x3)              = 0 0
ioctl(0x1, 0x4004667A, 0xBFFFECEC)               = 0 0
stat("/Users/harald/.terminfo\0", 0xBFFFEC00, 0xBFFFECEC)                = 0 0
access("/Users/harald/.terminfo/73/vt100\0", 0x4, 0xBFFFECEC)              = -1 Err#2
stat("/usr/local/share/terminfo\0", 0xBFFFEC00, 0xBFFFECEC)              = -1 Err#2
write_nocancel(0x2, "Error opening terminal: vt100.\n\0", 0x24)            = 36 0
</pre></p>

<p>You can see, that ncurses is looking for a file <i>vt100</i> in a <i>terminfo</i> directory and fails looking at <i>/usr/local/share/terminfo</i>. I indeed had no directory <i>/usr/local/share/terminfo</i> but a directory <i>/usr/share/terminfo</i>. I was not able to figure out, where i could specify the correct directory configuration for this, so i just created a symlink: <tt>sudo ln -snf /usr/share/terminfo /usr/local/share/terminfo</tt>. After creating the symlink, i was able to execute my example ncurses application.</p>
 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://phpblogger.de/archives/301-Apple-discontinues-the-xserve.html" rel="alternate" title="Apple discontinues the xserve" />
        <author>
            <name>Harald Lapp</name>
                    </author>
    
        <published>2010-11-06T23:50:53Z</published>
        <updated>2010-11-06T23:50:53Z</updated>
        <wfw:comment>http://phpblogger.de/wfwcomment.php?cid=301</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://phpblogger.de/rss.php?version=atom1.0&amp;type=comments&amp;cid=301</wfw:commentRss>
    
            <category scheme="http://phpblogger.de/categories/1-Allgemeines" label="Allgemeines" term="Allgemeines" />
    
        <id>http://phpblogger.de/archives/301-guid.html</id>
        <title type="html">Apple discontinues the xserve</title>
        <content type="xhtml" xml:base="http://phpblogger.de/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>This is very, very disappointing: <a href="http://www.apple.com/xserve/" target="_blank">Apple discontinues the xserve</a>. It will be available for order until 31th of january 2011. The recommendation of Apple is to buy the Mac mini Server edition or the Mac Pro in future. While the Mac Pro is a great product, i can't imagine putting it in a 19" rack: two Mac Pro on a shelf would take the place of 12 units -- wow.</p>

<p>At <a href="http://www.clipdealer.com" target="_blank">ClipDealer</a> we have two of the xserve. They are great machines and i will definitly miss the possibility to buy more of them.</p>

<p>R.I.P. xserve -- i had a very good time with you.</p> 
            </div>
        </content>
        
    </entry>

</feed>
