Keeping software updated can be very time consuming because let’s face it, software runs our lives. Unless you’ve been living in the forest the past 20 years, you use software daily. As a Developer, I use phpMyAdmin, it’s my app of choice when managing databases because it runs smoothly, and it’s free. I love free, don’t you?
How to Install phpMyAdmin on MacOS Introduction. PhpMyAdmin is a free and open source tool for the administration of MySQL and MariaDB. As a portable web application written in PHP, it has become one of the most popular administration tool for MySQL. In this tutorial, we will learn the steps involved in the installation of phpMyAdmin on MacOS. WordPress development environment on Mac with Brew, Nginx, PHP 7, PHP-FPM, MariaDB, phpMyAdmin and more - README.md. Mar 12, 2014 i've just learned that 'If you want different directory for each user,%u will be replaced with username.' So we could put /var/www/clients/%u/ to the UploadDir and SaveDir that would bring you to the clients folder. But that folder is still not accessible by the client. Inside clients folder is the webXX folder that is accessible to the client using ftp. But problem is that this XX is.
Now there comes a time in a Developer’s life when he/she needs to upgrade their phpMyAdmin installation. But since it’s one of those things that isn’t entirely “urgent” for the most part, security updates aside, we tend to put off upgrading until we start to see rust (metaphorically speaking).
Automatic upgrades for phpMyAdmin
I’m going to assume you’re using a Linux/Unix server, and know how to use the command line, since that’s the way I roll. If you don’t have git installed, just type:
Now let’s grab the latest phpMyAdmin code:
This says, go into my home/workspace directory, and pull the latest version from git, but not the entire git history.
Next, let’s create a command line script to run the updates. I’m a Florida PHP Developer, so we’ll use PHP. Name the script update_phpmyadmin.php for simplicity.
Before being able to use this script, we need to make it executable; type this:
Finally, let’s schedule the task with cron so it runs automatically:
There you go, you’re automagically updating your phpMyAdmin install.
Why not use apt-get or yum or brew?
You might be asking why not just use apt-get or yum or brew (MAC) to automatically update phpMyAdmin. The answer is simple. You want the latest from phpMyAdmin, and apt-get/yum tend to fall behind. If you want the latest phpMyAdmin, use this approach.
Conclusion
You just learned how to get phpMyAdmin to auto update. Use with caution; not responsible if you break something. Should you need PHP Developer help, contact us for a quote.
Disclaimer
Please confirm your code works locally before pushing to a web server. Please eyeball the code before running it to confirm it will not destroy you system. Not responsible for any damages.
Homebrew
Install: /usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'
If installed already: brew update && brew upgrade
PHP-FPM
Install it:
brew install --without-apache --with-fpm --with-mysql php56
Symlink / alias php
BASH: echo 'export PATH='/usr/local/sbin:$PATH' >> ~/.bash_profile && . ~/.bash_profile
ZSH: echo 'export PATH='/usr/local/sbin:$PATH' >> ~/.zshrc && . ~/.zshrc
Automatically start up
Create dir: mkdir -p ~/Library/LaunchAgents
Symlink to your LaunchAgents: ln -sfv /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/
Start it: launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
Check it's running: lsof -Pni4 | grep LISTEN | grep php
Mysql
Brew install: brew install mysql
Run the setup security program: mysql_secure_installation
Auto starting: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
phpMyAdmin
Install autoconf, which is needed for the installation of phpMyAdmin:
brew install autoconf
And set the $PHP_AUTOCONF
environment variable:
If you use BASH: 'PHP_AUTOCONF='$(which autoconf)'' >> ~/.bash_profile && . ~/.bash_profile
or ZSH:echo 'PHP_AUTOCONF='$(which autoconf)'' >> ~/.zshrc && . ~/.zshrc
Since now you're all set, you can finish this part with the actual installation of phpMyAdmin:
brew install phpmyadmin
Nginx
brew install nginx
Start nginx: sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
Test: curl -IL http://127.0.0.1:8080
You're done. Nginx runs on 8080. TO configure further
Remove the current nginx.conf (which is also available as /usr/local/etc/nginx/nginx.conf.default in case you want to restore the defaults) and download my custom from GitHub:
Brew Phpmyadmin Minecraft
rm /usr/local/etc/nginx/nginx.conf
Get Jonas Friedmann's nginx conf curl -L https://gist.github.com/frdmn/7853158/raw/nginx.conf -o /usr/local/etc/nginx/nginx.conf
Get his php-fpm configuration as wellcurl -L https://gist.github.com/frdmn/7853158/raw/php-fpm -o /usr/local/etc/nginx/conf.d/php-fpm -o /usr/local/etc/nginx/conf.d/php-fpm
Setup example virtual hosts
curl -L https://gist.github.com/frdmn/7853158/raw/sites-available_default -o /usr/local/etc/nginx/sites-available/default
Brew Phpmyadmin Login
curl -L https://gist.github.com/frdmn/7853158/raw/sites-available_default-ssl -o /usr/local/etc/nginx/sites-available/default-ssl
Brew Phpmyadmin
curl -L https://gist.github.com/frdmn/7853158/raw/sites-available_phpmyadmin -o /usr/local/etc/nginx/sites-available/phpmyadmin
Clone Jonas's example virtual hosts (including 404/403 error pages and a phpinfo() status site) using git:
git clone http://git.frd.mn/frdmn/nginx-virtual-host.git /var/www
rm -rf /var/www/.git
And remove the .git folder so your content won't get tracked by git.