Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizKindly log in to use this feature. We’ll take you to the login page automatically.
LoginGeneral Tech Bugs & Fixes 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
The short answer is, you don't. 5.4 is no longer supported and has known vulnerabilities that will not be fixed.
The only way it's possible is find the source and compile it yourself.
However, this is all for naught. Using sudo apt install php5.6-mysql as explained in Installing PHP 5.6 on Xenial (16.04) will get you what you need.
You need to understand that deprecated isn't the same as removed. mysql() will still work in the 5.5/5.6. It's not recommended to continue using it, but it does work, you'll just need to turn your logging down to rid yourself of the deprecation warnings.
php.ini
error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE
If you're receiving an error related to an undefined function, that means it's unable to call the function you're trying to use. In your case, it would be most likely due to missing the php5.6-mysql module.
Some basic modules you'll most likely need, in addition to php5.6-mysql is included in the following line.
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
I was moving some sites from a server to a new one. A few sites would not work after moving them. One of them said "MySQL not supported by your PHP version". After searching, it seems to be caused by deprecated mysql extension. So I thought changing php version to same as old server would resolve this - old server php version is 5.4.45
I tried following some answers to similar questions but nothing worked. I did this one but since mysql is already deprecated in php5.6, this wouldn't fix my problem: How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04?
Tried these ones also: How do I install different (upgrade or downgrade) PHP version in still supported Ubuntu release?
How to downgrade PHP from 5.5.9 to 5.4 in Ubuntu 14.04 (Installed with LAMP)
I guess that since these questions are a few years old already, resources might not be available anymore.
Can anyone tell me a way to install php 5.4 that will work in present time?
Additional info: - ubuntu 16.04