1

Recently i installed LAMP on Linux Mint. I successfully installed it and now just run this commands on terminal for checking the version :

apache2 -v
php -v
mysql -v

This is the result :

2016-10-22 13:45:33 | SPiDev

I dont have any problem with localhost because now i'm running phpinfo() function correctly and localhost (apache and php) is ok. but for database is that :

in orther to instal phpmyadmin you need to install mysql before cotinunig

so it said that MySQL is needed. as you see i had installed mySQL before and now i have problem with checking the version.

im trying to config phpmyadmin but here is:

2016-10-22 13:49:40 | SPiDev

so i think this is the cause of mySQL.

what is the problem ?

hjpotter92
  • 78,589
  • 36
  • 144
  • 183
SPiDev
  • 11
  • 1
  • Try setting the mysql extension by adding extension=mysqli.so to your php.ini. – 4thfloorstudios Oct 22 '16 at 10:26
  • My OS is Linux Mint, I went to etc/php/7.1 then i found 4 folder. apache2 - cli - fpm - mods available, all this folder's contain php.ini file. which one exactly ? @4thfloorstudios – SPiDev Oct 22 '16 at 10:32
  • Check /etc/php/7.1/apache2/php.ini It should be the correct one but for CLI you should change cli folder php.ini too. Additionally check, if the mysql package for PHP is installed as it isnot default for PHP7 in ubuntu anymore I think. Try it by `sudo apt-get install php-mysql` or take a look here: http://stackoverflow.com/questions/35424982/how-to-enable-mysqli-extension-in-php-7 – 4thfloorstudios Oct 22 '16 at 12:38

2 Answers2

1

As the mysql extension is not part of a default PHP7 installation anymore (http://php.net/manual/de/mysql.php), you need to install it with

sudo apt-get install php-mysql

This should install and activate the mysql drivers. You will have to restart apache afterwards by

sudo service apache2 restart

If you have already the mysql package installed, check the php.ini under /etc/php/7.1/apache2/php.ini for the line

extension=mysql.so

Maybe phpmyadmin works with mysqli (extension=mysqli.so) too.

To install php7 and php5 in parallel, check out this guide:

http://lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu

4thfloorstudios
  • 388
  • 1
  • 6
  • 16
  • check out this http://8pic.ir/images/wz1gre8sje3561sxlik2.png is that ok ? @4thfloorstudios – SPiDev Oct 22 '16 at 13:23
  • Yes, but you may need to change the line to `extension=mysqli.so` as the error message stated a missing mysqli extension and not mysql. mysqli should be contained in the php-mysql package though. – 4thfloorstudios Oct 23 '16 at 10:40
0

I have already solved this problem by searching for a long time. Everytime for the first time you use mysql after you turn on the computer,you should execute the following sentence:

net start mysql80

80 is mysql's version. Remember:you should run the cmd with administrator privileges

Best wishes!