Apache, PHP and Percona Database - php

I have just upgraded MySQL 5.0 to Percona XtraDB 5.1. I had to yum remove all the mysql stuff first. Everything was working fine, until I restarted Apache and now I get:
Fatal error: Call to undefined function mysql_connect()
Any ideas? I have a feeling I removed some sort of mysql plugin for apache at the same time.

You need to install the php-mysql library. Depending on your distribution, this may have a slightly different name. Also, I was just experimenting with this on Ubuntu 11.04. Ended up going back to MySQL because PHP-MySQL wouldn't install without libmysqlcient16 which wouldn't install because it conflicted with percona. Hopefully, you don't run into the same problems that I did.

I use the following functional configuration with PHP and Percona on at least 150 servers:
Percona-Server-shared-55-5.5.30-rel30.2.509.rhel6.x86_64
Percona-Server-client-55-5.5.30-rel30.2.509.rhel6.x86_64
Percona-Server-server-55-5.5.30-rel30.2.509.rhel6.x86_64
Percona-Server-devel-55-5.5.30-rel30.2.509.rhel6.x86_64
Percona-Server-shared-compat-5.5.30-rel30.2.509.rhel6.x86_64
php-5.3.3-22.el6.x86_64
php-xml-5.3.3-22.el6.x86_64
php-cli-5.3.3-22.el6.x86_64
php-pdo-5.3.3-22.el6.x86_64
php-mcrypt-5.3.3-1.el6.x86_64
php-xmlrpc-5.3.3-22.el6.x86_64
php-common-5.3.3-22.el6.x86_64
php-mysql-5.3.3-22.el6.x86_64
As for the error libmysqlcient16.so is, resolvable by installing Percona-Server-shared-compat-[version].rpm.

Related

How to install phpMyAdmin only with PHP7.3 on Ubuntu 18.04?

