Updating to PHP 5 on Mac OS X 10.4.11

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
mainstreetwebguy
Forum Newbie
Posts: 4
Joined: Tue Jun 10, 2008 8:35 am

Updating to PHP 5 on Mac OS X 10.4.11

Post by mainstreetwebguy »

I'm trying to upgrade to PHP 5 on OS X Tiger 10.4.11 from the default php 4x that came installed and am having problems. I have updated to Apache 2and got it working. I installed php 5 (i thought) and created a phpinfo.php file in text editor but that file still shows php version 4.4.8 when i call it.

If i am in terminal and do php -v it shows php 5.2.6

Question 1 - what could i be missing? is there anything in the httpd.conf file that needs to be modified?

I'm pretty sure that the php 5 is not being used because when i try the "file_put_contents" , i get the error "Fatal error: Call to undefined function: file_put_contents() in /Users/Jason/Sites/php/testing.php on line 15"

any thoughts guys? thanks in advance! i need schooling!
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Updating to PHP 5 on Mac OS X 10.4.11

Post by superdezign »

Do you have multiple versions of Apache / PHP installed at the same time?
mainstreetwebguy
Forum Newbie
Posts: 4
Joined: Tue Jun 10, 2008 8:35 am

Re: Updating to PHP 5 on Mac OS X 10.4.11

Post by mainstreetwebguy »

superdezign wrote:Do you have multiple versions of Apache / PHP installed at the same time?
i really can't say for sure but it would appear so:

I have turned off personal web sharing which i was told would disable the apache1x. i installed apache2 from server logistics (a complete package) and then tried to turn on apache2 by running sudo apachectl start

when i run that it turns personal web sharing back on and my localhost comes back to life which makes me thing apache1x is still installed.

I also believe that php 5 is installed as well as php 4x because typing php -v into the terminal tells me my version is 5.2.6 but when i call a
<?php phpinfo(); ?>it shows 4.4.8

i'm stuck and don't know what to do :-(

let me know if there's any more info i can provide that might help.. as you can probably see... i'm a huge newb
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Updating to PHP 5 on Mac OS X 10.4.11

Post by superdezign »

The problem is likely that you aren't running the server you think you are running. Only one of your Apache servers can be localhost, you know.
mainstreetwebguy
Forum Newbie
Posts: 4
Joined: Tue Jun 10, 2008 8:35 am

Re: Updating to PHP 5 on Mac OS X 10.4.11

Post by mainstreetwebguy »

superdezign wrote:The problem is likely that you aren't running the server you think you are running. Only one of your Apache servers can be localhost, you know.
c'mon i'm not that big of a newb :-)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Updating to PHP 5 on Mac OS X 10.4.11

Post by superdezign »

Then find out which one is taking priority. It's likely the first one since you don't have PHP5 enabled yet. I think phpinfo() tells you the version of your server, as well.
mainstreetwebguy
Forum Newbie
Posts: 4
Joined: Tue Jun 10, 2008 8:35 am

Re: Updating to PHP 5 on Mac OS X 10.4.11

Post by mainstreetwebguy »

Thanks for the help man, you're right.. it shows i'm running the apache1.x

what should i do from here?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Updating to PHP 5 on Mac OS X 10.4.11

Post by superdezign »

Well, you're not on a Windows PC, so that's not something I could exactly help with.
An easy fix would probably be to simply rename the old folder to something different and rename the new folder to the same name as the old one. If that doesn't help, I'd look online for a tutorial on installing Apache 2 on Mac.
Post Reply