Can't install PHPMyAdmin in "Blank" workspace template


#1

The installation instructions for PHPMyAdmin no longer work. After creating a fresh workspace, I have the following errors:

defeo:~/workspace (master) $ mysql-ctl install
Installing MySQL
 * Stopping MySQL database server mysqld
   ...done.
 * Starting MySQL database server mysqld
   ...done.
 * Checking for tables which need an upgrade, are corrupt or were 
not closed cleanly.

MySQL 5.5 database added.  Please make note of these credentials:

       Root User: defeo
   Database Name: c9

defeo:~/workspace (master) $ phpmyadmin-ctl install
Starting installation
chmod: cannot access ‘/etc/phpmyadmin/config-db.php’: No such file or directory
chmod: cannot access ‘/var/lib/phpmyadmin/blowfish_secret.inc.php’: No such file or directory
chmod: cannot access ‘/var/lib/phpmyadmin/config.inc.php’: No such file or directory
sed: can't read /etc/phpmyadmin/config.inc.php: No such file or directory
sed: can't read /etc/phpmyadmin/config.inc.php: No such file or directory
sed: can't read /etc/phpmyadmin/config.inc.php: No such file or directory
sed: can't read /etc/phpmyadmin/config.inc.php: No such file or directory
sed: can't read /etc/phpmyadmin/config.inc.php: No such file or directory
sed: can't read /etc/phpmyadmin/config.inc.php: No such file or directory
sed: can't read /etc/phpmyadmin/config-db.php: No such file or directory
sed: can't read /etc/phpmyadmin/config-db.php: No such file or directory
grep: /etc/phpmyadmin/config.inc.php: No such file or directory
sed: can't read /etc/phpmyadmin/config.inc.php: No such file or directory
grep: /etc/phpmyadmin/config.inc.php: No such file or directory
sed: can't read /etc/phpmyadmin/config.inc.php: No such file or directory
Starting MySQL
 * Starting MySQL database server mysqld
   ...done.
Configuring database
gzip: /usr/share/doc/phpmyadmin/examples/create_tables.sql.gz: No such file or directory
Starting apache
 * Restarting web server apache2
   ...fail!
 * The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/phpmyadmin.conf: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.

PHPMyAdmin Installation complete. You can log in at: https://aws-project-defeo-3.c9users.io/phpmyadmin with the following username (and blank password):

       Username: defeo

After these errors, Apache won’t start:

apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/phpmyadmin.conf: No such file or directory                                                                                                   

Setting Up phpMyAdmin
#2

Does this happen on a php workspace or on a custom one?


#3

Custom. It indeed works in a PHP workspace.


#4

have you tried with sudo?


#5

Yes, I sudoed, nothing changed.

Anyway, the phpmyadmin-ctl scripts starts by

# Ensure script always runs as root
if [ "$UID" != "0" ]; then
    sudo -E $0 "$@"
    exit
fi

so sudo is not supposed to change anything. What’s really happening here, is that phpmyadmin is simply not installed anymore in custom workspaces: /etc/phpmyadmin and /var/lib/phpmyadmin do not exist. This might be a deliberate choice by C9, but it is in contraddiction with these instructions: https://docs.c9.io/docs/multiple-ports#section-how-to-run-phpmyadmin-at-the-same-time-as-your-nodejs-ruby-on-rails-or-other-application


#6

Right. Give this a shot in a custom workspace. sudo apt-get install -y phpmyadmin and accept all the defaults and blank mysql password. Apache may fail to start so give it a nudge with sudo apachectl restart then run phpmyadmin-ctl install again.

Custom workspaces don’t come with anything pre-installed other than the absolute defaults. It’s up to you to install what you need. Things like ruby, node.js, python, etc, are pre-installed though. I like it for the simple fact that it doesn’t add a example script to start on.

Cheers.


#7

I already tried this, and, no, doesn’t work:

defeo:~/workspace (master) $ sudo apt-get install phpmyadmin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package phpmyadmin
defeo:~/workspace (master) $ sudo apt-cache search phpmyadmin
defeo:~/workspace (master) $

Custom workspaces don’t come with anything pre-installed other than the absolute defaults. It’s up to you to install what you need. Things like ruby, node.js, python, etc, are pre-installed though. I like it for the simple fact that it doesn’t add a example script to start on.

Custom workspaces came with phpmyadmin installed until one week ago! It is one thing to have a clean workspace dir, another thing to have useful software pre-installed in the VM. C9’s docs and blog posts make it pretty clear that phpmyadmin is supposed to be a native experience in C9, disregarding what kind of workspace you start.


#8

Ok, after doing sudo apt-get update, I can install phpmyadmin via apt.

This is far from the experience offered in PHP workspaces, though: you have to answer a lot of questions, and clicking through gives bad defaults and an unusable install of phpmyadmin.

I use this for teaching a class, I cannot expect my students to correctly setup phpmyadmin manually.

This is a regression in my opinion, and I’d like some official aknowledgement from C9 developers.


#9

I don’t know what changed. Maybe @bradydowling can chime in.


#10

I’m having the same problem – started today and I’m using this for a class as well.

The Apache configuration files that are causing the error (i.e. can’t read) are in the /etc/apache2/sites-enabled folder and the files are links to other places on the server. I compared an account that doesn’t work with one that does and the links are identical, but I can ‘cat’ one of the files that does work, but if I try to ‘cat’ the other one I get a file not found error.


#11

Sorry about this regression. We recently updated the default programs in each workspace type and removed PHPMyAdmin from all the non PHP workspaces. We didn’t realize users wanted to use it in other workspace types.

Are you able to conduct your classes with the PHP workspace type? It still works correctly in it.

I’ve created an internal issue for this and we’ll either re-add PHPMyAdmin into other workspaces or make the install script automatically download and install it so that it works in all workspaces again.


#12

Thanks for the reply. Nothing urgent on my side: today was the last class, and I provided a couple of alternate solutions to my students (use mysql via console, clone an old workspace with a working install).

For next year, whatever solution you come up with to make the phpmyadmin-ctl script work in any workspace will make me happy. I would only be annoyed if I had to specifically tell them to select a PHP workspace: in my setup I make them clone a GitHub repo, hence Custom is selected by default.

Since we are at it, here’s one more suggestion: it would be neat if phpmyadmin-ctl took as optional parameter the port apache listens on. That way, it would be much easier to have phpmyadmin on port 8081. If you think that’s a good idea, I can provide a patch.


#13

and the ability to easily uninstall it. :wink: