LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2015, 11:25 PM   #1
Huamin
Member
 
Registered: May 2011
Posts: 562

Rep: Reputation: 12
Raise browser


Hi,
Is there one example to display one Web page through the browser, by running one PHP page, within Redhat?
 
Old 05-24-2015, 11:48 PM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Make a file named 'index.php' in the root of apache webserver (/var/www/httpd/html or some similar place) with the these contents:

Code:
<html>
<head>
<title>Php test page</title>
</head>
<body>
<?php echo "Test Php Page";  ?>
</body>
</html>
 
Old 05-25-2015, 08:34 AM   #3
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Thanks a lot.
why do I get these
[root@CentOS65x64 html]# php -f info2.php
<html>
<head>
<title>Show the Name</title>
</head>
<body>
id: 1 - Name: Peter Chan<br></body>
</html>

using these codes?
<html>
<head>
<title>Show the Name</title>
</head>
<body>
<?php
...
?>
</body>
</html>

Last edited by Huamin; 05-25-2015 at 07:41 PM.
 
Old 05-25-2015, 10:05 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,397

Rep: Reputation: 5472Reputation: 5472Reputation: 5472Reputation: 5472Reputation: 5472Reputation: 5472Reputation: 5472Reputation: 5472Reputation: 5472Reputation: 5472Reputation: 5472
php is the command line parser for executing php scripts from the command line. It can not parse HTML code which is why you see the tags and the posted output. You can use a text browser like or lynx or links if there isn't a desktop on the PC where you are writing the code or use a standard desktop web browser.
 
Old 05-25-2015, 07:37 PM   #5
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Many thanks.

Last edited by Huamin; 05-25-2015 at 07:40 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Do you get a raise everytime you learn something new? resetreset General 3 12-04-2010 02:56 AM
Can't raise volume in Alsamixer? SonoranFun Linux - Software 3 02-15-2006 03:03 PM
raise ulimit help depraved Linux - Newbie 5 01-22-2006 01:47 PM
Raise Resolution in FC4 arew264 Linux - Software 3 09-30-2005 07:29 PM
How to raise audio level? ald Mandriva 2 10-03-2003 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:04 AM.

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