1

I want to thank you in advance if you manage to get all the way through this post and give me some ideas. It's a lot.

I am on Ubuntu 16.04 on a 64bit Dell 1820. It is dual boot with Windows, and I've been using this setup since 16.04 came out. I have had no use for Apache, PHP, or MySQL on this setup until now.

I wanted to set up a local Wordpress, so I went to a 'one-click' solution called ampps. This thing bundles over 400 programs in a self contained LAMP. However, the default version of PHP was 5.5, which a great many apps (maybe the majority) reported back through the ampps dashboard that they couldn't use. I figured out how to switch it to PHP 7, whereupon Wordpress informed me that:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

Numerous postings to their support system and forum got me nowhere, so I came here.

It turns out ampps default setup:

  1. has no php.ini file in either 7.0 or 7.1

  2. There are ini files in PHP 5.3 and 5.5

  3. Opening the ini files routes through WINE, and open in a version of notepad. Is that a red flag?

So I thought, what the heck, I've got my own MySQL and PHP 7 as part of Ubuntu 16.04. And I can install and configure Apache. It's been 4 or 5 years, but I've done it. I tried opening mysql directly:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

That's how I learned that I don't have /var/run/mysqld/mysqld.sock. I don't even have /var/run/mysqld!

Stumbling blindly around the internet, I found out that I should check /etc/mysql/my.cnf. But this file only had one line in it:

!includedir /etc/mysql/conf.d/

And all conf.d/mysql.conf has in it is:

[mysql]

So I put the port and localhost in my.cnf, at which point I got a new fatal error.

after restart:

malikarumi@Tetuoan2:~$ mysql mysql: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 19! mysql: [ERROR] Fatal error in defaults handling. Program aborted! malikarumi@Tetuoan2:~$

port=3306 # this is line 19 bind-address=127.0.0.1

Turns out I had to put [mysql] on the first line of my.cnf. Now I was back where I started - nowhere.

I decided I would just start over by removing mysql 5.6 and reinstalling. Well, that didn't go well either:

malikarumi@Tetuoan2:~$ sudo apt-get install mysql-server Reading package lists... Done' 'Building dependency tree
Reading state information... Done The following packages were automatically installed and are no longer required: libmircommon5 linux-headers-4.4.0-78 linux-headers-4.4.0-78-generic linux-headers-4.4.0-79 linux-headers-4.4.0-79-generic linux-image-4.4.0-78-generic linux-image-4.4.0-79-generic linux-image-extra-4.4.0-78-generic linux-image-extra-4.4.0-79-generic linux-signed-image-4.4.0-78-generic linux-signed-image-4.4.0-79-generic Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: libevent-core-2.0-5 libhtml-template-perl mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.7 Suggested packages: libipc-sharedcache-perl tinyca The following packages will be REMOVED: mysql-client-core-5.6 mysql-server-core-5.6 The following NEW packages will be installed: libevent-core-2.0-5 libhtml-template-perl mysql-client-5.7 mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7 0 upgraded, 7 newly installed, 2 to remove and 0 not upgraded. Need to get 18.3 MB of archives. After this operation, 113 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client-core-5.7 amd64 5.7.18-0ubuntu0.16.04.1 [6,340 kB] Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-core-5.7 amd64 5.7.18-0ubuntu0.16.04.1 [7,566 kB] Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client-5.7 amd64 5.7.18-0ubuntu0.16.04.1 [1,725 kB] Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libevent-core-2.0-5 amd64 2.0.21-stable-2ubuntu0.16.04.1 [70.6 kB] Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-5.7 amd64 5.7.18-0ubuntu0.16.04.1 [2,554 kB] Get:6 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libhtml-template-perl all 2.95-2 [60.4 kB] Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server all 5.7.18-0ubuntu0.16.04.1 [10.8 kB] Fetched 18.3 MB in 24s (746 kB/s)
Preconfiguring packages ... dpkg: mysql-client-core-5.6: dependency problems, but removing anyway as you requested: akonadi-backend-mysql depends on mysql-client-core-5.7 | virtual-mysql-client-core; however: Package mysql-client-core-5.7 is not installed. Package virtual-mysql-client-core is not installed. Package mysql-client-core-5.6 which provides virtual-mysql-client-core is to be removed.

(Reading database ... 374021 files and directories currently installed.) Removing mysql-client-core-5.6 (5.6.31-0ubuntu0.15.10.1) ... Processing triggers for man-db (2.7.5-1) ... Selecting previously unselected package mysql-client-core-5.7. (Reading database ... 374013 files and directories currently installed.) Preparing to unpack .../mysql-client-core-5.7_5.7.18-0ubuntu0.16.04.1_amd64.deb ... Unpacking mysql-client-core-5.7 (5.7.18-0ubuntu0.16.04.1) ... Processing triggers for man-db (2.7.5-1) ... dpkg: mysql-server-core-5.6: dependency problems, but removing anyway as you requested: akonadi-backend-mysql depends on mysql-server-core-5.7 | virtual-mysql-server-core; however: Package mysql-server-core-5.7 is not installed. Package virtual-mysql-server-core is not installed. Package mysql-server-core-5.6 which provides virtual-mysql-server-core is to be removed.

(Reading database ... 374022 files and directories currently installed.) Removing mysql-server-core-5.6 (5.6.31-0ubuntu0.15.10.1) ... Processing triggers for man-db (2.7.5-1) ... Selecting previously unselected package mysql-server-core-5.7. (Reading database ... 373927 files and directories currently installed.) Preparing to unpack .../mysql-server-core-5.7_5.7.18-0ubuntu0.16.04.1_amd64.deb ... Unpacking mysql-server-core-5.7 (5.7.18-0ubuntu0.16.04.1) ... Selecting previously unselected package mysql-client-5.7. Preparing to unpack .../mysql-client-5.7_5.7.18-0ubuntu0.16.04.1_amd64.deb ... Unpacking mysql-client-5.7 (5.7.18-0ubuntu0.16.04.1) ... Selecting previously unselected package libevent-core-2.0-5:amd64. Preparing to unpack .../libevent-core-2.0-5_2.0.21-stable-2ubuntu0.16.04.1_amd64.deb ... Unpacking libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ... Selecting previously unselected package mysql-server-5.7. Preparing to unpack .../mysql-server-5.7_5.7.18-0ubuntu0.16.04.1_amd64.deb ... Unpacking mysql-server-5.7 (5.7.18-0ubuntu0.16.04.1) ... Selecting previously unselected package libhtml-template-perl. Preparing to unpack .../libhtml-template-perl_2.95-2_all.deb ... Unpacking libhtml-template-perl (2.95-2) ... Selecting previously unselected package mysql-server. Preparing to unpack .../mysql-server_5.7.18-0ubuntu0.16.04.1_all.deb ... Unpacking mysql-server (5.7.18-0ubuntu0.16.04.1) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for libc-bin (2.23-0ubuntu9) ... /sbin/ldconfig.real: File /usr/local/lib/libQtCore.so is empty, not checked. /sbin/ldconfig.real: /lib/x86_64-linux-gnu/libssl.so.1.0.0 is not a symbolic link

/sbin/ldconfig.real: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 is not a symbolic link

Processing triggers for systemd (229-4ubuntu17) ... Processing triggers for ureadahead (0.100.0-19) ... ureadahead will be reprofiled on next reboot Setting up mysql-client-core-5.7 (5.7.18-0ubuntu0.16.04.1) ... Setting up mysql-server-core-5.7 (5.7.18-0ubuntu0.16.04.1) ... Setting up mysql-client-5.7 (5.7.18-0ubuntu0.16.04.1) ... Setting up libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ... Setting up mysql-server-5.7 (5.7.18-0ubuntu0.16.04.1) ... update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode Renaming removed key_buffer and myisam-recover options (if present) insserv: warning: script 'K01ampps' missing LSB tags and overrides insserv: warning: script 'K01httpd' missing LSB tags and overrides insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: script mysql: service mysql already provided! insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing package mysql-server-5.7 (--configure): subprocess installed post-installation script returned error exit status 1' Setting up libhtml-template-perl (2.95-2) ... dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.7; however: Package mysql-server-5.7 is not configured yet.`

dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Processing triggers for libc-bin (2.23-0ubuntu9) ... /sbin/ldconfig.real: File /usr/local/lib/libQtCore.so is empty, not checked. /sbin/ldconfig.real: /lib/x86_64-linux-gnu/libssl.so.1.0.0 is not a symbolic link

/sbin/ldconfig.real: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 is not a symbolic link

Processing triggers for systemd (229-4ubuntu17) ... Processing triggers for ureadahead (0.100.0-19) ... Errors were encountered while processing: mysql-server-5.7 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1) malikarumi@Tetuoan2:~$

The Canonical/Ubuntu system referred me to the bug tracker: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1623440

But this issue is considered "expired" - not fixed - because there's been no activity for 60 days!!!

Finally, I found out about the command apt-show-versions, ( from here: dpkg won`t install any package) so I tried that to see what I could find out:

malikarumi@Tetuoan2:~$ apt-show-versions The program 'apt-show-versions' is currently not installed. You can install it by typing: sudo apt install apt-show-versions malikarumi@Tetuoan2:~$ sudo apt install apt-show-versions [sudo] password for malikarumi: Reading package lists... Done Building dependency tree
Reading state information... Done The following NEW packages will be installed: apt-show-versions 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 2 not fully installed or removed. Need to get 29.6 kB of archives. After this operation, 163 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 apt-show-versions all 0.22.7 [29.6 kB] Fetched 29.6 kB in 0s (44.9 kB/s)
Selecting previously unselected package apt-show-versions. (Reading database ... 309531 files and directories currently installed.) Preparing to unpack .../apt-show-versions_0.22.7_all.deb ... Unpacking apt-show-versions (0.22.7) ... Processing triggers for man-db (2.7.5-1) ... Setting up mysql-server-5.7 (5.7.18-0ubuntu0.16.04.1) ... Renaming removed key_buffer and myisam-recover options (if present) insserv: warning: script 'K01ampps' missing LSB tags and overrides insserv: warning: script 'K01httpd' missing LSB tags and overrides insserv: Script mongod is broken: incomplete LSB comment. insserv: missing
Required-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: Script mongod is broken: incomplete LSB comment. insserv: missingRequired-Start:' entry: please add even if empty. insserv: missing Required-Stop:' entry: please add even if empty. insserv: script mysql: service mysql already provided! insserv: exiting now! update-rc.d: error: insserv rejected the script header dpkg: error processing package mysql-server-5.7 (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.7; however: Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured Setting up apt-show-versions (0.22.7) ... No apport report written because the error message indicates its a followup error from a previous failure. ** initializing cache. This may take a while ** Errors were encountered while processing: mysql-server-5.7 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)

malikarumi@Tetuoan2:~$ sudo dpkg --audit The following packages have been unpacked but not yet configured. They must be configured using dpkg --configure or the configure menu option in dselect for them to work: mysql-server MySQL database server (metapackage depending on the lates

The following packages are only half configured, probably due to problems configuring them the first time. The configuration should be retried using dpkg --configure <package> or the configure menu option in dselect: mysql-server-5.7 MySQL database server binaries and system database setup

malikarumi@Tetuoan2:~$ sudo dpkg -C The following packages have been unpacked but not yet configured. They must be configured using dpkg --configure or the configure menu option in dselect for them to work: mysql-server MySQL database server (metapackage depending on the lates

The following packages are only half configured, probably due to problems configuring them the first time. The configuration should be retried using dpkg --configure <package> or the configure menu option in dselect: mysql-server-5.7 MySQL database server binaries and system database setup

malikarumi@Tetuoan2:~$ sudo dpkg --configure dpkg: error: --configure needs at least one package name argument

Type dpkg --help for help about installing and deinstalling packages [*]; Use 'apt' or 'aptitude' for user-friendly package management; Type dpkg -Dhelp for a list of dpkg debug flag values; Type dpkg --force-help for a list of forcing options; Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' ! malikarumi@Tetuoan2:~$

I could see I already had a --configure error in the output so I didn't run this.

Unlike the op in that other unix exchange question, I have not (knowingly) mixed OSes, and in other respects my OS seems to be fine, so I have not tried his solution. It is at this point that I came here to post. Suggestions?

closed as off-topic by Kusalananda, schily, msp9011, Jeff Schaller, G-Man Aug 5 '18 at 2:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Kusalananda, schily, msp9011, Jeff Schaller
If this question can be reworded to fit the rules in the help center, please edit the question.

  • A month and no response. I just deleted mysql and ampps completely. Turn the page. – user2354685 Aug 14 '17 at 22:30
0

OK, as you say, deleting it all and starting over is good. First, make sure you are only using the default software repositories, and do an apt-get update.

Here's how I set up my local workstation dev (Mint, but Mint=Ubuntu). Note that this is terribly terribly insecure the way I do it for anything but use on localhost only - you must firewall off the services or bind them ONLY to your loopback adapter.

First, install mysql. You need to be sure you either completely scrubbed the prior version, or remember whatever root password was set. On Mint 19/Ubuntu 18.04 when socket is used instead of network, matching usernames are authenticated automatically and ignore passwords - watch out for that, caused me much wailing and gnashing of teeth on a fresh install.

Anyway, apt-get install mysql-server mysql-client. At some point, I go in and create a basic db and user for it (usually named "lampdev"), but that is done after install...

Next, apache and php and php+mysql support -

apt-get install apache2 libapache2-mod-php php-mysql

I also tend to use both phpmyadmin and mysql-workbench so they both get installed as well.

Here's where the security goes far south -

I then add a group - webdev - and add both my user account and the www-data user to it, and chown -R .webdev the DocumentRoot (/var/www/html) and chmod g+s it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.