The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 PHP not working with freebsd, please HELP :(
Author: tjhilder 
Date:   10-08-05 18:45

Hi,

I can't seem to get php working, I been trying different things but when I go to a php file it just shows up all the PHP code, http://www.tjhilder.co.uk/info.php <-- this is my phpinfo() page, but can't seem to display it.

has anyone had this problem before? if so can you please, please, please help me solve it, it's driving me mad! :(

Kind Regards
TJ Hilder

Reply To This Message
 
 Re: PHP not working with freebsd, please HELP :(
Author: Dan 
Date:   10-08-05 19:08

I see the PHP code within the HTML source. This means PHP is not being told to parse the page.

I suspect you are missing the directives from your httpd.conf file.

If you installed from ports, this should have been set up for you, automatically. Did you install from ports?

--
Webmaster

Reply To This Message
 
 Re: PHP not working with freebsd, please HELP :(
Author: tjhilder 
Date:   10-08-05 19:23

my brother was the one to help me out by installing it all for me, so i'm not sure if it was installed by ports what directives do you mean in the httpd.conf file? do you mean the line that says

DirectoryIndex index.html index.htm index.php index.txt

or was it something else?

--
TJ

Reply To This Message
 
 Re: PHP not working with freebsd, please HELP :(
Author: Dan 
Date:   10-08-05 19:29

No, it's something else.

Something like this:

#
# For example, the PHP 3.x module (not part of the Apache distribution - see
# http://www.php.net) will typically use:
#
<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .php3s
</IfModule>
#
# And for PHP 4.x, use:
#
<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php-source .phps
</IfModule>

--
Webmaster

Reply To This Message
 
 Re: PHP not working with freebsd, please HELP :(
Author: tjhilder 
Date:   10-08-05 19:48

I'm using php 5.0.4, would it be something like...

<IfModule mod_php5.c>
AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php-source .phps
</IfModule>

would that be correct? or do i still use the code with php4 in it?

thanks for your help! :)

--
TJ

Reply To This Message
 
 Re: PHP not working with freebsd, please HELP :(
Author: Dan 
Date:   10-08-05 19:57

I do not know.

--
Webmaster

Reply To This Message
 
 Re: PHP not working with freebsd, please HELP :(
Author: tjhilder 
Date:   10-08-05 23:17

my brother added this:

AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php-source .phps

and it now works, although for some strange reason cutenews has a fatal error now, which wasn't like before.

thanks for your help.

TJ

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org