0

I've probably messed up around while familiarizing with ubuntu 16.04 and commands with terminal. I did installed Ampps stack that initially worked fine but an issue with my cron configuration made me look and probably mess something else with mysql before solve it thanks to the forum.

How can I check and incase clean if there are multiple install of apache-mysql-php and different configuration files?

by typing the following commands via terminal this is what i get:

fabio@fabio-HP-Pavilion-dv6:~$ apache2 -v
Server version: Apache/2.4.18 (Ubuntu)
Server built:   2016-04-15T18:00:57
fabio@fabio-HP-Pavilion-dv6:~$ php -v
Il programma "php" può essere trovato nei seguenti pacchetti:
* php7.0-cli
* hhvm
Provare: sudo apt install <PACCHETTO SELEZIONATO>
fabio@fabio-HP-Pavilion-dv6:~$ mysql -v
ERROR 1045 (28000): Access denied for user 'fabio'@'localhost' (using password: NO)

here seems php ain't installed but it should be since ampps is working but mysql show denied access. but when i run ampps with the following this the result:

fabio@fabio-HP-Pavilion-dv6:~$ cd /usr/local/ampps/
fabio@fabio-HP-Pavilion-dv6:/usr/local/ampps$ sudo ./Ampps
[sudo] password di fabio: 
QSslSocket: cannot resolve SSLv2_client_method
QSslSocket: cannot resolve SSLv2_server_method

The terminal above is now stuck and the ampps windows below is open Ampps dash

from here seems i can start apache but can not stop mysql and/or restart it (but it was working before).

Now when i start apache and visit my localhost/ampps from browser everything seems working and i can access to AMMPS HOME but phpmyadmin doesn't let me in and trow this access denied message

phpmyadmin-error

that obviously seems i denied access to myself somehow and my test website shows exception magento

by looking at the exception log in /usr/local/ampps/www/magento2/var/log this is what i can see:

[2016-07-11 16:03:19] main.CRITICAL: exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/usr/local/ampps/var/mysql.sock' (2)' in /usr/local/ampps/www/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:129
Stack trace: 
#0 /usr/local/ampps/www/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:host=loca...', 'mage761', 'B[7S!3P465', Array)

and it keeps going with listing stack traces from #0 to #31 than by the end of the log file this is what i see

Next exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/usr/local/ampps/var/mysql.sock' (2)' in /usr/local/ampps/www/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144
Stack trace:
#0 /usr/local/ampps/www/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect() 

and than again it lists stack trace form #0 to #30

There is obviously something wrong with mysql configuration or my guess is multiple instances of lamp installed and not properly configured.

thanks everyone

Edit

I have found this related post Should someone install Apache, MySQL etc. or use ready-made packets like XAMPP for PHP development? where another user says that it's better use the build in lamp stack installable via terminal rather than install such applications like XAMPP and so Ampps i suppose.

I did install tasksel as suggested here and will see to install LAMP stack instead of Ampps

So now my question remain pretty much the same..how can i check and clean the system lets say if I have installed both stacks and messed things up?

I probably have run commands and installed again mysql, phpmyadmin and apache2 after ampps was already installed on ubuntu 16.04 but i was totally lost so i'm not totally sure what i did and i would like to start over.

as suggested by Mic0 this is what i get when i type whereis:

fabio@fabio-HP-Pavilion-dv6:/usr/local/ampps$ whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /etc/mysql /usr/share/mysql/usr/share/man/man1/mysql.1.gz
fabio@fabio-HP-Pavilion-dv6:/usr/local/ampps$ whereis apache2
apache2: /usr/sbin/apache2 /usr/lib/apache2 /etc/apache2 /usr/share/man/man8/apache2.8.gz
fabio@fabio-HP-Pavilion-dv6:/usr/local/ampps$ whereis php
php: /usr/lib/php /etc/php /usr/include/php /usr/share/php7.0-common /usr/share/php7.0-readline

is it how it should look like?

2
  • 2
    Why are you using ampp? why not installing lamp itself with tasksel? My suggestion is removing ampp and installing apache/php/mariadb using apt-get or tasksel, in that way we all now exactly where is the configuration files. anyway you can use whereis to check multiple installations. for example whereis php. by the way running to instance of mysql or apache by default is not possible because the first one will use the default ports and the second one can't run properly because the ports are in use.
    – Ravexina
    Jul 11, 2016 at 17:05
  • I did install Ampps because it seems easy and it comes with all installed plus softaculous to install scripts quicly. I was working with it on windows but win 7 os was driving me crazy so i decided just last week to take it down and replace windows with ubuntu 16.04 but I'm not yet familiar with it and command line . . i would just like to replicate my webserver and setup a development environment where work in a comfortable way with softacolous running as well. I did install tasksel and i will see to update the my question with whereis results. thanks about that Mic0
    – user564658
    Jul 11, 2016 at 17:27

1 Answer 1

0

Fixed

running to instance of mysql or apache by default is not possible because the first one will use the default ports and the second one can't run properly because the ports are in use. – Mic0

find out How do I start/stop mysql server? stop it via terminal and restart via ampps worked fine for me.

sudo /etc/init.d/mysql stop
[sudo] password di fabio: 
[ ok ] Stopping mysql (via systemctl): mysql.service.

Once stopped i could start it again from my ammps window, just by pressing start button that wasn't working before. ammps dash working

Refreshed the pages all works.
phpmyadmin working

magento ok

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .