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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-05-2005, 11:53 AM
|
#1
|
LQ Newbie
Registered: Dec 2004
Posts: 19
Rep:
|
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
|
|
|
01-05-2005, 11:56 AM
|
#2
|
Member
Registered: Dec 2004
Distribution: Slack 10
Posts: 59
Rep:
|
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.
|
|
|
01-05-2005, 12:10 PM
|
#3
|
LQ Newbie
Registered: Dec 2004
Posts: 19
Original Poster
Rep:
|
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?
|
|
|
01-05-2005, 12:18 PM
|
#4
|
Member
Registered: Dec 2004
Distribution: Slack 10
Posts: 59
Rep:
|
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.
|
|
|
01-05-2005, 12:29 PM
|
#5
|
LQ Newbie
Registered: Dec 2004
Posts: 19
Original Poster
Rep:
|
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..
|
|
|
01-05-2005, 12:34 PM
|
#6
|
Member
Registered: Dec 2004
Distribution: Slack 10
Posts: 59
Rep:
|
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>
<html><body></body></html>
</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.
|
|
|
01-05-2005, 12:40 PM
|
#7
|
LQ Newbie
Registered: Dec 2004
Posts: 19
Original Poster
Rep:
|
It is difinitively going through the localhost/phpinfo.php and apache is definively working as I have got html files to work.
|
|
|
01-05-2005, 12:50 PM
|
#8
|
Member
Registered: Dec 2004
Distribution: Slack 10
Posts: 59
Rep:
|
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.
|
|
|
01-05-2005, 12:54 PM
|
#9
|
LQ Newbie
Registered: Dec 2004
Posts: 19
Original Poster
Rep:
|
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?
|
|
|
01-05-2005, 01:12 PM
|
#10
|
Member
Registered: Dec 2004
Distribution: Slack 10
Posts: 59
Rep:
|
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 
|
|
|
01-05-2005, 01:40 PM
|
#11
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
running "$rpm -qa | grep -i php" will confirm whether php is installed or not. If it is, apache on fedora will recognise this.
|
|
|
01-05-2005, 01:50 PM
|
#12
|
LQ Newbie
Registered: Dec 2004
Posts: 19
Original Poster
Rep:
|
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.
|
|
|
01-05-2005, 04:15 PM
|
#13
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 06:31 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|