Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Feb 2005 21:18:48 -0600
From:      Kevin Kinsey <kdk@daleco.biz>
To:        Andrei Iarus <poni1111@yahoo.com>
Cc:        questions@freebsd.org
Subject:   Re: PHP
Message-ID:  <42180198.2030702@daleco.biz>
In-Reply-To: <20050220022403.72598.qmail@web51710.mail.yahoo.com>
References:  <20050220022403.72598.qmail@web51710.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Andrei Iarus wrote:

>I have installed apache-1.3.33_1, php5-5.0.3_1. And I
>tried to run simple scripts like: 
><html>
> <head>
>  <title>PHP Test</title>
> </head>
> <body>
> <?php echo '<p>Hello World</p>'; ?>
></body>
></html>
>and the output was an unexpected one: 
>
> Hello World
>
>'; ?>
>It also doesn`t outputs anything when using the
>phpversion() function. A possible bug? Before
>reporting this as a bug, I wanted to check if there
>was someone else with similar problems(or may be I did
>something wrong). 
>  
>

Simple configuration needed.  Note that this is PHP4.

***These are my comments***  (be sure not to put _them_
into your httpd.conf).

-----------------------------------------------------------------------------------------------------------

#grep -A 2 php /usr/local/etc/apache/httpd.conf

LoadModule php4_module        /usr/local/libexec/apache/libphp4.so
    ***this is necessary.***

AddModule mod_php4.c
   ***so is this.***

        <IfModule mod_php4.c>
            DirectoryIndex index.php index.html
         </IfModule>

   ***tells Apache to use "index.php" as the preferred index,
          if not present, then use "index.html" if it exists***

    <IfModule mod_php4.c>
        AddType application/x-httpd-php .php .html .asp .php3
        AddType application/x-httpd-php-source .phps
   </IfModule>

   ***a little overkill, mostly for humor.  My development server
treats files ending in "php", "html" and "asp" as php files and
parses them looking for PHP (mostly as a political statement).***

-----------------------------------------------------------------------------------------------------------------

Basically, you must have 1]LoadModule 2]AddModule and
3]AddType declarations in httpd.conf, then restart Apache
and your scripts should work fine.

HTH, Kevin Kinsey



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42180198.2030702>