Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PHP with Apache2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
mactoo
n00b
n00b


Joined: 02 Feb 2006
Posts: 6

PostPosted: Thu Feb 02, 2006 7:25 am    Post subject: PHP with Apache2 Reply with quote

I've installed apache 2, that works OK
but I've been trying to use php and that doesn't work, it prompts for download when I want to load a php file...

What infos should I provide to make someone help me ?

apache is version 2.0.55-r1
php is version is dev-lang/php-5.0.5-r5
I've checjed many posts about the -D PHPx and tried many things. Nothing worked.

anyone has something ?

mod edit: cleaned some HELP SCREAMING from the subject --Earthwings
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Thu Feb 02, 2006 7:30 am    Post subject: Reply with quote

emerge mod_php.
Back to top
View user's profile Send private message
mactoo
n00b
n00b


Joined: 02 Feb 2006
Posts: 6

PostPosted: Thu Feb 02, 2006 7:37 am    Post subject: Reply with quote

I've tried that already mad install php 4.x
didn't work
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Thu Feb 02, 2006 7:51 am    Post subject: Reply with quote

What?
Back to top
View user's profile Send private message
mactoo
n00b
n00b


Joined: 02 Feb 2006
Posts: 6

PostPosted: Thu Feb 02, 2006 7:53 am    Post subject: Reply with quote

I mean , I've made emerge mod_php
and it didn't change anything (had to unmerge dev-lang/php to install it)
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Thu Feb 02, 2006 8:17 am    Post subject: Reply with quote

Ok. You certainly need mod_php.

The config files have moved around a bit from version to version. Would be worth running apache2 -V to see the basic config file. Then check the PHP module is in the modules directory. Check /etc/conf.d/apache2 as that's where PHP gets started on mine 2.0.54.
Back to top
View user's profile Send private message
mactoo
n00b
n00b


Joined: 02 Feb 2006
Posts: 6

PostPosted: Thu Feb 02, 2006 8:25 am    Post subject: Reply with quote

Here's apache2 -V

Server version: Apache/2.0.55
Server built: Feb 1 2006 21:51:15
Server's Module Magic Number: 20020903:11
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/usr"
-D SUEXEC_BIN="/usr/sbin/suexec2"
-D DEFAULT_PIDLOG="/var/run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"

don't understand why, the -D PHP doesn't show, in act that might be the problem.

Here's /etc/conf.d/apache2
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# Config file for /etc/init.d/apache2

# When you install a module it is easy to activate or deactivate the modules
# and other features of apache using the APACHE2_OPTS line. Every module should
# install a configuration in /etc/apache2/modules.d. In that file will be an
# <IfDefine NNN> where NNN is the option to enable that module.
# Here are the options available in the default configuration:
# USERDIR Enables /~username mapping to /home/username/public_html
# INFO Enables mod_info, a useful module for debugging
# PROXY Enables mod_proxy
# DAV Enables mod_dav
# DAV_FS Enables mod_dav_fs (you should enable this when you enable DAV
# unless you know what you are doing)
# SSL Enables SSL
# SSL_DEFAULT_VHOST Enables default vhost for SSL (you should enable this
# when you enable SSL unless you know what you are doing)
# LDAP Enables mod_ldap
# AUTH_LDAP Enables authentication through mod_ldap
# DEFAULT_VHOST Enables the default virtual host in /var/www/localhost/htdocs
APACHE2_OPTS="-D PHP5"

# Extended options for advanced uses of Apache ONLY
# You don't need to edit these unless you are doing crazy Apache stuff
# As not having them set correctly, or feeding in an incorrect configuration
# via them will result in Apache failing to start
# YOU HAVE BEEN WARNED.

# ServerRoot setting
#SERVERROOT=/usr/lib/apache2

# Configuration file location
# - If this does NOT start with a '/', then it is treated relative to
# $SERVERROOT by Apache
#CONFIGFILE=/etc/apache2/httpd.conf

