LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-28-2006, 11:09 AM   #1
dbc001
Member
 
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Rep: Reputation: 15
weird Php problems 10.2


OK I've just gotten Slackware 10.2 online, and I'm trying to get some PHP stuff going. I installed everything from the install CDs. Apache seems to have mod_php enabled.

But, when I try to browse to localhost/test.php all i see is the code:

Code:
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>
It looks like apache is just sending it as if it were a normal text file. How do I get apache to process my php files properly?

thanks in advance,
dbc001
 
Old 01-28-2006, 11:49 AM   #2
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
Do you have this in httpd.conf?
Code:
Addtype application/x-httpd-php .php
 
Old 01-28-2006, 12:05 PM   #3
dbc001
Member
 
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 15
Code:
   UW PICO(tm) 4.10                      File: mod_php.conf                                    

#
# mod_php - PHP Hypertext Preprocessor module
#

# Load the PHP module:
LoadModule php4_module libexec/apache/libphp4.so

# Tell Apache to feed all *.php files through the PHP module:
AddType application/x-httpd-php .php

# This will display PHP files in colored syntax form.  Use with caution.
#AddType application/x-httpd-php-source .phps
yeah, that line is in mod_php.conf, which is referenced in httpd.conf:

Code:
root@justice:/etc/apache# grep -rn mod_php httpd.conf
1027:# ==> mod_php configuration settings <==
1033:#Include /etc/apache/mod_php.conf
 
Old 01-28-2006, 12:10 PM   #4
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
This is everything pertaining to PHP in my httpd.conf (I use a custom PHP5 build)
Code:
LoadModule php5_module        modules/libphp5.so
DirectoryIndex index.php index.html index.htm index.cgi
Addtype application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
php_flag zlib.output_compression On
php_value zlib.output_compression_level 5
 
Old 01-28-2006, 12:33 PM   #5
dbc001
Member
 
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 15
It looks like I've got everything except the php_flag and php_value. are those important?

does this mean that mod_php.conf isn't actually being loaded by httpd.conf?
 
Old 01-28-2006, 12:44 PM   #6
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
The php_flag/value directives enable php compression in Apache. It speeds up rendering.
I haven't used the default PHP package in years; I'd compile PHP5 as it's quite worth it.
 
Old 01-28-2006, 01:21 PM   #7
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
It is loaded if you have this in your httpd.conf
Include /etc/apache/mod_php.conf
 
Old 01-28-2006, 01:48 PM   #8
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
Quote:
Originally Posted by Alien_Hominid
It is loaded if you have this in your httpd.conf
Include /etc/apache/mod_php.conf
Yep, didn't notice that the above line in your httpd.conf is commented out. That's your bug.
 
Old 01-28-2006, 01:52 PM   #9
dbc001
Member
 
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 15
Red face

DOH! I feel like a dumbass. thanks a million!
 
  


Reply



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
vim php with weird extensions dlublink Linux - Software 2 12-24-2005 09:35 AM
weird, weird problems with logitech precision USB gamepad ikataii Linux - Hardware 4 10-14-2005 04:31 AM
PHP-MySQL Weird Error Fordor Slackware 2 02-24-2005 12:01 PM
weird PHP error atom Programming 5 09-26-2004 08:50 AM
PHP $_GET is getting weird info ghight Programming 2 08-11-2004 12:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:26 PM.

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