LinuxQuestions.org
Help answer threads with 0 replies.
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 08-17-2004, 08:56 AM   #1
gamehack
Member
 
Registered: Jun 2003
Location: Sevenoaks, UK
Distribution: Ubuntu
Posts: 183

Rep: Reputation: 30
LAMP(Linux, Apache, MySQL, PHP) Problem


Hello,

My Slack is 9.0 I'm trying to get the typical LAMP (Linux, Apache, MySQL, PHP) configuration running. But Apache won't serve up a PHP file properly. That is, each time I browse to test.php, the browser asks if I want to download the file.

I've added the following lines to my httpd.conf file:
LoadModule php4_module libexec/libphp4.so
AddType appliation/x-httpd-php .php
AddType appliation/x-httpd-php-source .phps

So, any suggestions how to fix this ?

Thanks
 
Old 08-17-2004, 09:20 AM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
I don't know which version of Apache is on LAMP but latest on Apache (at least on Slackware) moved all the libs to libexec/apache instead of libexec so try: LoadModule php4_module libexec/apache/libphp4.so
 
Old 08-17-2004, 09:25 AM   #3
gamehack
Member
 
Registered: Jun 2003
Location: Sevenoaks, UK
Distribution: Ubuntu
Posts: 183

Original Poster
Rep: Reputation: 30
that's not the problem the library is on the place it's written So the problem is somewhere else...
 
Old 08-17-2004, 09:30 AM   #4
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
"AddType appliation/x-httpd-php .php
AddType appliation/x-httpd-php-source .phps"

If you pasted that from your configuration then it should be application instead of appliation.

If not, do you get any error messages or something?
 
Old 08-17-2004, 09:36 AM   #5
gamehack
Member
 
Registered: Jun 2003
Location: Sevenoaks, UK
Distribution: Ubuntu
Posts: 183

Original Poster
Rep: Reputation: 30
It's not pasted, i wrote it. Sorry my fault. The problem is that I don't get any error messages.
 
Old 08-17-2004, 09:44 AM   #6
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Mmm, very weird.
I was seeing my apache config file, and httpd.conf has a line: Include /etc/apache/mod_php.conf

Then in the file mod_php.conf i've the lines you pasted above. This shouldn't interfere, however it tells in a comment that php needs 4 packages installed to run properly: openssl-solibs (or openssl), gmp, mysql and of course apache. Check if you have them.

Btw, double check the lib at libexec instead of libexec/apache, i know you did, just in case

Last edited by gbonvehi; 08-17-2004 at 09:50 AM.
 
Old 08-17-2004, 01:50 PM   #7
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
Here are some excerpts from my web site ( http://shilo.is-a-geek.com/slack/apache19.html ) that may help you.

Quote:
Now sometimes your web pages are gonna end with .htm or .html.
Other times, you may want to use web pages that end in .php. Trust me on
this. So next up, we're gonna find a section that looks like this:


# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm
</IfModule>

And we're gonna make it look like this:


# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.shtm index.php
</IfModule>
Quote:
The last thing that we are going to do is allow are web server to
run php scripts. Why? I like this little program called squirrelmail. It uses
php. This is something I had to do to get it to work. Find a section that looks
like this:


# ==> mod_php configuration settings <==
#
# PACKAGES REQUIRED: openssl-solibs (A series) and/or openssl (N series),
# mysql (AP series), gmp (L series), and apache (N series)
#
#Include /etc/apache/mod_php.conf

And we're gonna make it look like this:


# ==> mod_php configuration settings <==
#
# PACKAGES REQUIRED: openssl-solibs (A series) and/or openssl (N series),
# mysql (AP series), gmp (L series), and apache (N series)
#
Include /etc/apache/mod_php.conf

That wraps up the configuration in the /etc/apache/httpd.conf file. We still
have one more step to do (At least I did before things started working).
You need to open up the file named /etc/apache/mod_php.conf. Here's
what mine used to look like:


#
# 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

This didn't work for me. I had to change mine to look like this:


#
# mod_php - PHP Hypertext Preprocessor module
#

#LoadModule php4_module libexec/libphp4.so
LoadModule php4_module libexec/apache/libphp4.so
#AddModule mod_php4.c

# 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
 
Old 08-17-2004, 02:52 PM   #8
gamehack
Member
 
Registered: Jun 2003
Location: Sevenoaks, UK
Distribution: Ubuntu
Posts: 183

Original Poster
Rep: Reputation: 30
Thanks I fixed the problem after adding AddModule...

thanks anyway

Cheers
 
  


Reply


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
Mysql,php or apache problem? intercodes Linux - Software 3 11-18-2005 11:20 AM
Setting Up LAMP: Getting Linux, Apache, MySQL, and PHP Working Together rhythmking Slackware 2 06-08-2005 04:05 AM
LAMP(Linux,Apache,MySql,PHP) and other info hamtavs General 1 01-25-2005 03:54 AM
Installing LAMP with MySQL 4.1 - close but stuck with Apache problem David Mann Linux - Software 2 11-10-2004 08:19 PM
apache/php/mysql problem vher Linux - Software 3 01-19-2003 03:04 PM

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

All times are GMT -5. The time now is 07:53 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