If you're already familiar with NetBSD, this information may not be particulary new or useful to you. It's not particularly Atari-specific. I do however use this for my own reference when I install NetBSD/atari.
- Make sure to run through the pkgsrc configuration described in the packages section.
- Make sure to have previously installed apache.
- The latest major version of PHP available via pkgsrc at the time of this writing is 5.3. But ap-php won't install this one by default. To fix that, in /etc/mk.conf, add:
- PHP_VERSION_DEFAULT=53
- PHP 5.3 currently fails to compile on the version of gcc included with NetBSD 5.x and even 6. To fix this, add the following to ~/pkgsrc/lang/php53/Makefile:
- CONFIGURE_ARGS+= --disable-fileinfo
- PHP 5.3 currently fails to compile on the version of gcc included with NetBSD 5.x and even 6. To fix this, add the following to ~/pkgsrc/lang/php53/Makefile:
- PHP_VERSION_DEFAULT=53
- cd /usr/pkgsrc/www/ap-php
- sudo make install
- make test
- su to root.
- vi /usr/pkg/etc/httpd/httpd.conf
- At the end of the LoadModule list, add the following:
- LoadModule php5_module lib/httpd/mod_php5.so
- AddHandler application/x-httpd-php .php
- Save and exit vi.
- vi /usr/pkg/share/httpd/htdocs/test.php
- Add the following HTML:
<html>
<head>
<title>Test</title>
</head>
<body>
<?php
phpinfo( );
?>
</body>
</html>
- Save and exit vi.
- shutdown -r now, or stop/start apache as described below.
- Once apache is running, from a separate machine on the network, browse to [http://[Atari]/test.php http://[Atari]/test.php]. It should show a test page from php.
Notes:
- To start or stop apache without rebooting, use:
- sh /etc/rc.d/apache start
- sh /etc/rc.d/apache stop