ososoba
By:
ososoba

phpMyAdmin mycrypt issue

February 12, 2017 355 views
PHP Nginx Ubuntu 16.04

I just got started with DigitalOcean yesterday, my first VPN so apologies in advance for any unnecessary questions.

I have been able to install dependencies for NodeBB and also install NodeBB itself. But now I'm also trying to setup for WordPress on the same droplet

I have successfully carried out the LEMP installation through help articles, but I'm getting stuck at phpMyAdmin installation. Biggest issue now is with the mcrypt service, I can't get it to start

Based on this tutorial, https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-with-nginx-on-an-ubuntu-14-04-server

Everytime I try to run this code 'sudo php5enmod mcrypt' I get an error saying php5enmod can't be found. I know that I'm currently running php7 so I thought that was the problem.

However I've gone round this for about 14hrs and I still can't figure it out

2 Answers

@ososoba

The guide you're working from is for Ubuntu 14.04. While the basics from the guide will work just fine, with the latest release of PHP, there's no need to run a command to enable PHP modules as they are enabled during package installation.

The php5enmod is specific to PHP 5.x and wouldn't apply in your case (and it won't be on your Droplet).

To confirm whether or not mcrypt is enabled, simply create a PHP info page and do a search on the page for mcrypt.

<?php phpinfo(); ?>
  • Thank you @jtittle for the insight. I have checked now and I see that mcrypt is enabled on the PHP info page.

    Only thing I'm not sure of now is why I keep getting a 404 error when I try to access phpMyAdmin. Is it possible to take out the current installation and reinstall to troubleshoot? Or can I just reinstall and overwrite current files?

    Thanks again.

    • So I looked around and found a way to install the most recent phpMyAdmin version using

      sudo add-apt-repository ppa:nijel/phpmyadmin
      

      I was in the /var/www/html folder when I ran this command (assuming that phpmyadmin will be installed there) but I don't see it when I dir

      How do I locate the install folder and access it?

@ososoba

When you install a package, where the package is installed depends on the package maintainer. You can install a package while inside of any directory, though that doesn't mean the package will install there.

If you installed phpMyAdmin using the PPA you've noted, then phpMyAdmin is located here:

/usr/share/phpmyadmin

The phpMyAdmin packages don't auto-configure NGINX by default (as only Apache & Lighttpd are on the list that includes default configurations), so you'd need to setup a location block inside the current server block for your domain to handle requests for phpMyAdmin.

Something such as:

location /phpmyadmin {
    root /usr/share/phpmyadmin;

    try_files $uri $uri/ =404;
}

You would then need to reload NGINX for the changes to take.

systemctl reload nginx

or

service nginx reload
Have another answer? Share your knowledge.