LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-07-2009, 11:31 PM   #1
Azul Rondo
Member
 
Registered: Jun 2009
Posts: 30

Rep: Reputation: 15
Simple PHP script fails on local web server


I have a Fedora 11 server that is running Apache and SELinux is set for Apache to "Allow httpd to use built in scripting(usually php)" enabled.

I use this code to call the script in the next window.
PHP Code:
<html>
<
body>

<
form action="welcome.php" method="get">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<
input type="submit" />
</
form>

</
body>
</
html
PHP Code:
<html>
<body>


Welcome <?php echo $_REQUEST["fname"]; ?>!<br />
You are <?php echo $_REQUEST["age"]; ?> years old.
</body>
</html>
When I submit the query the url looks like this
file://///Freekserver.local/html/welcome.php?fname=Rondo&age=40

but the output looks like this
PHP Code:
Welcome !
You are years old
It should include name and age.

What am I missing?

Thanks Rondo
 
Old 08-08-2009, 01:09 AM   #2
chadl
Member
 
Registered: Sep 2005
Location: US
Distribution: Gentoo AMD64 Testing
Posts: 129

Rep: Reputation: 15
You can't use file://, as that does not go through the web server. Use http instead. If you view source of the page, you will notice that the PHP is being shown un-executed, because its not going through apache/php.
 
Old 08-08-2009, 04:10 AM   #3
Azul Rondo
Member
 
Registered: Jun 2009
Posts: 30

Original Poster
Rep: Reputation: 15
Simple script

Thanks for the quick response Chadl.
As is usually the case, as soon as I ask a question I regret it. It turns out just before I made that post I had activated "Allow Apache scripts to write to public content" in SELinux using the desktop gui and for some reason it didn't take on the first reboot. Now it works.

Thanks again
Rondo
 
  


Reply

Tags
apache, selinux, server


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need a simple, LOCAL email server. tjtoml Linux - Server 2 03-29-2007 12:34 PM
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 11:30 PM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 08:11 PM
Simple PHP Script benrose111488 Programming 7 01-31-2005 02:39 PM
a Simple help on PHP Script Gerardoj Programming 1 10-18-2004 09:26 PM


All times are GMT -5. The time now is 12:04 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration