Support #397
Updated by Daniel Curtis almost 9 years ago
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: <pre> pkg update && pkg upgrade && portsnap fetch extract </pre> h2. Install nginx * Install nginx: <pre> pkg install nginx </pre> h2. Install phpMyAdmin Install phpMyAdmin from your ports directory. I chose the default configuration without X11 and OpenSSL: <pre> cd /usr/ports/databases/phpmyadmin make install clean </pre> h2. Configure phpMyAdmin for Nginx This is an example server block for your Nginx configuartion file: <pre> vi /usr/local/etc/nginx.conf </pre> #* And add the following server block: <pre> 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; /usr/local/www/phpMyAdmin$fastcgi_script_name; include fastcgi_params; } location ~ /\.ht { deny all; } } </pre> h2. Enable and start the services * Enable php-fpm and nginx: <pre> echo 'nginx_enable="YES"' >> /etc/rc.conf echo 'php_fpm_enable="YES"' >> /etc/rc.conf </pre> * Start php-fpm and nginx: <pre> service nginx start service php-fpm start </pre>