Setting up phpMyAdmin in OpenSolaris
Install and configure AMP stack within OpenSolaris
-
Install OpenSolaris from LiveCD. You can download your copy from here
- Install Web Stack components from OpenSolaris repository by doing something like
- Open a command line terminal window and enter the below command
. This will download components like Apache 2.2, MySQL 5.0 and PHP 5.2
from the repository.
- pfexec pkg install amp
- Let us register these downloaded packages with Solaris Service Management Framework (SMF) by doing something like
- (from a command line terminal window)
- pfexec /usr/sbin/svccfg -s /var/svc/manifest/network/http-apache22.xml
- pfexec /usr/sbin/svccfg -s /var/svc/manifest/application/database/mysql.xml
- pfexec /usr/sbin/svccfg -s /var/svc/manifest/application/database/memcached.xml
- Finally, let us start Apache and MySQL services by doing
something like
- (from a command line terminal window)
- pfexec /usr/sbin/svcadm enable http:apache22
- pfexec /usr/sbin/svcadm enable mysql:version_50
With this, you should have successfully configured an AMP stack for OpenSolaris. If you would like to try out some sample php pages, you could very well write these php pages under default apache document root directory ( /var/apache2/2.2/htdocs ) .
Note that within OpenSolaris the Apache document root directory - location in your hard disk where apache web server looks to serve incoming requests from your browser - needs special privilege to write to. Now, within OpenSolaris, you can get this privilege by prefixing with 'pfexec' command ahead.
For example, if I had to write a sample hello world php within OpenSolaris, I would do something like
pfexec vi /var/apache2/2.2/htdocs/hello.php
and save the following contents. Now, you should be able to access
this page from http://localhost/hello.php
|
<?php echo "Hello World"; #Now, let us get the php server information echo phpinfo(); ?> |
Configuring phpMyAdmin within OpenSolaris
Now, let us go ahead and download phpMyAdmin from here and
unpack the downloaded tar ball to say /var/www. Again, from a
command line terminal window, this is easily done - as shown below :
- Download phpMyAdmin to a local directory which is not
accessible by every one to say /var/www
- pfexec wget phpmyadmin-2.11.6
- pfexec mkdir -p /var/www
- cd /var/www & pfexec gtar jxvfp ~/phpmyadmin-2.11*
- pfexec mv /var/www/phpmyadmin-2.11* /var/www/phpmyadmin
- Now, you might want to download this phpmyadmin.conf to Apache
2.2 configuration location and restart Apache Web Server. This
configuration snippet instructs apache to to load phpMyAdmin from /var/www
- wget phpmyadmin.conf
- pfexec cp phpmyadmin.conf /etc/apache2/2.2/conf.d
- pfexec /usr/sbin/svcadm restart http:apache22
- Finally, you should be able to access phpMyAdmin from your browser by doing something like
- http://localhost/myadmin


Note that phpMyAdmin is currently available as an experimental package in the experimental repository at http://pkg.opensolaris.org/webstack as SUNWphp5-myadmin which can save a few steps (the final package will be somewhat different, but it's a quick way to try it out).
Posted by Jyri on May 28, 2008 at 07:42 PM PDT #
Hi Sriram,
Nice and easy install procedure. Thanks a lot.
Arnaud ZIEBA
Posted by Arnaud ZIEBA on June 10, 2008 at 01:38 PM PDT #
pfexec /usr/sbin/svccfg -s /var/svc/manifest/network/http-apache22.xml
svccfg: Pattern '/var/svc/manifest/network/http-apache22.xml' doesn't match any instances or services
I'm a opensolaris newbie trying it out and coming from a linux bg. It looked like it installed OK, however see the following. Any ideas anyone?
~$ pfexec /usr/sbin/svccfg -s /var/svc/manifest/application/database/mysql.xml
svccfg: Pattern '/var/svc/manifest/application/database/mysql.xml' doesn't match any instances or services
~$ pfexec /usr/sbin/svccfg -s /var/svc/manifest/application/database/memcached.xml
svccfg: Pattern '/var/svc/manifest/application/database/memcached.xml' doesn't match any instances or services
~$ pfexec /usr/sbin/svcadm enable http:apache22
svcadm: Pattern 'http:apache22' doesn't match any instances
Posted by Ronnie on August 26, 2008 at 10:37 AM PDT #
I'd been looking for this tutorial..
thank you so much...
Posted by Victoria on December 17, 2008 at 06:15 AM PST #
Seems you blog posting software (or server) ate up the URL address at "wget" and made it a URL shortcut. Shouldn't show
wget phpmyadmin.conf
should be changed to:
wget http:##prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.11.6-all-languages.tar.bz2?download
or even better edited to use the most recent version 3.2.1:
wget http:##prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-3.2.1-all-languages.tar.bz2?download
(REPLACE ## with // above)
Posted by George Birbilis on August 31, 2009 at 05:40 PM PDT #
Also, if you're using the development stack (based on OpenSolaris) WebStack configured by the NetBeans team, there's a handy script at:
/bin/phpmyadmin_evaluation_init
that sets up phpmyadmin for trying it out (first check if it's set up already to run in apache and bails out if so)
BTW if you're running in a VM and accessing the server from a web browser running in the host OS, you should change phpMyAdmin configuration to allow access from any server, not just 127.0.0.1. For more see URL:
randika.com/howtos/how-to-fix-the-error-you-dont-have-permission-to-access-phpmyadmin-on-this-server/comment-page-1#comment-259
else maybe change the networking mode at the Virtualization software [VirtualBox has such option] to make the host and the client OS network interfaces appear as a single one
Posted by George Birbilis on August 31, 2009 at 06:41 PM PDT #
your blogging facility also altered the following one:
wget phpmyadmin.conf
which should be:
wget http:##blogs.sun.com/natarajan/resource/myadmin.conf
(remember to change ## to // before using)
Posted by George Birbilis on September 01, 2009 at 03:16 AM PDT #
Thanks I installed phpmyadmin on opensolaris 2009.6, but unable to enter in phpmyadmin without password, and please tell me how can i know the password?
Posted by Muhammad Zeeshan Jilani on September 17, 2009 at 09:46 AM PDT #