LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-30-2009, 04:29 AM   #1
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Rep: Reputation: 30
Apache displays PHP scripts


I cannot get Php to work.

It's an old Gentoo install on which I've just upgraded apache to 2.2 and istalled php 5.2.

Added the following to the /etc/apache2/httpd.conf
Code:
#PHP
AddModule mod_php.c
AddModule mod_php.c
AddModule mod_perl.c

AddType application/x-httpd-php .php
but just get the error
Code:
 * Apache2 has detected a syntax error in your configuration files:
Syntax error on line 194 of /etc/apache2/httpd.conf:
Invalid command 'AddModule', perhaps misspelled or defined by a module not included in the server configuration
 
Old 05-30-2009, 03:23 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I don't see any AddModule directive defined for Apache 2.2 web server.

You will want something like:
Code:
LoadModule php5_module modules/mod_php5.so
(note: My line snippet above may not be correct for your environment. You're going to need to locate the module and look at examples in your current config.)
 
Old 05-30-2009, 03:54 PM   #3
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
No joy.

locate mod_php gives me the following results:

Quote:
cogentoo ~ # locate mod_php
/usr/portage/dev-lang/php/files/70_mod_php5_concurr.conf-apache2
/usr/portage/dev-lang/php/files/70_mod_php5_concurr.conf-apache2-r1
/usr/portage/dev-lang/php/files/70_mod_php5.conf-apache2
/usr/portage/dev-lang/php/files/70_mod_php5.conf-apache2-r1
 
Old 05-31-2009, 03:12 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
So updatedb and/or install mod_php properly?
 
Old 05-31-2009, 03:47 PM   #5
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by anomie View Post
So updatedb and/or install mod_php properly?
Update is up to date.

Install mod_php properly?
 
Old 05-31-2009, 04:11 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I'm not sure what you're not getting. mod_php is not installed (as evidenced by your locate query), thus you need to install it properly.

I don't run Gentoo, but see if this helps: http://overlays.gentoo.org/proj/php/...ommonQuestions
 
Old 06-01-2009, 01:39 AM   #7
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by anomie View Post
I'm not sure what you're not getting. mod_php is not installed (as evidenced by your locate query), thus you need to install it properly.

I don't run Gentoo, but see if this helps: http://overlays.gentoo.org/proj/php/...ommonQuestions
Thank you.

I reinstalled php with the USE flags specified on that page (namely: USE="cli apache2" emerge 'dev-lang/php') and now at least my php is working.

However Drupal can't seem to access the Mysql database.

I get this error:
"Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that Drupal supports."
 
Old 06-01-2009, 05:00 AM   #8
chandramani_yadav
Member
 
Registered: Jan 2007
Location: Vienna
Distribution: Redhat
Posts: 47

Rep: Reputation: 19
install apache with php and mysql USE Flags.
 
Old 06-01-2009, 05:46 AM   #9
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by chandramani_yadav View Post
install apache with php and mysql USE Flags.
Code:
USE="apache2 mysql php pam ssl xml xml2 berkdb innodb jpeg png" emerge dev-db/mysql apache php
Still get the same error.
 
Old 06-01-2009, 10:52 AM   #10
cov
Member
 
Registered: Apr 2005
Location: Durban
Posts: 436

Original Poster
Rep: Reputation: 30
I'm really not sure what happened, but when I ran USE="apache2 mysql" emerge php, it installed and seems to have MySQL Support.

Happy Days!
 
  


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
how to execute php scripts remotly in apache? harbo Linux - Server 1 03-17-2009 10:40 AM
HELP! - PHP scripts won't work after reinstall of Apache linuxfond Linux - Server 3 11-22-2008 05:03 AM
Parsing PHP Scripts using Apache in SuSe 9.3 (without a dedicated server) elliotfuller SUSE / openSUSE 7 07-27-2005 11:40 AM
Need help to configure Apache TO EXECUTE PHP SCRIPTS mgrapr Linux - Hardware 2 01-21-2004 09:23 AM
Apache not running php scripts Seventh Linux - Newbie 3 01-08-2004 08:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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