Hi Tom,

On Thu, Jan 22, 2004 at 04:45:08PM -0500, Tom Ray [List] wrote:
> For the first time ever I installed FreeBSD 4.9, I then installed
> Apache 1.3 and PHP 4.3.3-CGI from /usr/ports on the machine. It seems
> that everything is ok, but when I try to use a .php file it does not
> run it through the parser. So when I hit test.php in my browser it
> outputs:
<snip>
You will probably find it a lot easier to install the mod_php4 port NOT
the php4-cgi port - php running as cgi is not recommended unless you
have a good reason for doing so - ie you want to run php scripts as the
user that owns them.

For more info see this thread here:

http://marc.theaimsgroup.com/?l=apache-httpd-users&m=107153065731172&w=2


A basic installation of apache+php on freebsd would be something like:

(note the below presumes you don't already have the ports installed, to
uninstall just run 'make deinstall' in each of the respective port
directories).

- install apache from ports:

cd /usr/ports/www/apache13 && make clean install

- install mod_php4 from ports:

cd /usr/ports/www/mod_php4 && make clean install
(choose the options you want, although the basics are fine to start with
:P)

- modify your /usr/local/etc/httpd.conf file so that the ServerName is
  set to a domain that resolves for you - localhost is ok as long as
  there's a line in /etc/hosts resolving localhost to 127.0.0.1.

- finally start the httpd:

rehash && apachectl start

That should be all you need to do to get things up and running.  The
mod_php4 port install adds the required lines to your httpd.conf file:

LoadModule php4_module        libexec/apache/libphp4.so
AddModule mod_php4.c
<IfModule mod_php4.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>

as well as an addition to the DirectoryIndex line so that index.php is
treated as being the default index page.

You shouldn't have to do anything special to get php scripts to work
from under the default DocumentRoot - which is /usr/local/www/data by
default iirc on freebsd.

If you find any errors in /var/log/httpd-error.log, paste them here and
someone can help out.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - Another FreeBSD Diary
http://ipfwstats.sf.net/        - ipfw peruser traffic logging

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to