# Apache2 & PHP5 upgrade - not serving up php pages [SOLVED]

## NotExcessive

I had  a perfectly happy, working LAMP server with PHP4.4 on it, but I had to upgrade to PHP5, so I removed php4 and mod_php, and emerged php5.1.4.

Everything installed OK, and in /etc/portage/package.use, I have the following flags:

```
dev-lang/php -* cli apache2 gd ldap mysql pcre session unicode xml zlib
```

Although I've modified /etc/apache2/httpd.conf from

```
LoadModule php4_module modules/libphp4.so
```

to 

```
LoadModule php5_module modules/libphp5.so
```

and changed  /etc/conf.d/apache2 from

```
APACHE2_OPTS="-D PHP4 -D DEFAULT_VHOST"
```

to

```
APACHE2_OPTS="-D PHP5 -D DEFAULT_VHOST"
```

AND also made a symlink from /etc/apache2/conf/php.ini to /etc/php/apache2-php5/php.ini, the web server still dishes out php pages as scripts to download by the browser. I can't seem to make Apache drive the php engine. 

I have 70_mod_php5.conf in /etc/apache2/modules.d, but not in /etc/apache2/conf/modules.d. All the other modules (ie: 70_mod_php.conf etc) appear in both directories, though the dates in  /etc/apache2/conf/modules.d are all old - I presume this old directory is obsolete now and I can nuke it? All the new dates  (ie: 70_mod_php.conf etc) plus the existence of the new 70_mod_php5.conf tells me that the directory structure has changed now, correct?

Anyway, I had a search for libphp5.so and can't find it anywhere on the system. I did find /usr/lib/apache2/modules/libphp4.so but that's it. So I'm naturally assuming that the reason the web server won't play php pages is simply because this is missing.

I can view plain html sites OK, so Apache is working in vanilla mode just fine, and if I run the phpinfo() business from the command line, php5 seems to work. It just seems to be the php5 equivalent of mod_php that is giving me grief.

Can anybody tell me how to get this going?Last edited by NotExcessive on Wed May 24, 2006 2:50 pm; edited 2 times in total

----------

## nobspangle

Sounds like your apache config is a bit confused.

The line

```
LoadModule php5_module modules/libphp5.so
```

shouldn't be in httpd.conf, it goes in 70_mod_php5.conf

You don't need a

```
/etc/apache2/conf
```

directory anymore all configuration is now just in

```
/etc/apache2
```

libphp5.so should be in /usr/lib/apache2/modules/

if it is not there emerge php again, I would check the USE flags by doing

```
emerge -av dev-lang/php
```

make sure apache2 is enabled.

Once you have apache started check the command line used with

```
ps aux | grep apache
```

You should be able to see the -D PHP5 in the command line used

It may also be worth adding -D INFO in conf.d/apache2 so you can check the http://localhost/server-info

----------

## NotExcessive

 *nobspangle wrote:*   

> The line
> 
> ```
> LoadModule php5_module modules/libphp5.so
> ```
> ...

 

OK, I've removed that now. The only reason I changed "4" to "5" in that line was because the line was originally placed there by the apache2 build procedure in the first place. I'll assume that if I did a ground-up apache installation on a new machine, that line wouldn't appear in httpd.conf any more.

I've also deleted the /etc/apache2/conf directory.

I've re-emerged php again by using

```
emerge -av dev-lang/php
```

and it comes back with

```
These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] dev-lang/php-5.1.4  -adabas -apache +apache2 -bcmath -berkdb -bi rdstep -bzip2 -calendar -cdb -cgi -cjk +cli -crypt -ctype -curl -curlwrappers -d b2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase -f tp +gd -gd-external -gdbm -gmp -hardenedphp -hash -hyperwave-api -iconv -imap -i nformix -inifile -interbase -iodbc -ipv6 -java-external -kerberos +ldap -libedit  -mcve -memlimit -mhash -ming -msql -mssql +mysql -mysqli -ncurses -nls -oci8 -o ci8-instant-client -odbc -pcntl +pcre -pdo -pdo-external -pic -posix -postgres - qdbm -readline -recode -reflection -sapdb -sasl +session -sharedext -sharedmem - simplexml -snmp -soap -sockets -solid -spell -spl -sqlite -ssl -sybase -sybase-c t -sysvipc -threads -tidy -tokenizer -truetype +unicode -vm-goto -vm-switch -wdd x +xml -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip +zlib* 0 kB

Total size of downloads: 0 kB

```

so it's definitely using the apache2 flag.

