LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   .php files handled by PHP (https://www.linuxquestions.org/questions/linux-newbie-8/php-files-handled-by-php-176618/)

Hady 05-01-2004 06:28 AM

.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

Demonbane 05-01-2004 07:42 AM

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>


Hady 05-01-2004 11:50 AM

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.

MasterC 05-02-2004 02:56 AM

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

NickyS 05-04-2004 04:25 AM

-


All times are GMT -5. The time now is 10:29 PM.