Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I know if PHP is installed? 2

Status
Not open for further replies.

JustKIDn

MIS
May 6, 2002
386
US
I setup a linux box here over a year ago. (Caldera)

At the time I had no projects in mind to do in PHP. So when I did the install I don't know if PHP was an option I included or not.

I was smart enough to install MySQL and Perl. I just don't know about PHP.

Is there something I can look for (a file, directory, command) to see if PHP is installed and what version?

If it is there, I'm sure I'll need to upgrade it. But that could be another question.

tgus

____________________________
Families can be together forever...
 
Are there any references to PHP in httpd.conf? That'll give you an indication that PHP was installed as a module.

At a shell prompt, does "find / -name php" find any files? If so, you have the command-line parser installed. Want the best answers? Ask the best questions: TANSTAAFL!
 
Thanks sleipnir,

I had already tried "find / -name php"
This resulted with nothing.

I looked at the httpd.conf file;

conf]# more httpd.conf |grep php

Include /etc/httpd/conf/modules/mod_php3.conf
Include /etc/httpd/conf/modules/mod_php4.conf
DirectoryIndex index.html index.php3 index.cgi

So httpd.conf has references to PHP.

So I looked in modules and found only mod_php3.conf.

Here is the contents of mod_php3.conf;

modules]# more mod_php3.conf

#
# mod_php3.conf: included by httpd.conf
#

LoadModule php3_module /usr/libexec/apache/mod_php3.so
AddModule mod_php3.c

<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3 .phtml
AddType application/x-httpd-php3-source .phps
</IfModule>

How does this help?
tgus

____________________________
Families can be together forever...
 
Doesn't help me any. But then, I'm not worried about my servers.

This line in httpd.conf:

LoadModule php3_module /usr/libexec/apache/mod_php3.so

Looks like you have PHP 3.x installed. I strongly recommend upgrading before trying to use PHP on that machine. Want the best answers? Ask the best questions: TANSTAAFL!
 
You could just test it by placing a php file with an echo statment in the body (and nothing else) and surfing to 127.0.0.1 ... Upgrading would be a good idea, but then you've alredy heard that advice.
 
O.k. I figured I would need to upgrade.

When I upgrade. Will it automaticaly update itself for Apache?

Should I also consider upgrading Apache?

If so, is there an order of preference when upgrading or installing; PHP, Perl, MySQL, Apache, etc...?

Thanks for your help. sleipnir, I know sometimes you don't hear this enough. But you are a valuable asset to Tek-Tips. I believe you and I both signed up here about the same time. So I've seen a lot of the great help you've been to some of the posters. You are apprieciated!
tgus

____________________________
Families can be together forever...
 
Thank you!

The order of upgrading depends on how you installed the apps originally.

I install MySQL from binary tarball, perl from RPM, and Apache and PHP from source tarballs. So for me, the order of upgrade would be MySQL, perl, Apache, PHP. Want the best answers? Ask the best questions: TANSTAAFL!
 
Thanks,

All of my apps were installed at the same time. When I did the initial Linux install. I haven't installed anything since.

So with that, does order matter?

And if I install PHP x.xx now will it update Apache on it's own or will I need to add something?
tgus

____________________________
Families can be together forever...
 
sleipnir,

I found this FAQ faq436-254 and in it he says the order of install is important.

Do you think this is true?
tgus

____________________________
Families can be together forever...
 
It is. You can't install PHP before Apache and MySQL if you plan on building it as an Apache module with MySQL support. You'd most likely want to install the databases first, then Apache and PHP would come last. //Daniel
 
Thanks guys,

That will help a lot.

I'm trying not to do this the hard way. And I have a better chance with the right instructions.

One more thing:

Everything I've seen talks about installing these things. Nothing has mentioned anything about upgrading.

Do you think I can just install over existing versions of MySQL, Apache, and PHP?
tgus

____________________________
Families can be together forever...
 
Again, I'm installing Apache and PHP from source, and I am still using the 1.3.x versions of Apache. But I can upgrade either of PHP or Apache in place.

[One gotcha with upgrading Apache. If you recompile Apache to a new version, you should also go ahead and recompile and reinstall PHP, even if you are upgrading to the same version of PHP. If you don't sometimes PHP will barf.]


If you should upgrade MySQL from a 3.x version to a 4.x version, I believe there is a script you need to run which will upgrade the MySQL permissions tables to a new structure. Want the best answers? Ask the best questions: TANSTAAFL!
 
Thanks sleipnir,

That gives me a feeling of ease about upgrading, as I have no idea how to do an Uninstall.

I was explaining to my wife what you were telling me so she could understand what all I have to do. When I realized that you and danielhozac seem to be in agreement that it's first MySQL, then Apache, and then PHP but devnull22's answer seems a little different.

At the same time (I think) you are telling me that you agree with devnull22's FAQ. However, devnull22 has his in a slightly different order. His order was; MySQL, then PHP, and then Apache. He also said &quot;The order of installation is important!&quot;

Not to beat a dead horse into the ground. But having never done this before, I really don't want to mess anything up.

It would seem logical to me that you would want to install Apache first before PHP, since PHP needs to have references in Apache and Apache is the web server that needs to know about it's resources.

What do you think?
tgus

____________________________
Families can be together forever...
 
Thanks guys,

I gave you both a S T A R !!! [thumbsup2]

Because I think there were good solid answers in this thread and someone else with similar questions may benefit from it.

tgus

____________________________
Families can be together forever...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top