Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter macedonmike

    (@macedonmike)

    Here is how to configure PHP in Apache:

    13. Setup your php.ini

    cp php.ini-dist /usr/local/lib/php.ini

    You may edit your .ini file to set PHP options. If you prefer having
    php.ini in another location, use –with-config-file-path=/some/path in
    step 10.

    If you instead choose php.ini-recommended, be certain to read the list
    of changes within, as they affect how PHP behaves.

    14. Edit your httpd.conf to load the PHP module. The path on the right hand
    side of the LoadModule statement must point to the path of the PHP
    module on your system. The make install from above may have already
    added this for you, but be sure to check.

    For PHP 4:

    LoadModule php4_module modules/libphp4.so

    For PHP 5:

    LoadModule php5_module modules/libphp5.so

    15. Tell Apache to parse certain extensions as PHP. For example, let’s have
    Apache parse .php files as PHP. Instead of only using the Apache AddType
    directive, we want to avoid potentially dangerous uploads and created
    files such as exploit.php.jpg from being executed as PHP. Using this
    example, you could have any extension(s) parse as PHP by simply adding
    them. We’ll add .phtml to demonstrate.

    <FilesMatch \.php$>
    SetHandler application/x-httpd-php
    </FilesMatch>

    Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, and
    .phtml files to be executed as PHP, but nothing else, we’d use this:

    <FilesMatch “\.ph(p[2-6]?|tml)$”>
    SetHandler application/x-httpd-php
    </FilesMatch>

    And to allow .phps files to be executed as PHP source files, add this:

    <FilesMatch “\.phps$”>
    SetHandler application/x-httpd-php-source
    </FilesMatch>

    16. Use your normal procedure for starting the Apache server, e.g.:

    /usr/local/apache2/bin/apachectl start

    – OR –

    service httpd restart

    The full documentation is available at:
    http://us3.php.net/manual/en/install.unix.apache2.php

    Thankyou for the help everyone

    Thread Starter macedonmike

    (@macedonmike)

    Okay I ran phpinfo() from the command line and that is obviously not the way to do that. I’m going to go through the php docs and some tutorials and see if I can figure it out. If there are any good intros I’d appreciate a point in the right direction

    Thread Starter macedonmike

    (@macedonmike)

    I checked and I have php5-mysql installed, do I need something else?

    Thread Starter macedonmike

    (@macedonmike)

    All better thank you

Viewing 4 replies - 1 through 4 (of 4 total)