Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I know a reasonable amount about Apache, but am no expert. Have a question for you. My Apache server is running on linux. All of my pages on my site are .html extensions (except for a few .php pages. Recently, I started learning php. One thing I tried was to put php code INTO html. When I did this and tried to view the site, the php code would actually show up ON the site in the browser. I have been told that:
"PHP has to be in pages that end with the .php extension, unless your server is set up to run .html pages through the parser. Most shared hosting is set up to only process php scripting in .php, .php3 and .php4 pages."
I'll look into it, but what exactly does that mean, and what do I have to do in httpd.conf to allow php code to run in html? Thanks!
gee i didn't think u had to do anything, unlike perl.
So does php work at all, do pages with .php extentions work.
if so inline php should work as well.
but u cannot just start coding u have to encapsulate it eg
<?php echo "Hello World<P>"; ?>
Thanks for the replies, guys. I DO see pages ending in .php, and I know php is installed and working correctly. What's NOT working is when I have an html page with php code IN the html code. When that happens, the php code is displayed on the page itself. The only advice I've been able to find is what I quoted in my original post.
What I mean is this:
show? i.e create a html file and put the above code in it. then name the file index.php and stick it in your apache root.
I have that already. The php install automatically generated it. BUT, if I create a HTML extension file and place all that php code into it, then that WON'T work. The files are identical, except one ends in .php and one ends in .html. The .php works, the .html (with php code IN it) doesn't.
In addition, I've been reading up on this. I already added:
AddType application/x-httpd-php .php .html
to my httpd.conf file. I believe that this should allow php code INSIDE html files. I have also read that I have to add "ScriptAlias" something or other to the httpd.conf file. For instance, I had to add:
ScriptAlias /cgi-bin/ "/blah/blah/blah/cgi-bin/"
to allow for cgi files. The problem with that is that php files are not all in one directory as cgi files are! How can I add this ScriptAlias line to the httpd.conf with more than one directory accessible? Should I just make the directory my DocumentRoot directory with a trailing "/"?
You could have a html file ending in .php and if no php code was in it then the file would be ouputed as is. if the html file had <?php ?> then what ever is in those brackets will be passed to the php pasher where the code would be interupted.
Originally posted by GraemeK You could have a html file ending in .php and if no php code was in it then the file would be ouputed as is. if the html file had <?php ?> then what ever is in those brackets will be passed to the php pasher where the code would be interupted.
Huh? Sorry, I don't understand what you're saying. All I want to do is allow php code inside .html files. There seems to be some setting in Apache's httpd.conf file I have to change, but I don't know what it is. Something to do with a parser...?