Project

General

Profile

Support #493

Updated by Daniel Curtis about 10 years ago

With our LEMP platform already in place, we can begin right away with installing the phpMyAdmin software. This is available within Ubuntu's default repositories, so the installation process is simple. 

 * First, update the server's local package index to make sure it has a fresh set of references to available packages. Then, we can use the apt packaging tools to pull the software down from the repositories and install it on our system: 
 <pre> 
 sudo apt-get update 
 sudo apt-get install nginx php5-fpm phpmyadmin 
 </pre> 

 During the installation, you will be prompted for some information. It will ask you which web server you would like the software to automatically configure. Since Nginx, the web server we are using, is not one of the available options, you can just hit TAB to bypass this prompt. 

 The next prompt will ask if you would like dbconfig-common to configure a database for phpmyadmin to use. Select "Yes" to continue. 

 You will need to enter the database administrative password that you configured during the MySQL installation to allow these changes. Afterward, you will be asked to select and confirm a password for a new database that will hold phpMyAdmin's own data. 

 * The installation will now complete. Now create a file to enable phpmyadmin: 
 vi /etc/nginx/sites-enabled/phpmyadmin 
 And add the following: 
 <pre> 
 server { 
     listen            8080; 
     server_name       localhost; 
     root          /usr/share/phpmyadmin; 
     index         index.php index.html index.htm; 
     if (!-e $request_filename) { 
         rewrite ^/(.+)$ /index.php?url=$1 last; 
         break; 
     } 
     location ~ .php$ { 
         try_files $uri =404; 
         fastcgi_pass unix:/var/run/php5-fpm.sock; 
         fastcgi_index index.php; 
         include /etc/nginx/fastcgi_params; 
     } 
 } 
 </pre> 

 * A final item that we need to address is enabling the mcrypt PHP module, which phpMyAdmin relies on. This was installed with phpMyAdmin so we just need to toggle it on and restart our PHP processor: 
 <pre> 
 sudo php5enmod mcrypt 
 sudo service php5-fpm start 
 </pre> 

 With that, our phpMyAdmin installation is now operational. To access the interface, go to your server's domain name or public IP address followed by /phpmyadmin, in your web browser: 
 http://server_domain_or_IP/phpmyadmin 

 h2. Resources 

 * http://magnatecha.com/set-up-phpmyadmin-with-nginx/ 
 * https://www.digitalocean.com/community/tutorials/how-to-install-phpmyadmin-on-a-lemp-server

Back