Starting the compile, it issues forth

```
 * Determining SAPI(s) to build

 *   Enabled  SAPI: cli

 *   Disabled SAPI: cgi

 *   Disabled SAPI: apache

 *   Enabled  SAPI: apache2
```

So it looks like it's definitely building php in command-line and apache2 flavours.

After the compilation is over, no errors, and I restart:

```
 /etc/init.d/apache2 restart

 * Stopping apache2 ...                                           [ ok ]

 * Starting apache2 ...                                            [ ok ]
```

Issuing 

```
ps aux | grep apache
```

  shows me

```
ps aux | grep apache

root     23016  0.7  0.7  15660  6880 ?        Ss   09:56   0:00 /usr/sbin/apache2 -D PHP5 -D DEFAULT_VHOST -D INFO -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -k start

apache   23020  0.0  0.6  15080  6224 ?        S    09:56   0:00 /usr/sbin/apache2 -D PHP5 -D DEFAULT_VHOST -D INFO -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -k start

apache   23021  0.0  0.7  15660  6908 ?        S    09:56   0:00 /usr/sbin/apache2 -D PHP5 -D DEFAULT_VHOST -D INFO -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -k start

apache   23023  0.0  0.7  15660  6908 ?        S    09:56   0:00 /usr/sbin/apache2 -D PHP5 -D DEFAULT_VHOST -D INFO -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -k start

apache   23024  0.0  0.7  15660  6908 ?        S    09:56   0:00 /usr/sbin/apache2 -D PHP5 -D DEFAULT_VHOST -D INFO -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -k start

apache   23025  0.0  0.7  15660  6908 ?        S    09:56   0:00 /usr/sbin/apache2 -D PHP5 -D DEFAULT_VHOST -D INFO -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -k start

apache   23026  0.0  0.7  15660  6908 ?        S    09:56   0:00 /usr/sbin/apache2 -D PHP5 -D DEFAULT_VHOST -D INFO -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -k start

root     23028  0.0  0.0   1532   528 pts/1    S+   09:56   0:00 grep apache
```

Now looking to make sure the missing file is there:

```
slocate *.so | grep php
```

shows me

```
/usr/lib/apache2/modules/libphp5.so
```

so it looks like that was indeed successful.

However, when I go to view my php site, I still have the same problem: "what do you want to do with this thing?"