# Location to log startup errors to
# They are normally dumped to your terminal.
#STARTUPERRORLOG="/var/log/apache2/startuperror.log"

# Environment variables to keep
# All environment variables are cleared from apache
# Use this to preserve some of them
# NOTE!!! It's very important that this contains PATH
# Also, it will fail if the _value_ of any of these variables contains a space
KEEPENV="PATH"


Where exactly should I check the module ?
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Thu Feb 02, 2006 8:31 am    Post subject: Reply with quote

Quote:
APACHE2_OPTS="-D PHP5"


Should be PHP4.

/etc/apache2/modules.d/ for modules.
Back to top
View user's profile Send private message
frix
n00b
n00b


Joined: 02 Feb 2006
Posts: 8
Location: Sweden

PostPosted: Thu Feb 02, 2006 1:56 pm    Post subject: Reply with quote

magic919 wrote:
Quote:
APACHE2_OPTS="-D PHP5"


Should be PHP4.

/etc/apache2/modules.d/ for modules.


True for PHP 4, but wasn't the original poster running PHP 5?

I suggest you take a look at:

http://svn.gnqs.org/projects/gentoo-php-overlay/

there's a load of useful information there, especially what goes into
/etc/portage/package.use
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Thu Feb 02, 2006 2:12 pm    Post subject: Reply with quote

He says mod_php 4.x. He _had_ PHP5 but then installed mod_php 4.x.
Back to top
View user's profile Send private message
frix
n00b
n00b


Joined: 02 Feb 2006
Posts: 8
Location: Sweden

PostPosted: Thu Feb 02, 2006 2:46 pm    Post subject: Reply with quote

Mmm... ok. But if "mactoo" reads this, please check out my previous post.
I just recently upgraded to PHP5 and had to install/reinstall "dev-lang/php"
a couple of times before I got it working. Unless you want to install both
versions, don't go for "mod_php".
Back to top
View user's profile Send private message
mactoo
n00b
n00b


Joined: 02 Feb 2006
Posts: 6

PostPosted: Thu Feb 02, 2006 9:38 pm    Post subject: Reply with quote

OK, I've tried both PHP5 & mod_php (now it's mod_php) but I just can't get it to work !!!
I've checked the modules


40_mod_ssl.conf
45_mod_dav.conf
70_mod_php5.conf
41_mod_ssl.default-vhost.conf
70_mod_php.conf


/etc/conf.d/apache2
is with -D PHP4

and it's still the same...

is there something to do with the httpd.conf ?

Why is it so damn difficult to get PHP working ??!! Now I really fear the MySQL installation...
Back to top
View user's profile Send private message
kardolus
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2005
Posts: 120
Location: Amsterdam

PostPosted: Thu Feb 02, 2006 10:37 pm    Post subject: Reply with quote

I cant get it to work either, been recompiling stuff for days and running thrue forums. It sucks. I had no problems btw with mysql and PostGreSQL
_________________
Smokey, this is not 'Nam. This is bowling. There are rules.

http://twitter.com/GKardolus
Back to top
View user's profile Send private message
Peter_
n00b
n00b


Joined: 17 Dec 2005
Posts: 16

PostPosted: Thu Feb 02, 2006 11:29 pm    Post subject: Reply with quote

I recently built a server with apache 2.0 +php4.4+Mysql 4.1 and from memory all I had to do was modify my /etc/conf.d/apache2 file . I followed http://gentoo-wiki.com/HOWTO_Apache2_with_PHP_MySQL

For the record the changed line in /etc/conf.d/apache2 is
Code:
APACHE2_OPTS="-D DEFAULT_VHOST -D SSL -D SSL_DEFAULT_VHOAST -D PHP4"


Hope this helps :)
Back to top
View user's profile Send private message
DNAspark99
Guru
Guru


Joined: 03 Sep 2004
Posts: 321

PostPosted: Thu Feb 02, 2006 11:47 pm    Post subject: Reply with quote

