LinuxQuestions.org
Review your favorite Linux distribution.
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 05-01-2004, 07:28 AM   #1
Hady
Member
 
Registered: Nov 2003
Posts: 55

Rep: Reputation: 15
.php files handled by PHP


Hi!

I have RedHat Linux 8.0
I installed the httpd (apache) and php packages and run them from the services.

how can i make my local server activate support for PHP so all files ending in .php are handled by PHP?

(I read some of the PHP documentation, I could not find explicit detailed information on what to do)

Thanks for your consideration.

Hady
 
Old 05-01-2004, 08:42 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Make sure something like this is in your config file, or is in one of the include files

Code:
    # Load the module first

        LoadModule php4_module    modules/libphp4.so
    
    # Set it to handle the files
    <IfModule mod_mime.c>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php .phtml
        AddType application/x-httpd-php .php3
        AddType application/x-httpd-php .php4
        AddType application/x-httpd-php-source .phps
    </IfModule>
    
    # Fix some bugs
    <Files *.php>  
        LimitRequestBody 524288
        RequestHeader unset If-Modified-Since
    </Files>
    <Files *.php3>  
        LimitRequestBody 524288
        RequestHeader unset If-Modified-Since
    </Files>
    <Files *.php4>  
        LimitRequestBody 524288
        RequestHeader unset If-Modified-Since
    </Files>
    <Files *.phps>  
        LimitRequestBody 524288
        RequestHeader unset If-Modified-Since
    </Files>
    <Files *.phtml>  
        LimitRequestBody 524288
        RequestHeader unset If-Modified-Since
    </Files>
 
Old 05-01-2004, 12:50 PM   #3
Hady
Member
 
Registered: Nov 2003
Posts: 55

Original Poster
Rep: Reputation: 15
Thanks for your help.

but where's my config file? (i'm a newbie, i'd appreciate detailed help)

and writing these things will be enough?

Thank you.
 
Old 05-02-2004, 03:56 AM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
The short, yes.

The extended version you'll only find on DVD and LQ :
Your config file should be the first place you learn about when messing with a server. This is where you set things up to run right, it's the background, it's what gives the face to your applications. For Apache, your config file is going to be somewhere around /etc/apache2/conf or nearby if that isn't the exact location. The conf file will be called commonapache2.conf OR apache2.conf depending on what's going on and how things are set up. You should be able to find similar entries to those listed above and add them accordingly. These are the necessary lines:
Code:
        LoadModule php4_module    modules/libphp4.so
    
    # Set it to handle the files
    <IfModule mod_mime.c>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php .phtml
        AddType application/x-httpd-php .php3
        AddType application/x-httpd-php .php4
        AddType application/x-httpd-php-source .phps
    </IfModule>
The others are optional. You will likely have to install another rpm or 2 in order to get things working. mod_php I believe is the name of 1 of the other files, and the other is likely a dependency of that file.

Good luck!

Cool
 
Old 05-04-2004, 05:25 AM   #5
NickyS
LQ Newbie
 
Registered: May 2004
Posts: 3

Rep: Reputation: 0
-

Last edited by NickyS; 05-04-2004 at 05:27 AM.
 
  


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
Are PHP session variables held in memory when you leave a PHP site? Locura Programming 11 11-16-2008 09:37 PM
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 11:25 AM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 12:05 PM
php apache or php cgi - php learner rblampain Linux - Security 3 12-18-2004 12:10 AM
PHP unable to read .php files tuka Linux - Software 6 10-12-2003 07:40 PM


All times are GMT -5. The time now is 11:38 PM.

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