Upgrading PHP CLI version on macHow can I prevent SQL injection in PHP?PHP: Delete an element from an arrayXAMPP or MAMP on Mac OS X 10.6.2 (Snow Leopard)Reference — What does this symbol mean in PHP?Find (and kill) process locking port 3000 on MacHow to upgrade Git to latest version on OS X?Upgrade Node.js to the latest version on Mac OSWhy shouldn't I use mysql_* functions in PHP?Postgres could not connect to serverPHP (Xampp vs Mamp)

Betweenness centrality formula

Could the terminal length of components like resistors be reduced?

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

'It addicted me, with one taste.' Can 'addict' be used transitively?

Why does nature favour the Laplacian?

"The cow" OR "a cow" OR "cows" in this context

What are the steps to solving this definite integral?

Does a large simulator bay have standard public address announcements?

How to limit Drive Letters Windows assigns to new removable USB drives

Was there a shared-world project before "Thieves World"?

Are there physical dangers to preparing a prepared piano?

What makes accurate emulation of old systems a difficult task?

How to pronounce 'c++' in Spanish

What term is being referred to with "reflected-sound-of-underground-spirits"?

How can the Githyanki Supreme Commander move while insubstantial?

Does tea made with boiling water cool faster than tea made with boiled (but still hot) water?

Is there a way to generate a list of distinct numbers such that no two subsets ever have an equal sum?

What does the integral of a function times a function of a random variable represent, conceptually?

Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

How to fry ground beef so it is well-browned

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

"Hidden" theta-term in Hamiltonian formulation of Yang-Mills theory

Why did C use the -> operator instead of reusing the . operator?



Upgrading PHP CLI version on mac


How can I prevent SQL injection in PHP?PHP: Delete an element from an arrayXAMPP or MAMP on Mac OS X 10.6.2 (Snow Leopard)Reference — What does this symbol mean in PHP?Find (and kill) process locking port 3000 on MacHow to upgrade Git to latest version on OS X?Upgrade Node.js to the latest version on Mac OSWhy shouldn't I use mysql_* functions in PHP?Postgres could not connect to serverPHP (Xampp vs Mamp)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I just now bought new Macbook Pro for development purpose. I did a small research and install MAMP on Mojave OS for my current project but happen to see my PHP CLI version is 7.1.23 and was unable to upgrade, coming from Windows background I have a lot of experience in XAMPP. I found the MAC OS installer and did my in installation with latest version of PHP available. As I wanted latest PHP for my project.



Now when I see phpinfo(); through my XAMPP localhot I can see PHP version 7.3 but when I go to terminal I see the same old version. I tried updating the PHP using this link but no luck in updating PHP CLI version.



PHP Xampp Version



And in CLI



CLI Version



Help me out with this. Thanks.










share|improve this question






















  • Which php executable is being used at the command line? You can find out with the command type php.

    – Gordon Davisson
    Mar 9 at 8:46











  • Try which php

    – shingo
    Mar 9 at 8:53











  • or php -v for version. or php --version

    – ArtisticPhoenix
    Mar 9 at 10:17


















0















I just now bought new Macbook Pro for development purpose. I did a small research and install MAMP on Mojave OS for my current project but happen to see my PHP CLI version is 7.1.23 and was unable to upgrade, coming from Windows background I have a lot of experience in XAMPP. I found the MAC OS installer and did my in installation with latest version of PHP available. As I wanted latest PHP for my project.



Now when I see phpinfo(); through my XAMPP localhot I can see PHP version 7.3 but when I go to terminal I see the same old version. I tried updating the PHP using this link but no luck in updating PHP CLI version.



PHP Xampp Version



And in CLI



CLI Version



Help me out with this. Thanks.










share|improve this question






















  • Which php executable is being used at the command line? You can find out with the command type php.

    – Gordon Davisson
    Mar 9 at 8:46











  • Try which php

    – shingo
    Mar 9 at 8:53











  • or php -v for version. or php --version

    – ArtisticPhoenix
    Mar 9 at 10:17














0












0








0








