how to link httpd and php

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
bunty82
Forum Newbie
Posts: 13
Joined: Tue Apr 21, 2009 12:08 pm

how to link httpd and php

Post by bunty82 »

hi friends
i am a new new new person in PHP language.
Couple of days back my .friend taught me how to config the php with httpd(Apache)
i am working on RHEL 5.1 and
my PHP is php 5.1.6-5.el5
and httpd 2.2.3-6.el5
what he did he just installed the rpms.
after that.
He created a file in /root named test.php
and write this coding
<?php
phpinfo ();
?>
and he opened this page in firefox and this page opened showing the database of PHP
i tried the same thing
but getting errors
like
page not found
what the reason behind it
i know its a stupid question still please answer it
i have restarted the httpd services too.
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: how to link httpd and php

Post by Doug G »

Assuming RHEL uses the same web structure as Fedora, you need to put your test.php file in /var/www/html/ which is the default root of your apache website. Then you open a web browser to http://localhost/test.php and it should show you your php configuration.

In case you weren't, keep in mind you have to open web php files through the web server, you can't navigate directly to the php file in the filesystem and open directly with your browser. PHP requires server processing, and you bypass the server when you open the page directly.
bunty82
Forum Newbie
Posts: 13
Joined: Tue Apr 21, 2009 12:08 pm

Re: how to link httpd and php

Post by bunty82 »

Wow buddy it really worked .
U r genius thanks
Post Reply