Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Becky Castle
Becky Castle
15,294 Points

Need help installing newest version of PHP

I'm trying to install PHP 5.5.14. When I run "php -v" in my Mac terminal, it shows that this new version is running. However, when I call "phpinfo()" in my php file, it shows that I'm only running PHP version 5.3.13. How do I get my coding software to recognize that I've installed a newer version of PHP?

Thanks!

3 Answers

Petros Sordinas
Petros Sordinas
16,181 Points

Yup :) Whatever you're doing on your mac has no impact on your web server.

If your site is on a shared hosting server, it is unlikely you can change the php version. That is controlled by your hosting company (unless they give you some option to do this which I doubt).

What company are you using for hosting your web site?

Becky Castle
Becky Castle
15,294 Points

Petros,

I do believe you answered my question, Buddy Ol' Pal! (I use fatcow webhosting. And I see that the newest version they allow their users to work in is 5.3. So, I sent a message to their support team. We'll see if anything changes.) Thank you so much! I was so confused.

:-D

Petros Sordinas
Petros Sordinas
16,181 Points

Becky,

Are you using MAMP? If I'm not mistaken, MAMP has it's own PHP version installed. When you are serving through the MAMP apache server it will look at the MAMP php installation, not the one you have installed on your Mac.

Becky Castle
Becky Castle
15,294 Points

Hi Petros, Thanks for your reply.
No, I'm not using MAMP; I have a website that I use for tinkering. And I use Coda programming software (on a Mac). So every time I save my file in Coda, I flip over to my website to see the live changes. And when I run phpinfo() it shows me that I'm still using the old version of php. (I feel so ignorant about this.)
And what's really weird to me is it's "Configuration File (php.ini) Path" does not actually exist on my Mac, from what I can see in my terminal. Phpinfo() tells me that the Configuration File Path is at "/usr/local/lib/php-5.3.13/lib". But in my terminal, my "local" directory has no "lib" directory. ( There IS a "lib" folder in my terminal but it's located in the SAME directory as the "local" folder (in the "/usr" folder).) Any enlightenment you can share with me?

Thank you so much! Becky

Petros Sordinas
Petros Sordinas
16,181 Points

Hi Becky,

I haven't used Coda, so I don't know how it works. You mentioned you save a file in Coda and then go to the website and see the live changes. Is that website on the web or is it served locally on your Mac?

Becky Castle
Becky Castle
15,294 Points

It's on the web. Any clues? :-)