php5 and php5

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
johnhelen
Forum Commoner
Posts: 45
Joined: Mon Feb 19, 2007 9:17 pm

php5 and php5

Post by johnhelen »

Hello

In my computer, I create a php file with a phpinfo() function in /var/www folder and run http://localhost:8080 I know that it is php4.

However, when I run php -v (using command line ) I see it is version 5.3. Why that.
Also how I can run both php4 and php5 in my computer

Many thanks
;
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: php5 and php5

Post by John Cartwright »

johnhelen wrote:Hello

In my computer, I create a php file with a phpinfo() function in /var/www folder and run http://localhost:8080 I know that it is php4.

However, when I run php -v (using command line ) I see it is version 5.3. Why that.
Also how I can run both php4 and php5 in my computer

Many thanks
;
I may be completely wrong but I believe having php as both CLI and CGI requires two seperate installations. Somebody correct me?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

I had that exact problem on my server. Found out that both 4 and 5 were installed, and *.php used 4, and *.php5 used 5. Does it fix the problem?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

I'd need to see your Apache configuration to say conclusively, but it sounds like Apache is using one PHP binary, and the PHP4 binary is being found from your PATH. Crack open httpd.conf and search for php

If you want to run both from Apache, you'll need to fiddle around with the configuration. Google for the instructions; many people have done this before.
Post Reply