I removed the symlink in /etc/apache2 that pointed to /etc/php/apache2-php5/php.ini (don't know if I need to do that) but it makes no difference anyway. Seeing as how I included the -D INFO flag at your sugesstion, this is the output from looking at http://localhost/server-info:

```
Apache Server Information

Server Settings, mod_php5.c, mod_include.c, mod_deflate.c, mod_ext_filter.c, mod_dir.c, mod_autoindex.c, mod_actions.c, mod_status.c, mod_info.c, mod_rewrite.c, mod_alias.c, mod_suexec.c, mod_cgid.c, mod_cgi.c, mod_logio.c, mod_log_config.c, mod_setenvif.c, mod_negotiation.c, mod_mime.c, mod_headers.c, mod_expires.c, mod_env.c, mod_charset_lite.c, mod_auth_digest.c, mod_auth_dbm.c, mod_auth_anon.c, mod_auth.c, mod_access.c, mod_so.c, http_core.c, prefork.c, core.c

Server Version: Apache

Server Built: May 23 2006 22:51:09

API Version: 20020903:11

Hostname/port: localhost:80

Timeouts: connection: 300    keep-alive: 300

MPM Name: Prefork

MPM Information: Max Daemons: 150 Threaded: no Forked: yes

Server Root: /usr/lib/apache2

Config File: /etc/apache2/httpd.conf

Module Name: mod_php5.c

Content handlers: yes

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: none

Module Directives:

    php_value - PHP Value Modifier

    php_flag - PHP Flag Modifier

    php_admin_value - PHP Value Modifier (Admin)

    php_admin_flag - PHP Flag Modifier (Admin)

    PHPINIDir - Directory containing the php.ini file

Current Configuration:

Module Name: mod_include.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Create Server Config

Request Phase Participation: Fixups

Module Directives:

    XBitHack - Off, On, or Full

    SSIErrorMsg - a string

    SSITimeFormat - a strftime(3) formatted string

    SSIStartTag - SSI Start String Tag

    SSIEndTag - SSI End String Tag

    SSIUndefinedEcho - SSI Start String Tag

Current Configuration:

Module Name: mod_deflate.c

Content handlers: none

Configuration Phase Participation: Create Server Config

Request Phase Participation: none

Module Directives:

    DeflateFilterNote - Set a note to report on compression ratio

    DeflateWindowSize - Set the Deflate window size (1-15)

    DeflateBufferSize - Set the Deflate Buffer Size

    DeflateMemLevel - Set the Deflate Memory Level (1-9)

    DeflateCompressionLevel - Set the Deflate Compression Level (1-9)

Current Configuration:

Module Name: mod_ext_filter.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Merge Directory Configs, Create Server Config

Request Phase Participation: none

Module Directives:

    ExtFilterOptions - valid options: DebugLevel=n, LogStderr, NoLogStderr

    ExtFilterDefine - Define an external filter

Current Configuration:

Module Name: mod_dir.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: Fixups

Module Directives:

    DirectoryIndex - a list of file names

    AddDirectoryIndex - a list of file names

    RemoveDirectoryIndex - a list of file names

    DirectorySlash - On or Off

Current Configuration:

    DirectoryIndex index.html index.php

    AddDirectoryIndex index.php index.phtml

    DirectoryIndex index.html index.html.var

Module Name: mod_autoindex.c

Content handlers: yes

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: none

Module Directives:

    AddIcon - an icon URL followed by one or more filenames

    AddIconByType - an icon URL followed by one or more MIME types

    AddIconByEncoding - an icon URL followed by one or more content encodings

    AddAlt - alternate descriptive text followed by one or more filenames

    AddAltByType - alternate descriptive text followed by one or more MIME types

    AddAltByEncoding - alternate descriptive text followed by one or more content encodings

    IndexOptions - one or more index options [+|-][]

    IndexOrderDefault - {Ascending,Descending} {Name,Size,Description,Date}

    IndexIgnore - one or more file extensions

    AddDescription - Descriptive text followed by one or more filenames

    HeaderName - a filename

    ReadmeName - a filename

    FancyIndexing - The FancyIndexing directive is no longer supported. Use IndexOptions FancyIndexing.

    DefaultIcon - an icon URL

Current Configuration:

    IndexOptions FancyIndexing VersionSort

    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

    AddIconByType (TXT,/icons/text.gif) text/*

    AddIconByType (IMG,/icons/image2.gif) image/*

    AddIconByType (SND,/icons/sound2.gif) audio/*

    AddIconByType (VID,/icons/movie.gif) video/*

    AddIcon /icons/binary.gif .bin .exe

    AddIcon /icons/binhex.gif .hqx

    AddIcon /icons/tar.gif .tar

    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv

    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip

    AddIcon /icons/a.gif .ps .ai .eps

    AddIcon /icons/layout.gif .html .shtml .htm .pdf

    AddIcon /icons/text.gif .txt

    AddIcon /icons/c.gif .c

    AddIcon /icons/p.gif .pl .py

    AddIcon /icons/f.gif .for

    AddIcon /icons/dvi.gif .dvi

    AddIcon /icons/uuencoded.gif .uu

    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl

    AddIcon /icons/tex.gif .tex

    AddIcon /icons/bomb.gif core

    AddIcon /icons/back.gif ..

    AddIcon /icons/hand.right.gif README

    AddIcon /icons/folder.gif ^^DIRECTORY^^

    AddIcon /icons/blank.gif ^^BLANKICON^^

    DefaultIcon /icons/unknown.gif

    ReadmeName README.html

    HeaderName HEADER.html

    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t .svn

Module Name: mod_actions.c

Content handlers: yes

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: none

Module Directives:

    Action - a media type followed by a script name

    Script - a method followed by a script name

Current Configuration:

Module Name: mod_status.c

Content handlers: yes

Configuration Phase Participation: none

Request Phase Participation: none

Module Directives:

    ExtendedStatus - "On" to enable extended status information, "Off" to disable

Current Configuration:

    ExtendedStatus On

Module Name: mod_info.c

Content handlers: yes

Configuration Phase Participation: Create Server Config, Merge Server Configs

Request Phase Participation: none

Module Directives:

    AddModuleInfo - a module name and additional information on that module

Current Configuration:

Module Name: mod_rewrite.c

Content handlers: yes

Configuration Phase Participation: Create Directory Config, Merge Directory Configs, Create Server Config, Merge Server Configs

Request Phase Participation: Translate Path, Check Type, Fixups

Module Directives:

    RewriteEngine - On or Off to enable or disable (default) the whole rewriting engine

    RewriteOptions - List of option strings to set

    RewriteBase - the base URL of the per-directory context

    RewriteCond - an input string and a to be applied regexp-pattern

    RewriteRule - an URL-applied regexp-pattern and a substitution URL

    RewriteMap - a mapname and a filename

    RewriteLock - the filename of a lockfile used for inter-process synchronization

    RewriteLog - the filename of the rewriting logfile

    RewriteLogLevel - the level of the rewriting logfile verbosity (0=none, 1=std, .., 9=max)

Current Configuration:

Module Name: mod_alias.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Merge Directory Configs, Create Server Config, Merge Server Configs

Request Phase Participation: Translate Path, Fixups

Module Directives:

    Alias - a fakename and a realname

    ScriptAlias - a fakename and a realname

    Redirect - an optional status, then document to be redirected and destination URL

    AliasMatch - a regular expression and a filename

    ScriptAliasMatch - a regular expression and a filename

    RedirectMatch - an optional status, then a regular expression and destination URL

    RedirectTemp - a document to be redirected, then the destination URL

    RedirectPermanent - a document to be redirected, then the destination URL

Current Configuration:

    Alias /icons/ "/var/www/localhost/icons/"

    ScriptAlias /cgi-bin/ /var/www/localhost/cgi-bin/

Module Name: mod_suexec.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Create Server Config

Request Phase Participation: none

Module Directives:

    SuexecUserGroup - User and group for spawned processes

Current Configuration:

Module Name: mod_cgid.c

Content handlers: yes

Configuration Phase Participation: Create Server Config, Merge Server Configs

Request Phase Participation: none

Module Directives:

    ScriptLog - the name of a log for script debugging info

    ScriptLogLength - the maximum length (in bytes) of the script debug log

    ScriptLogBuffer - the maximum size (in bytes) to record of a POST request

    Scriptsock - the name of the socket to use for communication with the cgi daemon.

Current Configuration:

Module Name: mod_cgi.c

Content handlers: yes

Configuration Phase Participation: Create Server Config, Merge Server Configs

Request Phase Participation: none

Module Directives:

    ScriptLog - the name of a log for script debugging info

    ScriptLogLength - the maximum length (in bytes) of the script debug log

    ScriptLogBuffer - the maximum size (in bytes) to record of a POST request

Current Configuration:

Module Name: mod_logio.c

Content handlers: none

Configuration Phase Participation: none

Request Phase Participation: Logging

Module Directives: none

Module Name: mod_log_config.c

Content handlers: none

Configuration Phase Participation: Create Server Config, Merge Server Configs

Request Phase Participation: Logging

Module Directives:

    CustomLog - a file name, a custom log format string or format name, and an optional "env=" clause (see docs)

    TransferLog - the filename of the access log

    LogFormat - a log format string (see docs) and an optional format name

    CookieLog - the filename of the cookie log

    BufferedLogs - Enable Buffered Logging (experimental)

Current Configuration:

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    LogFormat "%{Referer}i -> %U" referer

    LogFormat "%{User-agent}i" agent

    LogFormat "%v %h %l %u %t \"%r\" %>s %b %T" script

    LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" VLOG=%{VLOG}e" vhost

    CustomLog logs/access_log combined

Module Name: mod_setenvif.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Merge Directory Configs, Create Server Config, Merge Server Configs

Request Phase Participation: Post-Read Request, Header Parse

Module Directives:

    SetEnvIf - A header-name, regex and a list of variables.

    SetEnvIfNoCase - a header-name, regex and a list of variables.

    BrowserMatch - A browser regex and a list of variables.

    BrowserMatchNoCase - A browser regex and a list of variables.

Current Configuration:

    BrowserMatch "Mozilla/2" nokeepalive

    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

    BrowserMatch "RealPlayer 4\.0" force-response-1.0

    BrowserMatch "Java/1\.0" force-response-1.0

    BrowserMatch "JDK/1\.0" force-response-1.0

    BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully

    BrowserMatch "^WebDrive" redirect-carefully

    BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully

    BrowserMatch "^gnome-vfs" redirect-carefully

Module Name: mod_negotiation.c

Content handlers: yes

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: Check Type, Fixups

Module Directives:

    CacheNegotiatedDocs - Either 'on' or 'off' (default)

    LanguagePriority - space-delimited list of MIME language abbreviations

    ForceLanguagePriority - Force LanguagePriority elections, either None, or Fallback and/or Prefer

Current Configuration:

    LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW

    ForceLanguagePriority Prefer Fallback

Module Name: mod_mime.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: Check Type

Module Directives:

    AddCharset - a charset (e.g., iso-2022-jp), followed by one or more file extensions

    AddEncoding - an encoding (e.g., gzip), followed by one or more file extensions

    AddHandler - a handler name followed by one or more file extensions

    AddInputFilter - input filter name (or ; delimited names) followed by one or more file extensions

    AddLanguage - a language (e.g., fr), followed by one or more file extensions

    AddOutputFilter - output filter name (or ; delimited names) followed by one or more file extensions

    AddType - a mime type followed by one or more file extensions

    DefaultLanguage - language to use for documents with no other language file extension

    MultiviewsMatch - NegotiatedOnly (default), Handlers and/or Filters, or Any

    RemoveCharset - one or more file extensions

    RemoveEncoding - one or more file extensions

    RemoveHandler - one or more file extensions

    RemoveInputFilter - one or more file extensions

    RemoveLanguage - one or more file extensions

    RemoveOutputFilter - one or more file extensions

    RemoveType - one or more file extensions

    TypesConfig - the MIME types config file

    ModMimeUsePathInfo - Set to 'yes' to allow mod_mime to use path info for type checking

Current Configuration:

    AddHandler php-script php

    AddType text/html php

    AddType application/x-httpd-php-source phps

    AddType application/x-httpd-php .php

    AddType application/x-httpd-php .phtml

    AddType application/x-httpd-php .php3

    AddType application/x-httpd-php .php4

    AddType application/x-httpd-php .php5

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

    TypesConfig /etc/mime.types

    AddLanguage ca .ca

    AddLanguage cs .cz .cs

    AddLanguage da .dk

    AddLanguage de .de

    AddLanguage el .el

    AddLanguage en .en

    AddLanguage eo .eo

    AddLanguage es .es

    AddLanguage et .et

    AddLanguage fr .fr

    AddLanguage he .he

    AddLanguage hr .hr

    AddLanguage it .it

    AddLanguage ja .ja

    AddLanguage ko .ko

    AddLanguage ltz .ltz

    AddLanguage nl .nl

    AddLanguage nn .nn

    AddLanguage no .no

    AddLanguage pl .po

    AddLanguage pt .pt

    AddLanguage pt-BR .pt-br

    AddLanguage ru .ru

    AddLanguage sv .sv

    AddLanguage zh-CN .zh-cn

    AddLanguage zh-TW .zh-tw

    AddCharset ISO-8859-1 .iso8859-1 .latin1

    AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen

    AddCharset ISO-8859-3 .iso8859-3 .latin3

    AddCharset ISO-8859-4 .iso8859-4 .latin4

    AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru

    AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb

    AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk

    AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb

    AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk

    AddCharset ISO-2022-JP .iso2022-jp .jis

    AddCharset ISO-2022-KR .iso2022-kr .kis

    AddCharset ISO-2022-CN .iso2022-cn .cis

    AddCharset Big5 .Big5 .big5

    AddCharset WINDOWS-1251 .cp-1251 .win-1251

    AddCharset CP866 .cp866

    AddCharset KOI8-r .koi8-r .koi8-ru

    AddCharset KOI8-ru .koi8-uk .ua

    AddCharset ISO-10646-UCS-2 .ucs2

    AddCharset ISO-10646-UCS-4 .ucs4

    AddCharset UTF-8 .utf8

    AddCharset GB2312 .gb2312 .gb

    AddCharset utf-7 .utf7

    AddCharset utf-8 .utf8

    AddCharset big5 .big5 .b5

    AddCharset EUC-TW .euc-tw

    AddCharset EUC-JP .euc-jp

    AddCharset EUC-KR .euc-kr

    AddCharset shift_jis .sjis

    AddType application/x-compress .Z

    AddType application/x-gzip .gz .tgz

    AddHandler type-map var

Module Name: mod_headers.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: Fixups

Module Directives:

    Header - an optional condition, an action, header and value followed by optional env clause

    RequestHeader - an action, header and value

Current Configuration:

Module Name: mod_expires.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: none

Module Directives:

    ExpiresActive - Limited to 'on' or 'off'

    ExpiresByType - a MIME type followed by an expiry date code

    ExpiresDefault - an expiry date code

Current Configuration:

Module Name: mod_env.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: Fixups

Module Directives:

    PassEnv - a list of environment variables to pass to CGI.

    SetEnv - an environment variable name and optional value to pass to CGI.

    UnsetEnv - a list of variables to remove from the CGI environment.

Current Configuration:

Module Name: mod_charset_lite.c

Content handlers: none

Configuration Phase Participation: Create Directory Config, Merge Directory Configs

Request Phase Participation: Fixups

Module Directives:

    CharsetSourceEnc - source (html,cgi,ssi) file charset

    CharsetDefault - name of default charset

    CharsetOptions - valid options: ImplicitAdd, NoImplicitAdd, DebugLevel=n

Current Configuration:

Module Name: mod_auth_digest.c

Content handlers: none

Configuration Phase Participation: Create Directory Config

Request Phase Participation: Post-Read Request, Verify User ID, Verify User Access, Fixups

Module Directives:

    AuthName - The authentication realm (e.g. "Members Only")

    AuthDigestFile - The name of the file containing the usernames and password hashes

    AuthDigestGroupFile - The name of the file containing the group names and members

    AuthDigestQop - A list of quality-of-protection options

    AuthDigestNonceLifetime - Maximum lifetime of the server nonce (seconds)

    AuthDigestNonceFormat - The format to use when generating the server nonce

    AuthDigestNcCheck - Whether or not to check the nonce-count sent by the client

    AuthDigestAlgorithm - The algorithm used for the hash calculation

    AuthDigestDomain - A list of URI's which belong to the same protection space as the current URI

    AuthDigestShmemSize - The amount of shared memory to allocate for keeping track of clients

Current Configuration:

Module Name: mod_auth_dbm.c

Content handlers: none

Configuration Phase Participation: Create Directory Config

Request Phase Participation: Verify User ID, Verify User Access

Module Directives:

    AuthDBMUserFile - dbm database file containing user IDs and passwords

    AuthDBMGroupFile - dbm database file containing group names and member user IDs

    AuthUserFile - 

    AuthGroupFile - 

    AuthDBMType - what type of DBM file the user file is

    AuthDBMAuthoritative - Set to 'no' to allow access control to be passed along to lower modules, if the UserID is not known in this module

Current Configuration:

Module Name: mod_auth_anon.c

Content handlers: none

Configuration Phase Participation: Create Directory Config

Request Phase Participation: Verify User ID, Verify User Access

Module Directives:

    Anonymous - a space-separated list of user IDs

    Anonymous_MustGiveEmail - Limited to 'on' or 'off'

    Anonymous_NoUserId - Limited to 'on' or 'off'

    Anonymous_VerifyEmail - Limited to 'on' or 'off'

    Anonymous_LogEmail - Limited to 'on' or 'off'

    Anonymous_Authoritative - Limited to 'on' or 'off'

Current Configuration:

Module Name: mod_auth.c

Content handlers: none

Configuration Phase Participation: Create Directory Config

Request Phase Participation: Verify User ID, Verify User Access

Module Directives:

    AuthUserFile - text file containing user IDs and passwords

    AuthGroupFile - text file containing group names and member user IDs

    AuthAuthoritative - Set to 'no' to allow access control to be passed along to lower modules if the UserID is not known to this module

Current Configuration:

Module Name: mod_access.c

Content handlers: none

Configuration Phase Participation: Create Directory Config

Request Phase Participation: Check Access

Module Directives:

    order - 'allow,deny', 'deny,allow', or 'mutual-failure'

    allow - 'from' followed by hostnames or IP-address wildcards

    deny - 'from' followed by hostnames or IP-address wildcards

Current Configuration:

    <Files ~ "^\.ht">

      Order allow,deny

      Deny from all

    </Files>

    <Directory "/var/www/localhost/icons/">

      Order allow,deny

      Allow from all

    </Directory>

    <Directory "/var/www/localhost/cgi-bin/">

      Order allow,deny

      Allow from all

    </Directory>

    <Location /server-status>

      Order deny,allow

      Deny from all

      Allow from localhost

    </Location>

    <Location /server-info>

      Order deny,allow

      Deny from all

      Allow from localhost

    </Location>

    <Directory "/var/www/localhost/htdocs">

        Order allow,deny

    <Directory "/var/www/localhost/htdocs">

        Allow from all

    </Directory>

Module Name: mod_so.c

Content handlers: none

Configuration Phase Participation: Create Server Config

Request Phase Participation: none

Module Directives:

    LoadModule - a module name and the name of a shared object file to load it from

    LoadFile - shared object file or library to load into the server at runtime

Current Configuration:

Module Name: http_core.c

Content handlers: none

Configuration Phase Participation: none

Request Phase Participation: none

Module Directives:

    KeepAliveTimeout - Keep-Alive timeout duration (sec)

    MaxKeepAliveRequests - Maximum number of Keep-Alive requests per connection, or 0 for infinite

    KeepAlive - Whether persistent connections should be On or Off

Current Configuration:

    KeepAlive On

    MaxKeepAliveRequests 100

    KeepAliveTimeout 15

Module Name: prefork.c

Content handlers: none

Configuration Phase Participation: none

Request Phase Participation: none

Module Directives:

    User - Effective user id for this server

    Group - Effective group id for this server

    ListenBacklog - Maximum length of the queue of pending connections, as used by listen(2)

    Listen - A port number or a numeric IP address and a port number

    SendBufferSize - Send buffer size in bytes

    StartServers - Number of child processes launched at server startup

    MinSpareServers - Minimum number of idle children, to handle request spikes

    MaxSpareServers - Maximum number of idle children

    MaxClients - Maximum number of children alive at the same time

    ServerLimit - Maximum value of MaxClients for this run of Apache

Current Configuration:

    StartServers 5

    MinSpareServers 5

    MaxSpareServers 10

    MaxClients 150

    Listen 80

    User apache

    Group apache

Module Name: core.c

Content handlers: yes

Configuration Phase Participation: Create Directory Config, Merge Directory Configs, Create Server Config, Merge Server Configs

Request Phase Participation: Translate Path, Check Access, Check Type, Fixups

Module Directives:

    <Directory - Container for directives affecting resources located in the specified directories

    <Location - Container for directives affecting resources accessed through the specified URL paths

    <VirtualHost - Container to map directives to a particular virtual host, takes one or more host addresses

    <Files - Container for directives affecting files matching specified patterns

    <Limit - Container for authentication directives when accessed using specified HTTP methods

    <LimitExcept - Container for authentication directives to be applied when any HTTP method other than those specified is used to access the resource

    <IfModule - Container for directives based on existance of specified modules

    <IfDefine - Container for directives based on existance of command line defines

    <DirectoryMatch - Container for directives affecting resources located in the specified directories

    <LocationMatch - Container for directives affecting resources accessed through the specified URL paths

    <FilesMatch - Container for directives affecting files matching specified patterns

    AuthType - An HTTP authorization type (e.g., "Basic")

    AuthName - The authentication realm (e.g. "Members Only")

    Require - Selects which authenticated users or groups may access a protected space

    Satisfy - access policy if both allow and require used ('all' or 'any')

    AddDefaultCharset - The name of the default charset to add to any Content-Type without one or 'Off' to disable

    AcceptPathInfo - Set to on or off for PATH_INFO to be accepted by handlers, or default for the per-handler preference

    AccessFileName - Name(s) of per-directory config files (default: .htaccess)

    DocumentRoot - Root directory of the document tree

    ErrorDocument - Change responses for HTTP errors

    AllowOverride - Controls what groups of directives can be configured by per-directory config files

    Options - Set a number of attributes for a given directory

    DefaultType - the default MIME type for untypable files

    FileETag - Specify components used to construct a file's ETag

    EnableMMAP - Controls whether memory-mapping may be used to read files

    EnableSendfile - Controls whether sendfile may be used to transmit files

    Port - Port was replaced with Listen in Apache 2.0

    HostnameLookups - "on" to enable, "off" to disable reverse DNS lookups, or "double" to enable double-reverse DNS lookups

    ServerAdmin - The email address of the server administrator

    ServerName - The hostname and port of the server

    ServerSignature - En-/disable server signature (on|off|email)

    ServerRoot - Common directory of server-related files (logs, confs, etc.)

    ErrorLog - The filename of the error log

    ServerAlias - A name or names alternately used to access the server

    ServerPath - The pathname the server can be reached at

    Timeout - Timeout duration (sec)

    IdentityCheck - Enable identd (RFC 1413) user lookups - SLOW

    ContentDigest - whether or not to send a Content-MD5 header with each request

    UseCanonicalName - How to work out the ServerName : Port when constructing URLs

    Include - Name of the config file to be included

    LogLevel - Level of verbosity in error logging

    NameVirtualHost - A numeric IP address:port, or the name of a host

    ServerTokens - Determine tokens displayed in the Server: header - Min(imal), OS or Full

    LimitRequestLine - Limit on maximum size of an HTTP request line

    LimitRequestFieldsize - Limit on maximum size of an HTTP request header field

    LimitRequestFields - Limit (0 = unlimited) on max number of header fields in a request message

    LimitRequestBody - Limit (in bytes) on maximum size of request message body

    LimitXMLRequestBody - Limit (in bytes) on maximum size of an XML-based request body

    RLimitCPU - Soft/hard limits for max CPU usage in seconds

    RLimitMEM - Soft/hard limits for max memory usage per process

    RLimitNPROC - soft/hard limits for max number of processes per uid

    LimitInternalRecursion - maximum recursion depth of internal redirects and subrequests

    ForceType - a mime type that overrides other configured type

    SetHandler - a handler name that overrides any other configured handler

    SetOutputFilter - filter (or ; delimited list of filters) to be run on the request content

    SetInputFilter - filter (or ; delimited list of filters) to be run on the request body

    AddOutputFilterByType - output filter name followed by one or more content-types

    AllowEncodedSlashes - Allow URLs containing '/' encoded as '%2F'

    PidFile - A file for logging the server process ID

    ScoreBoardFile - A file for Apache to maintain runtime process management information

    LockFile - The lockfile used when Apache needs to lock the accept() call

    MaxRequestsPerChild - Maximum number of requests a particular child serves before dying.

    CoreDumpDirectory - The location of the directory Apache changes to before dumping core

    AcceptMutex - Valid accept mutexes for this platform and MPM are: default, flock, fcntl, sysvsem.

    MaxMemFree - Maximum number of 1k blocks a particular childs allocator may hold.

    TraceEnable - 'on' (default), 'off' or 'extended' to trace request body content

Current Configuration:

    PidFile "/var/run/apache2.pid"

    Timeout 300

    MaxRequestsPerChild 0

    ServerAdmin dean@itxpress.com.au

    ServerName 192.168.1.2

    UseCanonicalName Off

    <Directory />

      Options FollowSymLinks

      AllowOverride None

    </Directory>

    AccessFileName .htaccess

    DefaultType text/plain

    HostnameLookups On

    ErrorLog logs/error_log

    LogLevel warn

    ServerTokens Prod

    ServerSignature On

    <Directory "/var/www/localhost/icons/">

      Options Indexes MultiViews

      AllowOverride None

    </Directory>

    <Directory "/var/www/localhost/cgi-bin/">

      AllowOverride None

      Options None

    </Directory>

    AddDefaultCharset ISO-8859-1

    <Location /server-status>

      SetHandler server-status

    </Location>

    <Location /server-info>

      SetHandler server-info

    </Location>

    NameVirtualHost *:80

    <VirtualHost *:80>

      DocumentRoot "/var/www/localhost/htdocs"

    <Directory "/var/www/localhost/htdocs">

        Options Indexes FollowSymLinks

        AllowOverride None

    </Directory>

Apache Server at localhost Port 80
```

I just can't see why it's not working.

----------

## llongi

Did you try with emptying your browser's cache and restaring it? Or try from another computer? A lot of times we've seen this behaviour because of caches between the client and the server, either proxys or the browser's cache...

----------

## NotExcessive

Actually, I got it going just a little while ago.

Firstly I upgraded /etc/mime.types from v4 to v5. I noticed that in v5, all references to anything php are gone.

Then, I completely deleted all of Apache2 and did a reinstall, because I didn't like the left-over mess with /etc/apache/conf etc from its previous life. Slop like the copy of php.ini and a copy of mime.types in /etc/apache2 are gone and it's nice and clean now. I then emerged php again to modify whatever in Apache needed modifying - creating 70_mod_php5.conf in /etc/apache2/modules.d for example. 

Then I copied my old /etc/conf.d/apache2 file over (to get the APACHE_OPTS parameters like -D PHP5 back) and copied a test file (the phpinfo business) into doc root and lo and behold, when I browsed localhost/phptest.php, I got the phpinfo display page. So far so good.

Now I copied back my old httpd.conf, which has several virtual servers listed in it. The system instantly brain-farted and stopped playing php. Doing a diff on the old and new httpd.conf files, I found these lines were removed from the new version:

```
 LoadModule php4_module        modules/libphp4.so

> DirectoryIndex index.html index.php

> AddHandler php-script   php

> AddType text/html       php

> AddType application/x-httpd-php-source phps

```

I had changed the first line in the old file to 

```
LoadModule php5_module        modules/libphp5.so
```

 when I started all this but it didn't work, so I had removed it totally. Now I removed those final four lines as well.

Presto. It all works.

I didn't upgrade Apache at all. It was v 2.0.55-r1before and after upgrading from php4.4 to php5.1.4. I think the best thing people can do when they want to go from php4 to php5 is to backup their two Apache config files and just reinstall Apache from the ground up. It's easier and cleaner. Seems a lot of stuff's been moved around in php's evolution.

----------

