Updated to PHP7 but now cannot install phpMyAdmin

php
phpmyadmin

#1

I’ve successfully updated my workspace to PHP 7.0.2. However during the uninstall of PHP 5 I also lost phpMyAdmin. I’ve tried reinstalling phpMyAdmin with “phpmyadmin-ctl install” but that fails because I purged phpMyAdmin.

I’ve tried reinstalling with apt-get but get this:

$ sudo apt-get install php7.0-cli php-seclib php-gettext
....
The following packages have unmet dependencies:
 php-gettext : Depends: php5 but it is not going to be installed or
                        php5-cli but it is not going to be installed
 php-seclib : Depends: php5 but it is not going to be installed or
                       php5-cli but it is not going to be installed
              Recommends: php5-mcrypt but it is not going to be installed or
                          php5-gmp but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

The latest version is compatible with PHP5 and PHP7 but it seems it always needs PHP5. I have no idea how to manually install.

Can anyone help?


EDIT

Got it work. See reply below.


#2

I got it working… Here is full instructions for PHP 7 + phpMyAdmin

sudo add-apt-repository ppa:ondrej/php-7.0
sudo apt-get update
sudo apt-get -y purge php5 libapache2-mod-php5 php5 php5-cli php5-common php5-curl php5-gd php5-imap php5-intl php5-json php5-mcrypt php5-mysql php5-pspell php5-readline php5-sqlite
sudo apt-get autoremove
sudo apt-get install php7.0
sudo apt-get install php7.0-mysql
mysql-ctl start

**REMEMBER What cloud9 user name you are. This is your mysql username.

sudo rm /etc/apache2/sites-enabled/phpmyadmin.conf

Download phpmyadmin latest from phpmyadmin.net, extract and update contents to c9 workspace. I uploaded to ~/workspace/my/.

Create /my/config/ directory

Run site /my/setup/

Created new server with:
Server name: localhost
Connection type: tcp
Connect without password: on
User for config auth: none
Password for config auth: none
Allow logins without a password: on
Control user: your c9 username
Control pass: none
Click the “SAVE” button. Copy the config.inc.php file out of ~/workspace/my/config/ into ~/workspace/my/ and delete the config folder.

Restart your apache/mysql services and connect to http://localhost/my/


#3

Thanks for posting how you solved it!


#4

2 posts were split to a new topic: Xdebug errors after update to PHP7


#5

Tried to follow these steps to the best of my ability, without actual commands instead of directions its kind of hard to follow.

Not really understadning what to do once I upload PHPMYADMIN to my directory. I’m trying to get it so I can use it in my Laravel app.

I uploaded it to ~/workspace/name/config/setup
cause my config directory holds files for Laravel config…

What is "run/my/setup"
not understanding that. I edited the config.inc.php
moved it
and then it just disappeared…

(master) $ sudo service apache2 restart

  • 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.

#6

NiuWang,

My apologies for my sloppy instructions.

“Run site /my/setup/” --> Run the index.php for phpMyAdmin in /phpmyadmin/setup/. This help create the configuration file for phpMyAdmin. This is the Wizard that the install instructions speak of : http://docs.phpmyadmin.net/en/latest/setup.html#quick-install

Review the above link for details about placing the config file and setting the right access level.

However if your apache2 service cannot start I suspect the problem is not phpMyAdmin as you can run this service without it installed (or even properly configured for that matter).

If you followed the instructions noted, after you installed PHP 7 did you try to start Apache2 service? And did it run? If not you need to tackle that problem first.


#7

sweet got it working thanks.