I have an Ubuntu 18.04 server with Apache, PHP7.3, and MariaDB.
Now I need to install phpmyadmin and I tried to do that using the code below:
apt install phpmyadmin
But this command will install and replace the PHP7.4 with PHP7.3, whereas I need to keep using PHP7.3.
How can I do this?
How have you installed PHP 7.4, since Ubuntu Bionic (18.04) includes PHP 7.2 (https://packages.ubuntu.com/bionic/php)?
You seem to have gone outside of the standard packages (perhaps you're using the excellent effots provided by Ondřej Surý at https://deb.sury.org/). In this case, it's going to cause you some amount of grief to mix and match the newer PHP with the distribution's phpMyAdmin, because of these dependency problems.
You could force the matter. This is probably going to cause you problems, since Bionic packages phpMyAdmin 4.6.6, which is only supported up to PHP 7.1. https://serverfault.com/questions/250224/how-do-i-get-apt-get-to-ignore-some-dependencies has some instructions on ignoring the dependencies. I recommend avoiding this solution.
You could install your own phpMyAdmin. Download the source from phpmyadmin.net and uncompress it to your web root. You may need to add a short configuration file, config.inc.php, but mostly it just works with the default settings. https://docs.phpmyadmin.net/en/latest/setup.html has a quick start section.
You could downgrade your PHP, but you've already stated this isn't a good option for you, and I'm not sure how the Ubuntu package managers get phpMyAdmin working with this newer PHP version.
Clearly, I think the best solution for you to is to install your own phpMyAdmin.

How to run PHP with Firebird InterBase in VestaCP (CentOS)

I'm running VPS with VestaCP (CentOS) and I had previously installed InterBase for PHP 7.0.30, but after an yum-update and v-update-sys-vesta-all interbase was no longer running.
Here is what I've got so far:
Okay soo with new update the new PHP 7.1.17 version was installed. Allright, but the interbase module is not running with it.
And first thing I did was yum --enablerepo=remi install php71-php-interbase to install interbase for this new PHP version.
Tried to restart but still getting missing InterBase error if I try to use ibase_connect() function - therefor InterBase is still not properly installed.
I tried to follow PHP InterBase documentation on this, but I realized I have to compile it and add extra parameter on run, but the problem is that VestaCP uses different directories and libraries so I don't want to mess up my VPS.
Has anybody dealt with this? Any "howto's" to follow?
This answer is what #Mark Rotteveel already pointed out in the comments, but only with additional steps.
I had to compile PHP 7.1.17 from source with --with-interbase[=DIR] in configuration and then include it in php.ini
[UPDATE]
I found even faster way to do this automatically (if only I had known this earlier I would have saved few hours of research).
Answer
Just run yum -y install php php-interbase and you will be all set.

Php pdo mysql not found

I have already done much digging on installing/enabling PDO mysql extension on stackoverflow and many other sites, so please do not consider this as a duplicate question
I am on centos 6.5 and has php 5.5.26 which was compiled with make, make install (I know this is an older version so please do not close question or suggest updating to new php version. Also cannot install php using yum as this is what has been installed already me and should not be installed/changed).
So when I did compile php and added it to apache, it does not show mysql PDO driver. I tried putting extension=pdo_mysql.so to ini file with no success (yes I did restart the server as well, after making changes).
It shows pdo enabled, but only for drivers pgsql and sqlite.
Also, tried installing php-mysql package using yum. But the issue with yum installation is it installs 5.3.3 version of driver which complains about compatibility issues as my php version is 5.5.26.
So I am not sure what I need to do install pdo mysql extension
#Peter Darmis was right from his comments.
PHP 5.3.3 was not completely uninstalled, don't know why.
There was already a PHP installed manually be compilation and, as I wasn't aware about this, I was using yum for installation of modules and at that time PHP 5.3.3 got installed which I don't know why it dot un-install properly.
So I ended up with 2 PHP versions, so uninstalled PHP 5.3.3 completely using yum and then resolved this issue compiling PHP with pdo options

Install MSSQL Using Composer

I am migrating a Drupal site to another server and keep getting HTTP 500 error in the browser. When I investigate the PHP error log, I see that there is
PHP Fatal error: Call to undefined function sqlsrv_connect()
in one of the files. I am on a Linux environment and have Composer installed. Is there a way to install the mssql extension using the Composer? Alternatively, what is an efficient way to install MSSQL extension?
the SQLSRV functions are only available on Windows machines.
you can try using the ODBC functions, after installing the drivers but you will have to rewrite your code to use them.
if you happen to be running Ubuntu, here's a script for installation.

Can't find MySQL driver anymore (Linux)

Today some of my packages in Ubuntu was upgraded automatically, and I didn't think of what was actually going on.
Ever since the update, my local dev-environment doesn't work anymore. First of by not working was mod_rewrite which I had to enable again using a2enmod. But now I've run into an issue that I can't seem to resolve. My application can't seem to find the PDO MySQL driver. When running the application, I get the error failed to open the DB connection: could not find driver.
This is strange, since if I check the phpinfo() the PDO drivers do support MySQL, and the socket path is a valid path.
pdo_mysql client API version is 5.5.35 according to php info.
PHP5: 5.5.3
MySQL: 5.5.35
Connectionstring
mysql:host=127.0.0.1;dbname=MyDB;port=3306
What could be causing this?
The PHP MySQL driver (mysql.so/mysqli.so) and the PHP PDO MySQL driver (pdo_mysql.so) are two separate modules. You need both of them for PDO functionality with MySQL.
It is quite possible that one of them is missing or of an incompatible version - I do not have an Ubuntu system at hand, but on my RPM-based Linux distribution there is a separate package for each module (php-mysql/php-mysqli and php-pdo_mysql). I also expect PDO to be using the newer mysqli.so driver, rather than the obsolete mysql.so one, so you should verify that one is installed as well.
Try this:
sudo apt-get install -y php5-mysql php5 mysql-client
This should automatically restart your apache if any of the dependencies aren't installed.
Try using vagrant.
Dependencies can be isolated, upgraded and downgraded when you like.
Vagrant

Categories