Page 1 of 1

how to link httpd and php

Posted: Tue Apr 21, 2009 12:28 pm
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.

Re: how to link httpd and php

Posted: Tue Apr 21, 2009 6:12 pm
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.

Re: how to link httpd and php

Posted: Wed Apr 22, 2009 11:11 am
by bunty82
Wow buddy it really worked .
U r genius thanks