Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I downloaded Macports and run a command I get online, which would install php 5.4. It took a while, but seemed to work successfully. I then copied the php.ini.development and renamed it php.ini like suggested my Mac Ports, however when I type php -v in terminal I still see 5.3

What steps have I missed, what do I need to do to get it to use the php 5.4 :S

share|improve this question

migrated from stackoverflow.com Sep 25 '12 at 19:18

This question came from our site for professional and enthusiast programmers.

    
Download it from php.net and manually compile it. –  slugonamission Sep 25 '12 at 16:52
    
Do a locate php and find out which locations you have a PHP binary in. Then reset your system path so it looks in the 5.4 folder first. –  halfer Sep 25 '12 at 17:04
    
how do I reset my system path to point to the 5.4 folder –  Ben_hawk Sep 25 '12 at 17:20
add comment

2 Answers 2

to invoke your macports php 5.4 install from the command line, use php54, e.g.:

php54 -v
share|improve this answer
add comment

Macports should updated your $PATH automatically. You can verify this by typing the following in your terminal window

~> which php
/opt/local/bin/php

If the path returned from which php is /usr/bin/php you'll need to updated your terminal session, by resetting system path

~> source ~/.profile

Try the which php again. If /usr/bin/php is still returned, add the following line to ~/.profile file

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.