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 QuizGeneral 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.
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.
Ready 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 have three installed versions of php on my Mac. When I check using phpinfo() via a web browser, the one that is being invoked is version 5.3.15. I would like to switch it to the installed instance that is version 5.4 for the apache module (not needed for the CLI).
The reason I would like to do this is because I have used MacPorts to install php_geoip, but it is for the 5.4 version.
Background
When I use "which" I see the following:
Then checking the version of each of these gives the following:
$ /opt/local/bin/php --version PHP 5.3.19 (cli) (built: Dec 15 2012 01:08:10) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans $ /usr/bin/php --version PHP Warning: PHP Startup: geoip: Unable to initialize module Module compiled with module API=20100525 PHP compiled with module API=20090626 These options need to match in Unknown on line 0 PHP 5.3.15 with Suhosin-Patch (cli) (built: Aug 24 2012 17:45:44) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.2.0-komodo, Copyright (c) 2002-2012, by Derick Rethans $ /opt/local/bin/php54 --version PHP 5.4.10 (cli) (built: Dec 20 2012 19:30:08) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend TechnologiesPlease note that the CLI version checks are only being used to determine the version of each instance. It is actually the proper version of the apache module libphp5.so that I will ultimately need to get working.
As you can see from the above, there is an error message from the 5.3.15 instance which I believe comes from my efforts to try to load geoip.so, as follows:
In other words, I used MacPorts to install php_geoip, and as a part of that it installed the dependence of php54, because the version of geoip.so in the MacPorts ports tree needs php 5.4. I tried making the running php 5.3.15 load geoip.so from the php 5.4 instance, but it does not work, as the error message shows.
Next I tried switching the instance of php to version 5.4 by changing the LoadModule statement as shown here:
However, this prevents php from working at all.
So to solve my problem, I either need to get a php 5.3.15-compatible version of geoip.so, or cause my system to use the php 5.4 instance. Any guidance on either of these approaches is appreciated.