Project

General

Profile

Support #397

Install phpMyAdmin with nginx on FreeBSD

Added by Daniel Curtis over 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database Server
Target version:
Start date:
05/29/2014
Due date:
% Done:

100%

Estimated time:
0.50 h
Spent time:

Description

Now you can handle the administration of MySQL over the Web and on FreeBSD. It can manage a whole MySQL server as well as a single database. With phpMyAdmin you can easily browse through databases and tables, create, copy, rename, alter and drop databases and tables and many more.

Root access is required to edit the following files and to execute commands. Log in as root (su) or simply prepend sudo to all commands that require root privileges.

Make sure everything is up to date:

pkg update && pkg upgrade && portsnap fetch extract

Install nginx

  • Install nginx:
    pkg install nginx
    

Install phpMyAdmin

Install phpMyAdmin from your ports directory. I chose the default configuration without X11 and OpenSSL:

cd /usr/ports/databases/phpmyadmin
make install clean

Configure phpMyAdmin for Nginx

This is an example server block for your Nginx configuartion file:
vi /usr/local/etc/nginx.conf
  • And add the following server block:
    server {
            listen 81;
            server_name localhost;
            location / {
                root /usr/local/www/phpMyAdmin;
                index index.php index.html index.htm;
            }
            location ~ \.php$ {
                root /usr/local/www/phpMyAdmin;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
            }
            location ~ /\.ht {
                deny all;
            }
    }
    

Enable and start the services

  • Enable php-fpm and nginx:
    echo 'nginx_enable="YES"' >> /etc/rc.conf
    echo 'php_fpm_enable="YES"' >> /etc/rc.conf
    
  • Start php-fpm and nginx:
    service nginx start
    service php-fpm start
    

History

#1 Updated by Daniel Curtis over 6 years ago

  • Description updated (diff)
  • Status changed from In Progress to Closed

#2 Updated by Daniel Curtis almost 6 years ago

  • Project changed from 82 to FreeBSD Administration
  • Description updated (diff)
  • % Done changed from 50 to 100

#3 Updated by Daniel Curtis over 5 years ago

  • Target version set to FreeBSD 9

#4 Updated by Daniel Curtis over 5 years ago

  • Subject changed from How to Install nginx with phpMyAdmin on FreeBSD to Install phpMyAdmin with nginx on FreeBSD
  • Description updated (diff)
  • Category set to Database Server

#5 Updated by Daniel Curtis over 4 years ago

  • Description updated (diff)

Also available in: Atom PDF