you should also be using dev-lang/php-4/5 with apache use flags, not mod_php...and with the changes mentioned above to /etc/conf.d/apache2 file, it should work
Back to top
View user's profile Send private message
frix
n00b
n00b


Joined: 02 Feb 2006
Posts: 8
Location: Sweden

PostPosted: Fri Feb 03, 2006 8:42 am    Post subject: Reply with quote

I also followed the advise on:

http://www.gentoo.org/proj/en/php/php4-php5-configuration.xml

and went for a PHP5-only installation. Works fine for me...
Back to top
View user's profile Send private message
andreask
Apprentice
Apprentice


Joined: 09 Sep 2003
Posts: 282
Location: Aachen, Germany

PostPosted: Fri Feb 03, 2006 9:17 am    Post subject: Reply with quote

magic919 wrote:
emerge mod_php.

No.

dev-php/mod_php is not supported anymore.

Try:
Code:
emerge =dev-lang/php-4*
# or
emerge =dev-lang/php-5*
# or both
emerge =dev-lang/php-4* =dev-lang/php-5*

And don't forget to set the apache2 USE flag for dev-lang/php in /etc/portage/package.use. Please have a look at the Upgrading Guide for details: http://www.gentoo.org/proj/en/php/php-upgrading.xml

Quote from latest GWN:
Quote:
The most notable decision made from a users point of view forces users to migrate from dev-php/php to dev-lang/php as soon as possible as the PHP Herd decided to no longer support them. The old dev-php/php packages will be package.masked as soon as the architecture teams have stabilized the new-style PHP packages, which is expected by the end of February, and removed from the Portage tree about two months later.

http://www.gentoo.org/news/en/gwn/20060130-newsletter.xml#doc_chap1_sect3
Back to top
View user's profile Send private message
mactoo
n00b
n00b


Joined: 02 Feb 2006
Posts: 6

PostPosted: Fri Feb 03, 2006 11:55 am    Post subject: Reply with quote

OK
I got it working with mod_php, even if I don't understand why it works and why it didn't work.
I'm gonna try unmerge mod_php and go for dev-lang/php-5 before putting [solved] on the subject.

Thx anyway, at least it works somehow...
Back to top
View user's profile Send private message
chrisstankevitz
Guru
Guru


Joined: 14 Dec 2003
Posts: 472
Location: Santa Barbara, CA, USA

PostPosted: Sun Feb 12, 2006 5:45 am    Post subject: Reply with quote

andreask wrote:

Quote from latest GWN:
Quote:
The most notable decision made from a users point of view forces users to migrate from dev-php/php to dev-lang/php as soon as possible as the PHP Herd decided to no longer support them. The old dev-php/php packages will be package.masked as soon as the architecture teams have stabilized the new-style PHP packages, which is expected by the end of February, and removed from the Portage tree about two months later.

http://www.gentoo.org/news/en/gwn/20060130-newsletter.xml#doc_chap1_sect3


Thanks for the info. That guide does not show how to install PHP if I have not previously installed PHP. From snooping around, this is my guess:

1. Add apache2 USE flag
2. emerge '=dev-lang/php-5*'
3. Add "-D PHP5" to APACHE2_OPTS in /etc/conf.d/apache
Back to top
View user's profile Send private message
chrisstankevitz
Guru
Guru


Joined: 14 Dec 2003
Posts: 472
Location: Santa Barbara, CA, USA

PostPosted: Sun Feb 12, 2006 5:52 am    Post subject: Reply with quote

chrisstankevitz wrote:

1. Add apache2 USE flag
2. emerge '=dev-lang/php-5*'
3. Add "-D PHP5" to APACHE2_OPTS in /etc/conf.d/apache


I suspect step 2 can be simplified:

emerge dev-lang/php
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Tue Feb 21, 2006 10:37 pm    Post subject: Reply with quote

Moved from Networking & Security to Duplicate Threads, please see this topic.
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum