I am trying to install phpmyadmin on a VPS LEMP-stack.
I created an info.php, which is perfectly reachable when I call my server's IP in my browser, revealing all relevant php-info, i.e. nginx is running.
However, after installing phpmyadmin, which I try to access via http://192.xxx.xxx.x/phpmyadmin/, I get the following error message:
The mysqli extension is missing. Please check your PHP configuration.
I already installed php5-mysql via sudo apt-get install php5-mysql, restarted nginx and cleared my browser-cache, but the situation remains.
Could you please advice me what goes wrong?
mysql and mysqli are two different things.
You have to install the mysqli library:
sudo apt-get install php5-mysqli
Don't forget to also restart the php fpm workers, because that's where the mods get loaded, not in nginx.
/etc/init.d/php5-fpm restart
Update:
I was wrong, the php5-mysql package contains the mysql AND the mysqli library.
It must be enough for you to restart the php workers :-)
Related
I have a server that uses Nginx and PHP-FPM. It was working as well, I executed the following command for some reasons:
apt-get --purge remove php-common
After that, I executed this:
apt-get install php-common php-mysql php-cli
Commands executed successfully, but I get 502 error when I want to access websites on the servers:
It should be noted, there are several projects on this server. And I have nothing inside /etc/nginx/sites-available. I have all configurations under /etc/nginx/conf.d. See:
Each of them is a project. Now, I guess I need to set to PHP-FPM to use conf.d instead of sites-available. Any idea how can I do that?
Could you please help me how can I debug it?
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.
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 :
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:
so i think this is the cause of mySQL.
what is the problem ?
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
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!
I have been trying to figure out for three days why I cannot connect to my Database so I can install Joomla.
I have PHP Installed and in my '.ini' File:'php.ini-development' file I do have mysql and mysqli installed:
I have my SQLServer and Database Connected I am using WorkBench to manage it FYI.
Yet I keep getting this message and I don't have any Database Types in the selection box:
Yes, I have seen many forums on here and everywhere I have been researching it for three days now, although everything has not worked for me. So if you would please help me!
PS: I do have 'public $dbtype = 'mysql';' in my configuration file, so please don't say to do that because that was almost half of what the forums have said. I also have IIS7 installed and running for another website, I don't know if that could be the problem or not if it were interfering with SQL.
In my case, below packages were missing:
- libapache2-mod-auth-mysql
- php5-mysql
I installed them by sudo apt-get install libapache2-mod-auth-mysql php5-mysql and restarted the apache2 & mysql service.
In my case, the problem was on the extension directory configuration, on php.ini. I discovered that, when joomla installation can't access the MySQL extension, or others database extensions, the database is not showed. My property extension_dir was set to the wrong directory, so the PHP wasn't able to load any extension, and of course, joomla installation wasn't able to show any database types to be choosen.
You can search for "extension_dir" property on php.ini file and check if its value is right.
On my CentOS 7 there was "php-pgsql" missing (for PostgreSQL database). Installing it resolved the problem.
\# sudo yum install php-pgsql
\# sudo tail -1 /var/log/yum.log
Dec 21 19:33:35 Installed: php-pgsql-5.4.16-36.el7_1.x86_64
in my case, mysql, the package php-mysql is missed
using this command and then restart apache2
sudo apt install php-mysql
sudo service apache2 restart
I recently discovered NginX, and decided to try it out on my server. I have NginX running and able to serve PHP and HTML files. But now I want to try to install drupal. When trying to install it and check the requirements, I am stopped by one requirement.
PHP extensions Disabled
Drupal requires you to enable the PHP extensions in the following list (see the system requirements page for more information):
gd
I have tried to install gd by doing apt-get install php5-gd, and it says it is already installed. So I created a phpinfo() file, and checked to see if gd was enabled and I wasn't able to find it. Does this have to do with NginX or PHP? What do I do to fix this?
Since you are using Nginx - that must mean you are running PHP with PHP-FPM.
After you install stuff you need to:
sudo /etc/init.d/php-fpm restart
or
service php5-fpm restart
in newer ubuntu versions
so that PHP will pickup the new extensions.
If your web server setup is in order, only install the php gd extension and restart php scripting interpreter and web server.
sudo apt-get install php5-gd
sudo /etc/init.d/php-fastcgi stop
sudo /etc/init.d/php-fastcgi start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx start
Here's a great LEMP tutorial http://library.linode.com/web-servers/nginx/php-fastcgi/ubuntu-10.04-lucid
For future me if I forget this.
If you've been messing around with /etc/php/fpm then you may have accidentally lost the symlink to conf.d which means the gd and PDO load files won't be booted with FPM.
This will be an issue if you're just using the basic config that comes with PHP5-FPM. If you have a custom config you may included the files in a different place.
Solution: Recreate the sym-link.
cd /etc/php5/fpm
sudo ln -s /etc/php5/conf.d /etc/php5/fpm/conf.d
PHP extensions have only to do with PHP. Your choice of webserver (apache, nginx, etc) do not affect them. Most likely you just need to enable the gd extension. If you are on Ubuntu, check /etc/php5/conf.d folder and add a gd.ini with the following line:
extension=gd.so
if you are using centos 7 and you can't find /etc/init.d/php-fpm, you may try systemctl restart php-fpm, that worked for me.
I encountered the same problem with making sudo apt-get install php5-gd to work. Console output suggested to do sudo apt-get update. Just basic updating on all your packages.
After updating, I run sudo apt-get instal php5-gd and it did all heavy lifting for me, including restarting php5-fpm and correctly installing everything in between.