Upgraded PHP to 5.6.16 and MySQL Extension not working - php

I was running a very outdated version of PHP version 5.3.3. So I updated it to 5.6.16. However since I've updated I am getting the following error when I try to view my Wordpress site:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
I understand that the reason for this error is because the mysql extension is not being loaded by PHP but I am unsure as to what to do to get this? I've checked my php.ini file and uncommented this line
extension=msql.so
restarted my apache server and no luck!
The Code I am using to check if it is enabled is:
if (extension_loaded('mysql') or extension_loaded('mysqli')) {
echo "Loaded";
}else{
echo "Not Loaded";
}
when I run php -m in my terminal I see mysql is not listed.
Could anyone help me out with getting this to work.
I've also tried running this command yum install php-mysql but I get this error:
Finished Dependency Resolution
Error: php56w-common conflicts with php-common-5.3.3-46.el6_6.i686
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Thanks

Have you tried yum install php56w-mysql?
That should install the 5.6 version of the MySQL libraries. It looks like yum is trying to install the 5.3 version by default. Out of curiosity, what OS is this you are installing on, it might be a little out of date.

Related

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.

installing Mcrypt php extension fails on Ubuntu and Xampp

I installed Xampp on Ubuntu 16 to work with Laravel.
I ran my Laravel code and got this error : Mcrypt PHP extension required.
After that I tried to install Mcrypt on PHP.
I have done these :
sudo apt-get install mcrypt
sudo phpenmod mcrypt
I have also done this : Link
I also restart the all services from Xampp after every change but I still get error on Laravel.
Any idea ?
My PHP version is 7.0.22 and Ubuntu version is 16.04.1 .
Thank you .
Edit 1
I did this and I still see the error.
After trying to many things. I just got rid of this shit by installing both version on my computer.
First I installed php 7.1.19 version.
Secondly I installed php 7.2.15 version
Now I am working perfectly with my project.

Cannot install mbstring php conflict

I am trying to install php-mbstring with php 5.6 and I get this error:
Error: php56w-common conflicts with php-common-5.4.45-3.el6.remi.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I have attempted to install php56-mbstring, but I get the following. I am not sure if this means it is already installed or not:
Nothing to do
What is the most appropriate package to install? Which one should I be trying to resolve and how can I resolve it. Thanks!
I run into same problem with my server running PHP 5.6.17. For me it seems that the extension that I was looking for was php56w-mbstring.x86_64
It can be found from webtatic repository. I don't remember enabling that by myself, but in case it is missing here is the instructions how to enable said repo: http://www.certdepot.net/rhel7-install-webtatic-repository/
You can list available repos in your server by command yum repolist
To search if your repos has something related to mbstring use command yum list *mbstring*
So solution for me was this: yum install php56w-mbstring.x86_64
Finally restart Apache: service httpd restart
By the way, I am running CentOS server so your commands might be slightly different on your OS.
Have you added the module to your PHP.ini file extension=php_mbstring.dll
I tried and tried everything until i came to this link. https://docs.phpmyadmin.net/en/latest/setup.html#debian-setup
I run /usr/sbin/pma-configure and bam I had phpmyadmin working without the mbstring error
there is so many setups now that it is hard to find the one you need.
running ubuntu 14.04 with 4 versions of php installed with virtualmin webmin cp. Debian and Ubuntu changed the way how setup is enabled and disabled. few just happy this is working now. hope this helps you spend less time that i did to find this solution.

Package Requires: libcurl.so.3

Mysql is not working with PHP. I got a blank white page on my website. and I'm looking for the problem, for some reasons, i found out that my php version doesn't have a mysql version. So look for some solutions and here's what I've gone so far.
I tried to update my php version and mysql.
I got this error after executing this command
yum install -y php php-mysql
i have a centOS 6.4 and a php 5.3.3 . and my php doesn't have a mysql support. what should i do?
and after i execute the said command (yum install -y php php-mysql). I got an error message. Is there something wrong with my code?
Error: Package: php-common-5.3.27-2.w5.i386 (webtatic) Requires: libcurl.so.3
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
in my situation I solved my problem by enabling rpmforge-extras repository in yum.repos:
thanks to this
> cat /etc/yum.repos.d/rpmforge.repo
...
[rpmforge-extras]
...
enabled = 0
This is strange as yum typically tries to resolve dependencies. Try installing libcurl manually:
yum install libcurl libcurl-devel

Error installing MongoDb PHP driver with XAMPP on Max OS Lion

I get this error when i try to run following command
sudo pecl install mongo
Error:
...php_mongo.c:22:10: fatal error: 'php.h'
file not found
#include <php.h>
^
1 error generated.
make: *** [php_mongo.lo] Error 1
ERROR: `make' failed
I am new to MAC, please help me to resolve this and get Mongo Working with PHP.
I have installed MacPorts and autoconf
It seems, that you did not install the xampp "Developer Package", required to build additional php extension. You can download the "Developer Package" from:
http://www.apachefriends.org/en/xampp-macosx.html#849
This has already been answered.
Please follow the processes outlined in this answer - Install PECL on Mac OS X 10.6.
I followed the process outlined here http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/, referenced by the above Stackoverflow link and the process for install pear, followed by pecl and subsequently -
sudo pecl install mongo
works perfectly on OSX Lion.
You may need to modify the extensions in /etc/php.ini, however, this is explained in the output after you install the php mongo driver.
It took me the whole day to find this answer, I had tried everything, but this worked finally:
sudo C_INCLUDE_PATH=/usr/local/opt/openssl/include /Applications/XAMPP/xamppfiles/bin/pecl install mongodb
I found this article very helpful. Saved a lot of time after I wasted a lot of time to check other links. I did for MAMP and think will work for XAMPP too.
The thing is MAMP does not ship with all PHP sources to compile pecl mongo file and create mongo.so. All what you need is download php for respective version you are using. I was using php version 5.6.10. I checked php.net site that was having 5.6.13 version. I downloaded sources for this version from PhP.net. Executed "sudo pecl install mongo" again and it worked.

Categories