I just now bought new Macbook Pro for development purpose. I did a small research and install MAMP on Mojave OS for my current project but happen to see my PHP CLI version is 7.1.23 and was unable to upgrade, coming from Windows background I have a lot of experience in XAMPP. I found the MAC OS installer and did my in installation with latest version of PHP available. As I wanted latest PHP for my project.



Now when I see phpinfo(); through my XAMPP localhot I can see PHP version 7.3 but when I go to terminal I see the same old version. I tried updating the PHP using this link but no luck in updating PHP CLI version.



PHP Xampp Version



And in CLI



CLI Version



Help me out with this. Thanks.










share|improve this question














I just now bought new Macbook Pro for development purpose. I did a small research and install MAMP on Mojave OS for my current project but happen to see my PHP CLI version is 7.1.23 and was unable to upgrade, coming from Windows background I have a lot of experience in XAMPP. I found the MAC OS installer and did my in installation with latest version of PHP available. As I wanted latest PHP for my project.



Now when I see phpinfo(); through my XAMPP localhot I can see PHP version 7.3 but when I go to terminal I see the same old version. I tried updating the PHP using this link but no luck in updating PHP CLI version.



PHP Xampp Version



And in CLI



CLI Version



Help me out with this. Thanks.







php macos xampp mamp






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 9 at 8:39









Nitish KumarNitish Kumar

1,98053068




1,98053068












  • Which php executable is being used at the command line? You can find out with the command type php.

    – Gordon Davisson
    Mar 9 at 8:46











  • Try which php

    – shingo
    Mar 9 at 8:53











  • or php -v for version. or php --version

    – ArtisticPhoenix
    Mar 9 at 10:17


















  • Which php executable is being used at the command line? You can find out with the command type php.

    – Gordon Davisson
    Mar 9 at 8:46











  • Try which php

    – shingo
    Mar 9 at 8:53











  • or php -v for version. or php --version

    – ArtisticPhoenix
    Mar 9 at 10:17

















Which php executable is being used at the command line? You can find out with the command type php.

– Gordon Davisson
Mar 9 at 8:46





Which php executable is being used at the command line? You can find out with the command type php.

– Gordon Davisson
Mar 9 at 8:46













Try which php

– shingo
Mar 9 at 8:53





Try which php

– shingo
Mar 9 at 8:53













or php -v for version. or php --version

– ArtisticPhoenix
Mar 9 at 10:17






or php -v for version. or php --version

– ArtisticPhoenix
Mar 9 at 10:17













1 Answer
1






active

oldest

votes


















1














Run this command:



alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php'


and replace 7.2.7 with your version number.



This will only work until you restart the terminal, in order to keep this change when re-opening the terminal you need to do the following:




  • Open ~/.bash_profile with a text editor of your choice (eg. nano)



    nano ~/.bash_profile




  • Go down to the bottom and add the line from earlier.



    Add alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php' to the bottom of the file. Of course you can replace 7.2.7 with the version of your choice.



Similarly we can do it for XAMPP, like this:



export XAMPP_HOME=/Applications/XAMPP 
export PATH=$XAMPP_HOME/bin:$PATH
export PATH





share|improve this answer

























  • Well I did export XAMPP_HOME=/Applications/XAMPP export PATH=$XAMPP_HOME/bin:$PATH export PATH and it worked as required. Thanks

    – Nitish Kumar
    Mar 11 at 12:14











  • If this is the solution that worked for you, you can mark it as solved.

    – Noah van der Aa
    Mar 11 at 17:16











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075501%2fupgrading-php-cli-version-on-mac%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Run this command:



alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php'


and replace 7.2.7 with your version number.



This will only work until you restart the terminal, in order to keep this change when re-opening the terminal you need to do the following:




  • Open ~/.bash_profile with a text editor of your choice (eg. nano)



    nano ~/.bash_profile




  • Go down to the bottom and add the line from earlier.



    Add alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php' to the bottom of the file. Of course you can replace 7.2.7 with the version of your choice.



Similarly we can do it for XAMPP, like this:



export XAMPP_HOME=/Applications/XAMPP 
export PATH=$XAMPP_HOME/bin:$PATH
export PATH





share|improve this answer

























  • Well I did export XAMPP_HOME=/Applications/XAMPP export PATH=$XAMPP_HOME/bin:$PATH export PATH and it worked as required. Thanks

    – Nitish Kumar
    Mar 11 at 12:14











  • If this is the solution that worked for you, you can mark it as solved.

    – Noah van der Aa
    Mar 11 at 17:16















1














Run this command:



alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php'


and replace 7.2.7 with your version number.



This will only work until you restart the terminal, in order to keep this change when re-opening the terminal you need to do the following:




  • Open ~/.bash_profile with a text editor of your choice (eg. nano)



    nano ~/.bash_profile




  • Go down to the bottom and add the line from earlier.



    Add alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php' to the bottom of the file. Of course you can replace 7.2.7 with the version of your choice.



Similarly we can do it for XAMPP, like this:



export XAMPP_HOME=/Applications/XAMPP 
export PATH=$XAMPP_HOME/bin:$PATH
export PATH





share|improve this answer

























  • Well I did export XAMPP_HOME=/Applications/XAMPP export PATH=$XAMPP_HOME/bin:$PATH export PATH and it worked as required. Thanks

    – Nitish Kumar
    Mar 11 at 12:14











  • If this is the solution that worked for you, you can mark it as solved.

    – Noah van der Aa
    Mar 11 at 17:16













1












1








1







Run this command:



alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php'


and replace 7.2.7 with your version number.



This will only work until you restart the terminal, in order to keep this change when re-opening the terminal you need to do the following:




  • Open ~/.bash_profile with a text editor of your choice (eg. nano)



    nano ~/.bash_profile




  • Go down to the bottom and add the line from earlier.



    Add alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php' to the bottom of the file. Of course you can replace 7.2.7 with the version of your choice.



Similarly we can do it for XAMPP, like this:



export XAMPP_HOME=/Applications/XAMPP 
export PATH=$XAMPP_HOME/bin:$PATH
export PATH





share|improve this answer















Run this command:



alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php'


and replace 7.2.7 with your version number.



This will only work until you restart the terminal, in order to keep this change when re-opening the terminal you need to do the following:




  • Open ~/.bash_profile with a text editor of your choice (eg. nano)



    nano ~/.bash_profile




  • Go down to the bottom and add the line from earlier.



    Add alias php='/Applications/MAMP/bin/php/php7.2.7/bin/php' to the bottom of the file. Of course you can replace 7.2.7 with the version of your choice.



Similarly we can do it for XAMPP, like this:



export XAMPP_HOME=/Applications/XAMPP 
export PATH=$XAMPP_HOME/bin:$PATH
export PATH






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 12 at 17:39









Nitish Kumar

1,98053068




1,98053068










answered Mar 9 at 8:47









Noah van der AaNoah van der Aa

6116




6116












  • Well I did export XAMPP_HOME=/Applications/XAMPP export PATH=$XAMPP_HOME/bin:$PATH export PATH and it worked as required. Thanks

    – Nitish Kumar
    Mar 11 at 12:14











  • If this is the solution that worked for you, you can mark it as solved.

    – Noah van der Aa
    Mar 11 at 17:16

















  • Well I did export XAMPP_HOME=/Applications/XAMPP export PATH=$XAMPP_HOME/bin:$PATH export PATH and it worked as required. Thanks

    – Nitish Kumar
    Mar 11 at 12:14











  • If this is the solution that worked for you, you can mark it as solved.

    – Noah van der Aa
    Mar 11 at 17:16
















Well I did export XAMPP_HOME=/Applications/XAMPP export PATH=$XAMPP_HOME/bin:$PATH export PATH and it worked as required. Thanks

– Nitish Kumar
Mar 11 at 12:14





Well I did export XAMPP_HOME=/Applications/XAMPP export PATH=$XAMPP_HOME/bin:$PATH export PATH and it worked as required. Thanks

– Nitish Kumar
Mar 11 at 12:14













If this is the solution that worked for you, you can mark it as solved.

– Noah van der Aa
Mar 11 at 17:16





If this is the solution that worked for you, you can mark it as solved.

– Noah van der Aa
Mar 11 at 17:16



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075501%2fupgrading-php-cli-version-on-mac%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved