LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-30-2005, 04:58 PM   #1
davespink
LQ Newbie
 
Registered: Feb 2005
Location: UK
Distribution: Red Hat 9
Posts: 19

Rep: Reputation: 0
simple apache - php question


Hi,

I have Apache 2.0.40 and it runs with PHP fine.

I got a book aout of the library and I've been reading it about how to configure apache with PHP, and I looked in my httpd.conf file and there's no mention of PHP.

Well, OK, so I did a poke around on the web and did a phpinfo(); on my server and it tells me that PHP is installed as a filter. Well now I'm trying to figure out how apache knows to run php as a filer. Which config file?

I've been looking at docs on the net an no joy as yet.

I like to totally understand what I'm doing, even if I don't have a problem, I don't like a mystery either.

Anyone have any pointers?

I am new to Linux , but learning really fast ;-)

Oh and I have Linux RedHat 10 if that matters.

thanks
 
Old 03-30-2005, 05:42 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Sometimes php support is started in an include file. Look for lines in your conf such as:
Include conf/modules.d/*.conf
Include conf/commonapache2.conf

and have a look at those files.

Really though, for php support their only needs to be two lines in apache.conf:

1. LoadModule php4_module modules/libphp4.so

which loads the module, and:

2. AddType application/x-httpd-php .php

which tells apache to run files with '.php' extension through the php interpreter.

Unfortunately because all distros tend to install packages in different places and in different ways it is hard to tell you exactly what is going on.

Try "cat apache.conf | grep php" to see if you missed it...

Edit: Sorry, just wanted to correct my redundant use of cat. That should have been:
"grep php apache.conf"

Last edited by bulliver; 03-30-2005 at 06:11 PM.
 
Old 03-30-2005, 06:08 PM   #3
davespink
LQ Newbie
 
Registered: Feb 2005
Location: UK
Distribution: Red Hat 9
Posts: 19

Original Poster
Rep: Reputation: 0
Wow thanks!

This board almost always has the answers and double quick time to.

Yes it was a file /etc/httpd/conf.d/php.conf what done it.

All is now explained and I can sleep happy tonight.

I'm learining Linux fast from a knowledge of zero a couple of weeks ago I'm now installing stuff and keeping a webserver sweet ( well 2 actually and maybe a third soon ).

This is a great place to learn. Hope I can start giving something back soon.

;-)

( one day I'll grep and awk with the best of em )
 
Old 12-17-2005, 06:49 AM   #4
hadiseh
Member
 
Registered: Dec 2005
Posts: 38

Rep: Reputation: 15
dave
i'm new to linux too but my learning isn't as fast as urs.can u tell me how u study and which site do u use for learning?
i just can work with apache ,php and mysql in these 3 weeks.
thx
 
Old 12-28-2005, 05:47 PM   #5
davespink
LQ Newbie
 
Registered: Feb 2005
Location: UK
Distribution: Red Hat 9
Posts: 19

Original Poster
Rep: Reputation: 0
Hi Hadiseh,

I've been away a while and just catching up on my mail.

Firstly, I no longer have a need to run the Linux server, as I am now involved with other projects, but for what it's worth I'll tell you how I got up to speed.

Firstly I got a couple of good books from the library and skimmed thru them and tried out the commands and got an overall view of how it all worked. For anything specific not in the books I googled and found Linux resource sites.

This is a good tutorial site.

http://www.ctssn.com/

As I was more comfortable with Windows, I downloaded and installed xammp on my Windows machine

http://www.apachefriends.org/en/xampp.html

I used dreamweaver with xammp to build my PHP/MySQL software pages and debug them on my home (Windows XP) machine. That way you only have one thing to learn at a time.

I also installed phpMyAdmin on my Linux box and found to simple to just upload and
test out my nearly finished sites.

http://www.php.net/ is a great reference site for PHP.

For anything I was stuck with I posted questions on forums, (mostly this one) and got great help. If you try first and get stuck, people and pretty willing to help you in my experience.

Some of the things I had to do, like setting up email, and DNS were quite tricky, but with a lot of persiverance, and forum help, I was able to do what I needed.

I didn't find it easy, but the answers are out there.

good luck!

Last edited by davespink; 12-28-2005 at 05:49 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
Simple PHP Question newuser455 Programming 9 08-29-2005 12:58 AM
simple php question jfall Programming 1 05-03-2005 03:57 PM
Apache, MySQL, PHP, a couple simple questions. The_Messiah Linux - Software 3 04-09-2005 06:17 PM
Simple PHP question jacksmash Programming 15 03-01-2004 08:00 PM
Simple PHP Question jacksmash Programming 21 01-04-2004 09:31 PM


All times are GMT -5. The time now is 11:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration