Share your knowledge at the LQ Wiki.
Go Back > Forums > Other *NIX Forums > *BSD
User Name
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.


  Search this Thread
Old 10-06-2004, 11:35 AM   #1
LQ Newbie
Registered: Aug 2004
Posts: 23

Rep: Reputation: 15
PHP and APACHE servers.. configuration question

hi all

i installed apache and it is working fine.. viewing pages as i like.
after that, i installed php server..

installations were done by these commands:-

make install
make clean

apache working fine and i can see that..

but php.. i dont know even how to run it.. or even how to use it..

it is now compailed and installed properly.. and what i see is this:

in the following path:-


i see the following


only that.. i stoped here at this step.

i went to my apache and created the following page to test my APACHE with PHP.. this is my web site:-

<title>PHP Test</title>
<?php echo '<p>Hello World</p>'; ?>

please tell me what should i do
or what did i mess

thanks in advance

Last edited by eech55; 10-06-2004 at 11:37 AM.
Old 10-06-2004, 02:47 PM   #2
Registered: Jul 2003
Location: Durham, UK
Distribution: Ubuntu 8.04
Posts: 419

Rep: Reputation: 30
What distro are you using?

If you put that page in your apache folder and point your browser to it. e.g. You should see a page with hello world on it. If you do PHP is working

Install a program called Webmin. It may help. If not then try googleing for an install guide for php.

P.s. Do not double post
Old 10-06-2004, 03:49 PM   #3
LQ Newbie
Registered: Aug 2004
Posts: 23

Original Poster
Rep: Reputation: 15
i am using FreeBSD

i dont think what i did is enough

some one told me uncomment "mod_php" in httpd.conf

but there is not "mod_php" in httpd.conf

was that person right when he said that i have to uncommint mod_php ?

but i didnt find it.. how to fix my problem?


about the command you told me to check if my php is working or not.. my unix does not have any GUI to brows pages.

is there any way to brows pages using the text user interface?
Old 10-06-2004, 06:05 PM   #4
Senior Member
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Did you read the instructions for installing PHP with Apache2?

Old 10-07-2004, 10:37 AM   #5
LQ Newbie
Registered: Aug 2004
Posts: 23

Original Poster
Rep: Reputation: 15
thanks for the tutorial

i didnt read it, because i didnt find it easly in the site

... i installed apache using :-

./configure --enable-so
make install

now php time

./configure --with-apxs2=/usr/local/apache2/bin/apxs

but it did not work and generated an error message saying that it is one of three

1- /usr/local/apache2/bin/apxs not found
2- apache installed without so
3- Perl was not installed

i dont know what to do?

apxs path is right
and apache is installed with so enabled

what about perl? as i know it is a programing language.. but why i need it?? do i must have it?

thanks in advance

Last edited by eech55; 10-07-2004 at 10:39 AM.
Old 10-08-2004, 03:41 AM   #6
LQ Newbie
Registered: Aug 2004
Posts: 23

Original Poster
Rep: Reputation: 15
ummmm i tried to install apache with perl using the command

./configure --enable-so --with-perl
make install

then i went to php side
./configure --with-apxs2=/usr/local/apache2/bin/apxs

but it didnt work and generated the same error message saying:-

1- Perl was not installed
2- /usr/local/apache2/bin/apxs not found
3- apache installed without so

any thing did i mess???
Old 10-20-2004, 02:40 PM   #7
LQ Newbie
Registered: Aug 2004
Location: USA
Distribution: FreeBSD 5.2.1
Posts: 3

Rep: Reputation: 0

follow these steps,

first remove apache.

find / -name apache

rm -rf /usr/local/apache - or wherever you have it installed. then follow this.

download apache 1.3
download mysql 4.0
download php

firs install mysql

./configure --prefix=/usr/local/mysql
make install

create a users called mysql in "sysinstall"
go back into the mysql install folder ( the one you untared) and find the scripts folder or install scripts
shell> scripts/mysql_install_db

chown -R root /usr/local/mysql/

chgrp -R mysql /usr/local/mysql/

chown -R mysql /usr/local/mysql/

then run

/usr/local/mysql/bin/mysqld_safe &

mysql should be started.

/usr/local/mysql/bin/mysqladmin -u root -h password 'new-password'
/usr/local/mysql/bin/mysql -u root -p

on to apache and php.. download them both untar then in your /home/folder so they are all there.

apache_1.3.28 (or newer)
./configure --prefix=/usr/local/apache

php-4.3.3 (or newer)

./configure --with-mysql=/usr/local/mysql/ --with-gettext=/usr/local/bin/gettext --enable-ftp --with-xml --with-apache=../apache_1.3.28 --enable-track-vars --with-png

make; make install

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

-- php install complete --

-- apache install --

./configure --prefix=/usr/local/apache --enable-module=rewrite --activate-module=src/modules/php4/libphp4.a

make; make install

-- apache install complete --

-- apache install complete --

-- apache config edit --

vi /usr/local/apache/conf/httpd.conf
add these 2 lines to config
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

save and exit

-- apache config edit complete --

-- test system --

to start apache: /usr/local/apache/bin/apachectl

to test php:
vi /usr/local/apache/htdocs/index.php

insert this:

save and exit
test -



you will have to edit somethings out like gettext. or you can use your ports with

make install clean under gettext.

Last edited by furthur; 10-20-2004 at 02:42 PM.


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
PHP configuration with apache web server vikrambhimbar Linux - Software 4 12-17-2005 04:04 AM
Apache PHP configuration varunbihani Linux - Newbie 2 01-18-2005 02:49 AM
Apache question....authorization and multiple servers geekdevil Linux - Software 3 01-13-2005 02:11 PM
Apache MySQL PHP configuration Gilion Linux - Software 1 02-02-2004 10:58 AM
apache php-mysql configuration problems ugol Linux - Software 1 11-08-2003 09:13 PM > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 03:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration