See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

Installed new version of php but server still uses older version

General Tech Bugs & Fixes

Max. 2000 characters



( 5 months 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.

Zafars-MacBook-Pro:php-5.4.11 zafar$ php -v
PHP 5.3.15 with Suhosin-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 Technologies

which says PHP 5.3.15. Then I issue this command /usr/local/bin/php -v which shows following output

Zafars-MacBook-Pro:/ zafar$ /usr/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 Technologies

Which shows PHP 5.4.11. When I issue which php it shows me this path /usr/bin/php. I tried following to solve this issue.

  1. I went to /usr/bin/php and rename that php file to php_OLD.
  2. Now I made a symlink in "/usr/bin/" to "/usr/local/bin/php" file using following command

    sudo ln -s /usr/local/bin/php /usr/bin/php

  3. Now I issued php -v command which worked and showed new version of php.

** But when I created phpinfo.php file with phpinfo(); function. It still uses older version of PHP i.e. PHP 5.3.15. why and how can I solve this problem?**

what's your interest