LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2005, 11:53 AM   #1
no_names_left
LQ Newbie
 
Registered: Dec 2004
Posts: 19

Rep: Reputation: 0
How can I tell if php is installed?


Hi,

I have a fresh installation of Fedora 2 and can't work out if php is installed or just wrongly confirgured.

I final got apache running after starting the httpd service, not as I would have thought by starting 'apache' service. Is there something similar with php?

Thanks,

James
 
Old 01-05-2005, 11:56 AM   #2
Slayer097
Member
 
Registered: Dec 2004
Distribution: Slack 10
Posts: 59

Rep: Reputation: 15
Create a new php document in your httdocs folder (or another if you changed the /www root) and type:

Code:
<?php phpinfo(); ?>
Save it as phpinfo.php and open Firefox (Mozilla) and go to http://localhost/phpinfo.php. If a page displaying your php info is served, php is properly installed and configured. If not, it is either not configured with Apache or not installed at all.

EDIT: Bad code.
 
Old 01-05-2005, 12:10 PM   #3
no_names_left
LQ Newbie
 
Registered: Dec 2004
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks Slayer097,

my phpinfo.php didn't work. The webpage was black with the source :
<html><body></body></html>

So how can I tell if it badly configured or not installed?
Is there something I can search for on the filesystem?
 
Old 01-05-2005, 12:18 PM   #4
Slayer097
Member
 
Registered: Dec 2004
Distribution: Slack 10
Posts: 59

Rep: Reputation: 15
You misunderstood me. I'm sorry I was under the impression that you have some experience in web development. Open up the php document in a text editor (plain text, not OpenOffice) -- I believe in FC2 you can right-click and open with...) Delete any <html>, <head>, or <body> tags, and copy and paste in that line into it and save it as a php document. Make sure that you open it through localhost (i.e. not through file:///home/www/phpinfo.php), and see if you get the same results.
 
Old 01-05-2005, 12:29 PM   #5
no_names_left
LQ Newbie
 
Registered: Dec 2004
Posts: 19

Original Poster
Rep: Reputation: 0
I have coded with php before and did put the right code in: <? phpinfo(); ?> but the webpage produced was blank - hence me thinking that php wasn't working properly.

I presumed that if apache producted <html><body></body></html> it might mean something.

Hum..
 
Old 01-05-2005, 12:34 PM   #6
Slayer097
Member
 
Registered: Dec 2004
Distribution: Slack 10
Posts: 59

Rep: Reputation: 15
If your browser displayed <html><body></body></html> then the webpage wasn't being served by Apache, just viewed in plain text. Either Apache isn't working or the source of the webpage is:

Code:
<html>
<body>
&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;
</body>
</html>
Chances are Apache isn't serving the webpage (it's not configured properly). Again, check your address bar and make sure your not viewing the file (file:///home....) and going to localhost.
 
Old 01-05-2005, 12:40 PM   #7
no_names_left
LQ Newbie
 
Registered: Dec 2004
Posts: 19

Original Poster
Rep: Reputation: 0
It is difinitively going through the localhost/phpinfo.php and apache is definively working as I have got html files to work.
 
Old 01-05-2005, 12:50 PM   #8
Slayer097
Member
 
Registered: Dec 2004
Distribution: Slack 10
Posts: 59

Rep: Reputation: 15
Hmmm. Have you seen the "Apache has been installed successfully page" yet? Non-dynamic content (html files) can be displayed fine without a web server, but as long as you are going through localhost, that should mean Apache is installed (try going to http://localhost). Otherwise, I can't think of what's wrong.
 
Old 01-05-2005, 12:54 PM   #9
no_names_left
LQ Newbie
 
Registered: Dec 2004
Posts: 19

Original Poster
Rep: Reputation: 0
Question

Yep, I have got the "If you can read this page, it means that the Apache HTTP server installed at this site is working properly".

So I think apache is okay. This all seems rather random to me,

Is there a service to start with php?
 
Old 01-05-2005, 01:12 PM   #10
Slayer097
Member
 
Registered: Dec 2004
Distribution: Slack 10
Posts: 59

Rep: Reputation: 15
I have no idea what's wrong then. I hope you can sort out your problem, but seeing as I'm not running FC2 I don't think I can help you much more. Sorry
 
Old 01-05-2005, 01:40 PM   #11
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
running "$rpm -qa | grep -i php" will confirm whether php is installed or not. If it is, apache on fedora will recognise this.
 
Old 01-05-2005, 01:50 PM   #12
no_names_left
LQ Newbie
 
Registered: Dec 2004
Posts: 19

Original Poster
Rep: Reputation: 0
Hi,
I got the following....

[root@localhost root]# rpm -qa | grep -i php
php-mysql-4.3.10-2.4
php-pgsql-4.3.10-2.4
php-odbc-4.3.10-2.4
php-mbstring-4.3.10-2.4
php-4.3.10-2.4
php-pear-4.3.10-2.4
php-ldap-4.3.10-2.4

So I must have installed.
 
Old 01-05-2005, 04:15 PM   #13
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Yes you do have it installed. Try writing a simple php script and putting it in your webserver directory and see if it works. In fedora core 2 place the test page in /var/www/html and try and access it as follows http://localhost/testpage.php if it's been saved as testpage.php.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I check if PHP is installed? imsam Linux - Newbie 8 02-13-2012 02:51 PM
PHP Installed by default? delamatrix Slackware - Installation 4 11-30-2004 07:45 PM
Is PHP installed on my RH Linux system? stephen_e Linux - General 2 09-16-2004 05:59 AM
installed apache, mysql -- help with php machiner Linux - Software 2 07-28-2004 01:36 PM
PHP installed but not working Pebcak Debian 2 04-30-2004 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration