I have a problem with phpmyadmin on ubuntu 12.04.
I have already installed apache2, php5, mysql and phpmyadmin.
The phpinfo(); script, don't show nothing about mysqli or mysql extension.
When I try start phpmyadmin this error appear:
----
**phpMyAdmin - Error**
-------
**The mysqli extension is missing. Please check your PHP configuration.**
----
In the php.ini file, I uncommented extension=mysql.so line, but doesn't work...
Anyone have another posible solution?
Latest phpMyAdmin versions require mysqli extension and will no longer work with mysql one (note the extra "i" at the end of its name).
For PHP 7.3
sudo apt-get install php7.3-mysqli
For PHP 8
sudo apt-get install php8.0-mysqli
Will install package containing both old one and the new one, so afterwards all you need to do is to add
extension=mysqli.so
in your php.ini, under the subject Dynamic Extensions.
Restart apache:
sudo systemctl restart apache2
Authenticate if needed and press enter.
Should be done! If problem still occurs remove the browser cache.
sudo apt-get install php5-mysql
sudo apt-get install php5-mysqlnd
try both of alternatively it works for me
If you run PHPMyAdmin on localhost uncomment in file /etc/php5/apache2/php.ini this line:
mysqli.allow_local_infile = On
Restart Apache:
sudo /etc/init.d/apache2 restart
Just restart the apache2 and mysql:
apache2: sudo /etc/init.d/apache2 restart
mysql: sudo /etc/init.d/mysql restart
then refresh your browser, enjoy phpmyadmin :)
I tried a lot of the answers and none of them seemed to work because php7.0 is not the default.
sudo apt-get upgrade
seemed to do the job for me but I had to reinstall php7.0 and phpmyadmin after that:
sudo apt-get install php7.0 php7.0-mysql
sudo apt-get install apache2 apache2-mod-php7.0
sudo apt-get install phpmyadmin
Hope it helps!
I faced same issue and resolved it by doing following steps:
First check PHP versions. If you have multiple PHP Versions. Suppose you have PHP versions like php7.0, php7.1 and php 7.2 then
run these commands
For PHP7.0
sudo apt-get install php7.0-mysql
sudo apt-get install php7.0-mysqlnd
For PHP7.1
sudo apt-get install php7.1-mysql
sudo apt-get install php7.1-mysqlnd
For PHP7.2
sudo apt-get install php7.2-mysql
sudo apt-get install php7.2-mysqlnd
For PHP7.3
sudo apt-get install php7.3-mysql
sudo apt-get install php7.3-mysqlnd
Edit the ini file and look for mysqli. Uncomment the line by removing ;
for all php versions
extension=mysqli.so
/etc/php/<php.version>/apache2/php.ini
For PHP7.0
sudo nano /etc/php/7.0/apache2/php.ini
For PHP7.1
sudo nano /etc/php/7.1/apache2/php.ini
For PHP7.2
sudo nano /etc/php/7.2/apache2/php.ini
For PHP7.3
sudo nano /etc/php/7.3/apache2/php.ini
and last restart apache server
sudo /etc/init.d/apache2 restart
I solved this problem by editing /usr/local/zend/etc/php.ini.
(found it by doing netstat -nlp ¦ grep apache, then strace -p somepid ¦ grep php.ini).
At the end of the file, I added:
extension=/usr/lib/php5/20090626+lfs/mysql.so
extension=/usr/lib/php5/20090626+lfs/mysqli.so
extension=/usr/lib/php5/20090626+lfs/mcrypt.so
Adding it without the path did not work.
Then after a restart it worked.
For ubuntu user open your terminal and type following command
sudo apt-get install mysql
After that just restart apache2 by typing this
sudo service apache2 restart
refresh you browser and enjoy phhmyadmin
For Ubuntu 20.04 users with php-fpm
I fixed the issue by adding the full path in the php conf:
edit /etc/php/7.4/fpm/conf.d/20-mysqli.ini
and replace
extension=mysqli.so
with:
extension=/usr/lib/php/20190902/mysqli.so
Checking the extension_dir is one of the thing you like to check from phpinfo().In my case it was extension_dir = "./" by default which was wrong. Change it to extension_dir = './ext/' or where all your extension dlls are currently residing.
Just add this line to your php.ini if you are using XAMPP etc. also check if it is already there just remove ; from front of it
extension= php_mysqli.dll
and stop and start apache and MySQL it will work.
You need the MySQLi module. This error usually occurs when manually installing phpMyAdmin.
sudo apt-get install php7.3-mysql
It will return you with.
[Creating config file /etc/php/7.3/mods-available/mysqlnd.ini with new version]
[Creating config file /etc/php/7.3/mods-available/mysqli.ini with new version]
Then.
sudo service apache2 restart.
Then.
Press F5 on your browser.
This worked for me , make a database with a php and mysql script and open up the mysql console and type in create user 'yourName'#'127.0.0.1' and then type in grant all privileges on . to 'yourName'#'127.0.0.1' then open up a browser go to localhost and a database should been made and then go to your phpmyadmin page and you will see it pop up there.
at ubuntu 12.04 i had to change mssql.compatability_mode = On.
put On and works
Since I had this problem following an upgrade, I just disable Apache2-php5
a2dismod php5
and activated php7
a2enmod php7
Hope it may help anybody!
I have encountered the same error on ubuntu and what worked for me was editing 2 lines in /etc/php/7.3/apache2/php.ini
;extension=mysqli to extension=mysqli
and gave the extension variable location to mysqli.so after uncommenting it
extension=/usr/lib/php/20170718/mysqli.so
then restart the service just to make sure
systemctl start mysql
For the record, my system is Ubuntu Server 20.04 and none of the solutions here worked. For me, I installed PHP 7.4 and I had to edit enter code here/etc/php/7.4/apache2/php.ini`.
Within this, search for ;extension=mysqli, uncomment and change mysqli to mysqlnd so it should look like this extension=mysqlnd. I tried using mysqli but I faced the same error as if I didn't enable it but mysqlnd worked for me.
Had the very same problem, but in my case the reason was update of Ubuntu and php version - from 18.04 and php-7.2 up to 20.04 and php-7.4.
The Nginx server was the same, so in my /etc/nginx/sites-available/default was old data:
server {
location /pma {
location ~ ^/pma/(.+\.php)$ {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
}
}
I could not get phpmyadmin to work with any of php.ini changes and all answers from this thread, but at some moment I had opened the /etc/nginx/sites-available/default and realised, that I still had old version of php. So I just changed it to
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
and the issue was gone, phpmyadmin magically started to work without any mysqli-file complaint. I even double checked it, but yeap, that's how it works - if you have wrong version for php-fpm.sock in your nginx config file, your phpmyadmin will not work, but the shown reason will be 'The mysqli extension is missing'
I hope my successful answer helps someone in recent times as I had to try many mix-and-matches and then found it:
This solution worked for me on Ubuntu 20.04 Desktop with PHP v7.4, PHP v8.0.7 and MySQL v8.0.25 setup.
What I did was edited /etc/php/7.4/apache2/php.ini and /etc/php/8.0/apache2/php.ini files and replaced
extension=mysqli.so
with
extension=/usr/lib/php/20190902/mysqli.so
in both the files.
Later, restarted both of these (PHP and MySQL) by sudo systemctl restart apache2 and sudo systemctl restart mysql. Refreshed Chrome, and phpMyAdmin responded with the login screen.
(UPDATE: Please check if you have /usr/lib/php/20200930/mysqli.so file as well. I tested this as it looked newer by directory date, and this too worked in both the PHP files as extension=/usr/lib/php/20200930/mysqli.so)
Related
I installed virtualbox and vagrant, then went to https://puphpet.com and downloaded a package with Ubuntu 16.04. The relevant parts of that package are PHP, MySQL and Apache. It works now, I managed to connect to the server and PHP is running correctly (I installed magento on it).
Now I'm trying to install phpmyadmin, however after running the commands:
sudo apt-get install phpmyadmin
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 restart
When i go to http://{serverIP}/phpmyadmin/ I get the source code of the file that's supposed to be the phpmyadmin login page, like this:
Source
What could be causing this? It can't be that PHP isn't installed correclty, cause I managed to install Magento and it works fine, so what could be the problem?
Edit:
Also in the /etc/apache2/apache.conf file, I added this line at the end of the file:
Include "/etc/phpmyadmin/apache.conf"
Solved it, I needed to run:
sudo apt-get install libapache2-mod-php7.0
I was missing that extension. Also after I installed that extension I got an error saying:
AH00534: apache2: Configuration error: More than one MPM loaded.
I fixed that by runnning:
sudo a2dismod worker
Not sure why this happened.
I have a problem running phpMyAdmin. When I try to access phpMyAdmin in my browser, I get the error message: "The mbstring extension is missing. Please check your PHP configuration."
I have already searched on the internet for possible solutions. According to that, I made some modifications in php.ini file. I uncommented the line ";extension=php_mbstring.dll" and wrote the full path of the ext folder in extension_dir. Sadly, it still doesn't work.
Could you please help me finding the proper solution.
just run these command
sudo apt-get install phpmyadmin php-mbstring php-gettext
sudo service apache2 restart
Or you can follow this post...
Check This Post
I've solved my problem by this way:
Edit the php.ini file:
change extension_dir = "ext" into extension_dir = "D:\php\ext" (please write ur own path)
change ;extension=php_mbstring.dll into extension=php_mbstring.dll (delete the ";")
Then just save your php.ini file and copy it to ur Windows directory。(“C:\Windows“)
restart the apache server。
The above is my solution,Hope it will work for u.
If you are ubuntu 14.04 and using php 5.6
You are missing out on mbstring and mysql module
Please install mbstring and mysql by
sudo apt-get install php5.6-mbstring
sudo apt-get install php5.6-mysql
and restart apache
sudo service apache2 restart
It could happen after you update your php version, for instance if you upgrade from php5.6 to php7.1 you need to run these commands:
sudo apt-get install php7.1-mbstring
sudo service apache2 restart
For php8.1
sudo apt-get install php8.1-mbstring
sudo systemctl restart nginx
If your destination version is different you need to check if the mbstring package exsit or not, an example for php7.0:
sudo apt-cache search php7.0-mbstring
I found it useful to first check existence of all modules that you working with, then performing an upgrade, in addition to that update phpmyadmin after upgrading your php is a good idea
In my case i made a new installation of php7 using xampp, the error was in php.ini at line 699, i just did
include_path= C:\Program Files (x86)\xampp\php\PEAR
to
include_path= "C:\Program Files (x86)\xampp\php\PEAR"
and it worked for me.
I checked this by running the php.exe it gave me that error and i fixed it.
Change extension_dir = "ext" to extension_dir = "C:/php/ext" in php.ini.
It could raise the concern if you're either:
Case 1: Downgrading/ upgrading any PHP version.
Case 2: Enabling/Disabling (Switching) between PHP versions.
Here are some recommended commands I found helpful to fix these concerns:
Message 1: The mbstring extension is missing.......
sudo apt-get install php7.1-mbstring
Message 2: The mysqli extension is missing.......
sudo apt-get install php7.1-mysqli
Note: Tested with PHP version 7.1. Change PHP version as per requirement.
I have solved my problem by this way:
Edit the c:\php\php.ini file:
change extension_dir = "ext" into extension_dir = "c:\php\ext" (please write
ur own path)
change ;extension=php_mbstring.dll into extension=php_mbstring.dll (delete
the ";")
restart the apache server。
I Hope it will work for u.
This worked for me on Kali-linux 2018 :
apt-get install php7.0-mbstring
service apache2 restart
You also need to define PHPIniDir - c:/php_install_path
You can try this
sudo apt-get install phpmyadmin php-mbstring php-gettext
sudo ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin
service apache2 restart
this ones solved my problem
1.open command prompt in administration
then open apache bin folder like this,
c:\ cd wamp\bin\apache\apache2.4.17\bin>
then type after the above
c:\ cd wamp\bin\apache\apache2.4.17\bin> mklink php.ini d:\wamp\bin\php\php5.6.15\phpForApache.ini
thats it close the command prompt and restart the wamp and open it in admin mode.
original post : PHP: No php.ini file thanks to xiao.
before you do other way, please do open php.exe on your PHP folder.
run it and if you faced any error statement on it, you can fix it manually.
else, do most-usefull post in this thread.
I see this error after I disabled php5.6 and enabled php7.3 in ubuntu18.0.4
so i reverse it and problem resolved :DDD
This worked for me on Ubuntu with PHP 8:
sudo apt-get install php8.0-mbstring
I'm following this link: click here!
I ran
sudo apt-get update && sudo apt-get install phpmyadmin
Then I restarted apache2 by using this command:
sudo service apache2 restart
Then I went to http://localhost/phpmyadmin in browser and I got this error:
Not Found
The requested URL /phpmyadmin was not found on this server.
Where did things go wrong?
P.S: This is the 3rd time that I'm trying to install phpmyadmin.
Look at this: http://tecadmin.net/install-phpmyadmin-in-ubuntu/
You have to edit your conf file
You must have a LAMP server in order to work with phpmyadmin.
In your case, I think you haven't installed MySQL.
You can install the entire LAMP by the following command.
sudo apt-get install lamp-server^
It’s important to remember the caret (^) at the end of the command.
During the installation, MySQL will ask you to set a root password.
Step by step installation of LAMP server is described in this link.
As you have already installed phpmyadmin, you now need to configure apache.
sudo nano /etc/apache2/apache2.conf
Add the following to the bottom of the file:
# phpMyAdmin Configuration
Include /etc/phpmyadmin/apache.conf
Restart apache with the following command.
sudo service apache2 restart
Now phpmysql will be working in http://localhost/phpmyadmin/.
Months ago I made a short code that uses mb_strimwidth() to exactly fit some text into a table cell, putting dots at the end of a truncated string.
Now, after some times, I tried to execute that same code and it went out with this error:
Fatal error: Call to undefined function mb_strimwidth() in ...
I tried to find the mbstring.php file, and when I found the mb_strimwidth() function, I discovered that it is not implemented anymore. How is that possible?
But my main question is: how can I get the same result as mb_strimwidth()?
I thought to rewrite the function using a loop and mb_strwidth(), but ALL the functions in that mbstring.php file are empty.
All mb_* functions are provided by a PHP extension called Multibyte String, internal name mbstring
You probably don't have the extension active or installed. On most Linux distros you can install the package php-mbstring to install and activate this extension.
Apache needs to be restarted afterwards if you are using mod_php
Just got this issue, if you are using linux just install the package php-mbstringand restart Apache.
sudo apt-get install php-mbstring
sudo service apache2 restart
If you are using specific PHP version, you may need to run the following:
sudo apt-get install php7.x-mbstring
sudo service apache2 restart
Replace 7.x by the exact PHP version.
u need to install php-mbstring package try.
check php version
php -v
then check mbstring already install and enable
php -i | grep mbstring
if not installed run this command
sudo apt-get install php-mbstring
if you are php other version example : 7.1, 7.2, 7.0 based on
run command like this :
sudo apt-get install php7.1-mbstring
if you are using nginx server for run laravel .. then check nginx configration file which version u have loaded in conf file..
go to cd /etc/nginx/sites-available and open your configuration file..
if you are loading php7.2 version in nginx conf file..
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
then u need to install 7.2 mbstring package..
sudo apt-get install php7.2-mbstring
and restart apache2 server
sudo service apache2 restart
if you already installed mbstring then you have to call this extension on php.ini file.
First, detect where is your php-fpm.ini file or php.ini.
run command
php -i | grep php.ini
it returns you path of php.ini file.
for example
/etc/php.ini
then open file with VIM or another editor
vim /etc/php.ini
and then add mbstring extension to php.ini file
extension=mbstring.so;
finally, restart php-fpm
systemctl restart php-fpm
I have a problem with phpmyadmin on ubuntu 12.04.
I have already installed apache2, php5, mysql and phpmyadmin.
The phpinfo(); script, don't show nothing about mysqli or mysql extension.
When I try start phpmyadmin this error appear:
----
**phpMyAdmin - Error**
-------
**The mysqli extension is missing. Please check your PHP configuration.**
----
In the php.ini file, I uncommented extension=mysql.so line, but doesn't work...
Anyone have another posible solution?
Latest phpMyAdmin versions require mysqli extension and will no longer work with mysql one (note the extra "i" at the end of its name).
For PHP 7.3
sudo apt-get install php7.3-mysqli
For PHP 8
sudo apt-get install php8.0-mysqli
Will install package containing both old one and the new one, so afterwards all you need to do is to add
extension=mysqli.so
in your php.ini, under the subject Dynamic Extensions.
Restart apache:
sudo systemctl restart apache2
Authenticate if needed and press enter.
Should be done! If problem still occurs remove the browser cache.
sudo apt-get install php5-mysql
sudo apt-get install php5-mysqlnd
try both of alternatively it works for me
If you run PHPMyAdmin on localhost uncomment in file /etc/php5/apache2/php.ini this line:
mysqli.allow_local_infile = On
Restart Apache:
sudo /etc/init.d/apache2 restart
Just restart the apache2 and mysql:
apache2: sudo /etc/init.d/apache2 restart
mysql: sudo /etc/init.d/mysql restart
then refresh your browser, enjoy phpmyadmin :)
I tried a lot of the answers and none of them seemed to work because php7.0 is not the default.
sudo apt-get upgrade
seemed to do the job for me but I had to reinstall php7.0 and phpmyadmin after that:
sudo apt-get install php7.0 php7.0-mysql
sudo apt-get install apache2 apache2-mod-php7.0
sudo apt-get install phpmyadmin
Hope it helps!
I faced same issue and resolved it by doing following steps:
First check PHP versions. If you have multiple PHP Versions. Suppose you have PHP versions like php7.0, php7.1 and php 7.2 then
run these commands
For PHP7.0
sudo apt-get install php7.0-mysql
sudo apt-get install php7.0-mysqlnd
For PHP7.1
sudo apt-get install php7.1-mysql
sudo apt-get install php7.1-mysqlnd
For PHP7.2
sudo apt-get install php7.2-mysql
sudo apt-get install php7.2-mysqlnd
For PHP7.3
sudo apt-get install php7.3-mysql
sudo apt-get install php7.3-mysqlnd
Edit the ini file and look for mysqli. Uncomment the line by removing ;
for all php versions
extension=mysqli.so
/etc/php/<php.version>/apache2/php.ini
For PHP7.0
sudo nano /etc/php/7.0/apache2/php.ini
For PHP7.1
sudo nano /etc/php/7.1/apache2/php.ini
For PHP7.2
sudo nano /etc/php/7.2/apache2/php.ini
For PHP7.3
sudo nano /etc/php/7.3/apache2/php.ini
and last restart apache server
sudo /etc/init.d/apache2 restart
I solved this problem by editing /usr/local/zend/etc/php.ini.
(found it by doing netstat -nlp ¦ grep apache, then strace -p somepid ¦ grep php.ini).
At the end of the file, I added:
extension=/usr/lib/php5/20090626+lfs/mysql.so
extension=/usr/lib/php5/20090626+lfs/mysqli.so
extension=/usr/lib/php5/20090626+lfs/mcrypt.so
Adding it without the path did not work.
Then after a restart it worked.
For ubuntu user open your terminal and type following command
sudo apt-get install mysql
After that just restart apache2 by typing this
sudo service apache2 restart
refresh you browser and enjoy phhmyadmin
For Ubuntu 20.04 users with php-fpm
I fixed the issue by adding the full path in the php conf:
edit /etc/php/7.4/fpm/conf.d/20-mysqli.ini
and replace
extension=mysqli.so
with:
extension=/usr/lib/php/20190902/mysqli.so
Checking the extension_dir is one of the thing you like to check from phpinfo().In my case it was extension_dir = "./" by default which was wrong. Change it to extension_dir = './ext/' or where all your extension dlls are currently residing.
Just add this line to your php.ini if you are using XAMPP etc. also check if it is already there just remove ; from front of it
extension= php_mysqli.dll
and stop and start apache and MySQL it will work.
You need the MySQLi module. This error usually occurs when manually installing phpMyAdmin.
sudo apt-get install php7.3-mysql
It will return you with.
[Creating config file /etc/php/7.3/mods-available/mysqlnd.ini with new version]
[Creating config file /etc/php/7.3/mods-available/mysqli.ini with new version]
Then.
sudo service apache2 restart.
Then.
Press F5 on your browser.
This worked for me , make a database with a php and mysql script and open up the mysql console and type in create user 'yourName'#'127.0.0.1' and then type in grant all privileges on . to 'yourName'#'127.0.0.1' then open up a browser go to localhost and a database should been made and then go to your phpmyadmin page and you will see it pop up there.
at ubuntu 12.04 i had to change mssql.compatability_mode = On.
put On and works
Since I had this problem following an upgrade, I just disable Apache2-php5
a2dismod php5
and activated php7
a2enmod php7
Hope it may help anybody!
I have encountered the same error on ubuntu and what worked for me was editing 2 lines in /etc/php/7.3/apache2/php.ini
;extension=mysqli to extension=mysqli
and gave the extension variable location to mysqli.so after uncommenting it
extension=/usr/lib/php/20170718/mysqli.so
then restart the service just to make sure
systemctl start mysql
For the record, my system is Ubuntu Server 20.04 and none of the solutions here worked. For me, I installed PHP 7.4 and I had to edit enter code here/etc/php/7.4/apache2/php.ini`.
Within this, search for ;extension=mysqli, uncomment and change mysqli to mysqlnd so it should look like this extension=mysqlnd. I tried using mysqli but I faced the same error as if I didn't enable it but mysqlnd worked for me.
Had the very same problem, but in my case the reason was update of Ubuntu and php version - from 18.04 and php-7.2 up to 20.04 and php-7.4.
The Nginx server was the same, so in my /etc/nginx/sites-available/default was old data:
server {
location /pma {
location ~ ^/pma/(.+\.php)$ {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
}
}
I could not get phpmyadmin to work with any of php.ini changes and all answers from this thread, but at some moment I had opened the /etc/nginx/sites-available/default and realised, that I still had old version of php. So I just changed it to
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
and the issue was gone, phpmyadmin magically started to work without any mysqli-file complaint. I even double checked it, but yeap, that's how it works - if you have wrong version for php-fpm.sock in your nginx config file, your phpmyadmin will not work, but the shown reason will be 'The mysqli extension is missing'
I hope my successful answer helps someone in recent times as I had to try many mix-and-matches and then found it:
This solution worked for me on Ubuntu 20.04 Desktop with PHP v7.4, PHP v8.0.7 and MySQL v8.0.25 setup.
What I did was edited /etc/php/7.4/apache2/php.ini and /etc/php/8.0/apache2/php.ini files and replaced
extension=mysqli.so
with
extension=/usr/lib/php/20190902/mysqli.so
in both the files.
Later, restarted both of these (PHP and MySQL) by sudo systemctl restart apache2 and sudo systemctl restart mysql. Refreshed Chrome, and phpMyAdmin responded with the login screen.
(UPDATE: Please check if you have /usr/lib/php/20200930/mysqli.so file as well. I tested this as it looked newer by directory date, and this too worked in both the PHP files as extension=/usr/lib/php/20200930/mysqli.so)