Installed new version of php but server still uses older version

General Tech Bugs & Fixes 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I just upgraded to PHP 5.4.11 from 5.3.15 following this link. After upgrading I ran php -v but it shows me following output.

Zafarcom/tag/s">s-MacBook-Pro:php-5.4.11 zafar$ php -v
PHP 5.3.15 with Suhocom/tag/s">sin-Patch (cli) (built: Jul 31 2012 14:49:18) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologiecom/tag/s">s

which com/tag/s">saycom/tag/s">s PHP 5.3.15. Then I icom/tag/s">scom/tag/s">sue thicom/tag/s">s command /ucom/tag/s">sr/local/bin/php -v which com/tag/s">showcom/tag/s">s following output

Zafarcom/tag/s">s-MacBook-Pro:/ zafar$ /ucom/tag/s">sr/local/bin/php -v
PHP 5.4.11 (cli) (built: Jan 26 2013 20:10:19) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologiecom/tag/s">s

Which com/tag/s">showcom/tag/s">s PHP 5.4.11. When I icom/tag/s">scom/tag/s">sue which php it com/tag/s">showcom/tag/s">s me thicom/tag/s">s path /ucom/tag/s">sr/bin/php. I tried following to com/tag/s">solve thicom/tag/s">s icom/tag/s">scom/tag/s">sue.

  1. I went to /ucom/tag/s">sr/bin/php and rename that php com/tag/s">s://forum.tuteehub.com/tag/file">file to php_OLD.
  2. Now I made a com/tag/s">symlink in "/ucom/tag/s">sr/bin/" to "/ucom/tag/s">sr/local/bin/php" com/tag/s">s://forum.tuteehub.com/tag/file">file ucom/tag/s">sing following command

    com/tag/s">sudo ln -com/tag/s">s /ucom/tag/s">sr/local/bin/php /ucom/tag/s">sr/bin/php

  3. Now I icom/tag/s">scom/tag/s">sued php -v command which worked and com/tag/s">showed new vercom/tag/s">sion of php.

** But when I created com/tag/phpinfo">phpinfo.php com/tag/s">s://forum.tuteehub.com/tag/file">file with com/tag/phpinfo">phpinfo(); function. It com/tag/s">still ucom/tag/s">secom/tag/s">s older vercom/tag/s">sion of PHP i.e. PHP 5.3.15. why and how can I com/tag/s">solve thicom/tag/s">s problem?**

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.