# [Solved] Cant Get PHP5 to work with Apache

## AMABITxS

Ok, I emerged php5 and apache. It took me a while to figure out the new config file layout but I got that.

Then I started Apache with the init script. I got the "It works!" page as expected, but the php module was not being loaded.

The problem there was I had not put "apache2" in the USE variable. 

So, I re-emerged php. Now I have a php module, but apache still does not execute the php code.

```

Mars apache2 #  ls -l /usr/lib/apache2/modules/libphp5.so

-rwxr-xr-x 1 root root 5070560 Jul  1 19:11 /usr/lib/apache2/modules/libphp5.so

```

I checked the APACHE2_OPTS and php modules files for the "-D PHP5" and "AddType" lines.

/etc/conf.d/apache2:

```

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D PHP5"

```

/etc/apache2/ modules.d/70_mod_php5.conf:

```

<IfDefine PHP5>

        # Load the module first

        <IfModule !mod_php5.c>

                LoadModule php5_module    modules/libphp5.so

        </IfModule>

        # Set it to handle the files

        <IfModule mod_mime.c>

                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

        </IfModule>

        DirectoryIndex index.php index.phtml

</IfDefine>

```

Apache does complains on start up but I don't think its related.

```

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

```

I just realized that the module is not loading because when I run "apache2 -t -D DUMP_MODULES"   PHP is not in the list:

I still have no idea why its not loaded though...

```

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Loaded Modules:

 core_module (static)

 mpm_prefork_module (static)

 http_module (static)

 so_module (static)

 actions_module (shared)

 alias_module (shared)

 auth_basic_module (shared)

 authn_alias_module (shared)

 authn_anon_module (shared)

 authn_dbm_module (shared)

 authn_default_module (shared)

 authn_file_module (shared)

 authz_dbm_module (shared)

 authz_default_module (shared)

 authz_groupfile_module (shared)

 authz_host_module (shared)

 authz_owner_module (shared)

 authz_user_module (shared)

 autoindex_module (shared)

 cgi_module (shared)

 deflate_module (shared)

 dir_module (shared)

 env_module (shared)

 expires_module (shared)

 ext_filter_module (shared)

 filter_module (shared)

 headers_module (shared)

 include_module (shared)

 log_config_module (shared)

 logio_module (shared)

 mime_module (shared)

 mime_magic_module (shared)

 negotiation_module (shared)

 rewrite_module (shared)

 setenvif_module (shared)

 speling_module (shared)

 unique_id_module (shared)

 usertrack_module (shared)

 vhost_alias_module (shared)

Syntax OK

```

And here is the compiled in stuff if it helps (apache2 -V):

```

Server version: Apache/2.2.9 (Unix)

Server built:   Jul  1 2008 18:21:44

Server's Module Magic Number: 20051115:15

Server loaded:  APR 1.2.11, APR-Util 1.2.10

Compiled using: APR 1.2.11, APR-Util 1.2.10

Architecture:   32-bit

Server MPM:     Prefork

  threaded:     no

    forked:     yes (variable process count)

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 DYNAMIC_MODULE_LIMIT=128

 -D HTTPD_ROOT="/usr"

 -D SUEXEC_BIN="/usr/sbin/suexec"

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

```

And no errors show up in the apache log. I'm stumped and I can't find anything else that looks relevant to my problem. Maybe its cause I'm new, I dunno.

I'm running a 2.6.24-gentoo-r5 kernel, Apache/2.2.9, and php-5.2.6_rc4.

Any Ideas?Last edited by AMABITxS on Thu Jul 10, 2008 4:07 am; edited 2 times in total

----------

## cassiol

hello,

please post apache error log.

try execute 

```

revdep-rebuild

```

----------

## AMABITxS

Well, here is the log, but it doesn't list any problems that I can see...

```

[Tue Jul 01 17:06:50 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations

[Tue Jul 01 17:36:15 2008] [notice] caught SIGTERM, shutting down

[Tue Jul 01 17:36:18 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations

[Tue Jul 01 17:43:01 2008] [notice] caught SIGTERM, shutting down

[Tue Jul 01 19:14:31 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g PHP/5.2.6RC4-pl0-gentoo configured -- resuming normal operations

[Tue Jul 01 19:32:08 2008] [notice] caught SIGTERM, shutting down

[Tue Jul 01 19:32:11 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g PHP/5.2.6RC4-pl0-gentoo configured -- resuming normal operations

[Tue Jul 01 19:37:32 2008] [notice] caught SIGTERM, shutting down

[Tue Jul 01 19:37:47 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g PHP/5.2.6RC4-pl0-gentoo configured -- resuming normal operations

[Tue Jul 01 20:03:41 2008] [notice] caught SIGTERM, shutting down

[Tue Jul 01 20:06:09 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g PHP/5.2.6RC4-pl0-gentoo configured -- resuming normal operations

[Tue Jul 01 23:11:37 2008] [notice] caught SIGTERM, shutting down

[Wed Jul 02 06:44:46 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g PHP/5.2.6RC4-pl0-gentoo configured -- resuming normal operations

[Wed Jul 02 08:48:33 2008] [notice] caught SIGTERM, shutting down

[Wed Jul 02 08:48:37 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g PHP/5.2.6RC4-pl0-gentoo configured -- resuming normal operations

```

As for the "revdep-rebuild." I got a message from portage at the end of the php install that said to run it.....  I did it again and restarted apache. But it still doesn't work.

So am I just missing something entirely or what?

----------

## cassiol

helooo..

  the apache log is after revdep-rebuild? if no please repost apache error log.

that code is strange for me.  

```

[Wed Jul 02 08:48:33 2008] [notice] caught SIGTERM, shutting down 

```

----------

## Mad Merlin

 *AMABITxS wrote:*   

> I just realized that the module is not loading because when I run "apache2 -t -D DUMP_MODULES" PHP is not in the list:

 

Try 

```
apache2 -t -D PHP5 -D DUMP_MODULES
```

From a default config, all you should need to do is add the -D PHP5 to /etc/conf.d/apache2 and PHP will work.

----------

## AllenJB

How exactly are you testing PHP? It appears in your Apache verion line, which normally indicates that it's installed and enabled.

I have PHP5 installed an enabled and it does not show up in "apache2 -t -D DUMP_MODULES", which leads me to believe that this command only shows the modules included in the apache package itself.

----------

## XenoTerraCide

 *Quote:*   

> apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 

  although unrelated to shut this up (for now you'll probably need to change later) add 

```
ServerName localhost:80
```

 to httpd.conf

I agree though it looks like php is working from the log so what are you trying that does not work

----------

## AMABITxS

Thanks for all the help!!! Sorry it took so long for me to respond....

 I'll try and respond to everyone:

I'm pretty sure this one:

```
[Wed Jul 02 08:48:33 2008] [notice] caught SIGTERM, shutting down 
```

 Is just the message sent when I turn the computer off... correct me if I'm wrong.

As for the testing, I was opening the following page in my browser:

```
<html><body><h1>It works!</h1><br />

<php?

echo "Hello World";

?>

</body></html>

```

The "It works!" part comes out and the php stuff does not display. It does show up when I go to view the source from my web browser. And thats why I thought it wasn't working/configured right.

And when I run "apache2 -t -D PHP5 -D DUMP_MODULES"

This is what I get:

```
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Loaded Modules:

 core_module (static)

 mpm_prefork_module (static)

 http_module (static)

 so_module (static)

 actions_module (shared)

 alias_module (shared)

 auth_basic_module (shared)

 authn_alias_module (shared)

 authn_anon_module (shared)

 authn_dbm_module (shared)

 authn_default_module (shared)

 authn_file_module (shared)

 authz_dbm_module (shared)

 authz_default_module (shared)

 authz_groupfile_module (shared)

 authz_host_module (shared)

 authz_owner_module (shared)

 authz_user_module (shared)

 autoindex_module (shared)

 cgi_module (shared)

 deflate_module (shared)

 dir_module (shared)

 env_module (shared)

 expires_module (shared)

 ext_filter_module (shared)

 filter_module (shared)

 headers_module (shared)

 include_module (shared)

 log_config_module (shared)

 logio_module (shared)

 mime_module (shared)

 mime_magic_module (shared)

 negotiation_module (shared)

 rewrite_module (shared)

 setenvif_module (shared)

 speling_module (shared)

 unique_id_module (shared)

 usertrack_module (shared)

 vhost_alias_module (shared)

 php5_module (shared)

Syntax OK

```

So the php module shows up there, but I don't know why it didn't show up with just the "-D DUMP_MODULES" because its in "/etc/conf.d/apache2" in the "APACHE2_OPTS" variable.

I can use the command line to run php code, its just not running on my web page...

And lastly, I did get rid of the "apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName" message in the error log with your suggestion. Thanks!!

And once again thanks everyone for the help!!!!

----------

## AMABITxS

I was poking around and found the "configdump" option in \etc\init.d\apache2 

So, I hope it helps... 

```
/usr/sbin/apache2 started with '-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D PHP5 -d /usr/lib/apache2 -f /etc/apache2/httpd.conf'

   Configuration:

          In file: /etc/apache2/httpd.conf

             1: ServerName localhost:80

           138: User apache

           139: Group apache

          In file: /etc/apache2/modules.d/00_default_settings.conf

             5: Timeout 300

             9: KeepAlive On

            14: MaxKeepAliveRequests 100

            18: KeepAliveTimeout 15

            25: UseCanonicalName Off

            30: AccessFileName .htaccess

            38: ServerTokens Prod

            46: ServerSignature On

            54: HostnameLookups Off

            70: ErrorLog /var/log/apache2/error_log

            75: LogLevel warn

            78: <Directory />

            79:   Options FollowSymLinks

            80:   AllowOverride None

            81:   Order deny,allow

            82:   Deny from all

              : </Directory>

            95: DirectoryIndex index.html index.html.var index.php

           100: <FilesMatch "^\.ht">

           101:   Order allow,deny

           102:   Deny from all

              : </FilesMatch>

          In file: /etc/apache2/modules.d/00_languages.conf

            41: AddLanguage ca .ca

            42: AddLanguage cs .cz .cs

            43: AddLanguage da .dk

            44: AddLanguage de .de

            45: AddLanguage el .el

            46: AddLanguage en .en

            47: AddLanguage eo .eo

            48: AddLanguage es .es

            49: AddLanguage et .et

            50: AddLanguage fr .fr

            51: AddLanguage he .he

            52: AddLanguage hr .hr

            53: AddLanguage it .it

            54: AddLanguage ja .ja

            55: AddLanguage ko .ko

            56: AddLanguage ltz .ltz

            57: AddLanguage nl .nl

            58: AddLanguage nn .nn

            59: AddLanguage no .no

            60: AddLanguage pl .po

            61: AddLanguage pt .pt

            62: AddLanguage pt-BR .pt-br

            63: AddLanguage ru .ru

            64: AddLanguage sv .sv

            65: AddLanguage zh-CN .zh-cn

            66: AddLanguage zh-TW .zh-tw

            73: 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

            78: ForceLanguagePriority Prefer Fallback

            85: AddCharset us-ascii.ascii .us-ascii

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

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

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

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

            90: AddCharset ISO-8859-5 .iso8859-5 .cyr .iso-ru

            91: AddCharset ISO-8859-6 .iso8859-6 .arb .arabic

            92: AddCharset ISO-8859-7 .iso8859-7 .grk .greek

            93: AddCharset ISO-8859-8 .iso8859-8 .heb .hebrew

            94: AddCharset ISO-8859-9 .iso8859-9 .latin5 .trk

            95: AddCharset ISO-8859-10 .iso8859-10 .latin6

            96: AddCharset ISO-8859-13 .iso8859-13

            97: AddCharset ISO-8859-14 .iso8859-14 .latin8

            98: AddCharset ISO-8859-15 .iso8859-15 .latin9

            99: AddCharset ISO-8859-16 .iso8859-16 .latin10

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

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

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

           103: AddCharset Big5.Big5 .big5 .b5

           104: AddCharset cn-Big5 .cn-big5

           106: AddCharset WINDOWS-1251 .cp-1251 .win-1251

           107: AddCharset CP866 .cp866

           108: AddCharset KOI8 .koi8

           109: AddCharset KOI8-E .koi8-e

           110: AddCharset KOI8-r .koi8-r .koi8-ru

           111: AddCharset KOI8-U .koi8-u

           112: AddCharset KOI8-ru .koi8-uk .ua

           113: AddCharset ISO-10646-UCS-2 .ucs2

           114: AddCharset ISO-10646-UCS-4 .ucs4

           115: AddCharset UTF-7 .utf7

           116: AddCharset UTF-8 .utf8

           117: AddCharset UTF-16 .utf16

           118: AddCharset UTF-16BE .utf16be

           119: AddCharset UTF-16LE .utf16le

           120: AddCharset UTF-32 .utf32

           121: AddCharset UTF-32BE .utf32be

           122: AddCharset UTF-32LE .utf32le

           123: AddCharset euc-cn .euc-cn

           124: AddCharset euc-gb .euc-gb

           125: AddCharset euc-jp .euc-jp

           126: AddCharset euc-kr .euc-kr

           128: AddCharset EUC-TW .euc-tw

           129: AddCharset gb2312 .gb2312 .gb

           130: AddCharset iso-10646-ucs-2 .ucs-2 .iso-10646-ucs-2

           131: AddCharset iso-10646-ucs-4 .ucs-4 .iso-10646-ucs-4

           132: AddCharset shift_jis .shift_jis .sjis

          In file: /etc/apache2/modules.d/00_mod_autoindex.conf

             5: Alias /icons/ "/var/www/localhost/icons/"

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

             8:   Options Indexes MultiViews

             9:   AllowOverride None

            10:   Order allow,deny

            11:   Allow from all

              : </Directory>

            23: IndexOptions FancyIndexing VersionSort

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

          x-gzip

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

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

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

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

            35: AddIcon /icons/binary.gif .bin .exe

            36: AddIcon /icons/binhex.gif .hqx

            37: AddIcon /icons/tar.gif .tar

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

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

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

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

            42: AddIcon /icons/text.gif .txt

            43: AddIcon /icons/c.gif .c

            44: AddIcon /icons/p.gif .pl .py

            45: AddIcon /icons/f.gif .for

            46: AddIcon /icons/dvi.gif .dvi

            47: AddIcon /icons/uuencoded.gif .uu

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

            49: AddIcon /icons/tex.gif .tex

            50: AddIcon /icons/bomb.gif core

            52: AddIcon /icons/back.gif ..

            53: AddIcon /icons/hand.right.gif README

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

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

            59: DefaultIcon /icons/unknown.gif

            75: ReadmeName README.html

            76: HeaderName HEADER.html

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

          In file: /etc/apache2/modules.d/00_mod_info.conf

             5: <Location /server-info>

             6:   SetHandler server-info

             7:   Order deny,allow

             8:   Deny from all

             9:   Allow from 127.0.0.1

              : </Location>

          In file: /etc/apache2/modules.d/00_mod_log_config.conf

             4: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"

          \"%{User-Agent}i\"" combined

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

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

             8: LogFormat "%{User-Agent}i" agent

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

            10: LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\"

          \"%{User-Agent}i\" VLOG=%{VLOG}e" vhost

            14: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"

          \"%{User-Agent}i\" %I %O" combinedio

            15: LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\"

          \"%{User-Agent}i\" %I %O" vhostio

            23: CustomLog /var/log/apache2/access_log common

          In file: /etc/apache2/modules.d/00_mod_mime.conf

             8: DefaultType text/plain

            13: TypesConfig /etc/mime.types

            26: AddType application/x-compress .Z

            27: AddType application/x-gzip .gz .tgz

            52: MIMEMagicFile /etc/apache2/magic

          In file: /etc/apache2/modules.d/00_mpm.conf

             7: PidFile /var/run/apache2.pid

            31: StartServers 5

            32: MinSpareServers 5

            33: MaxSpareServers 10

            34: MaxClients 150

            35: MaxRequestsPerChild 10000

          In file: /etc/apache2/modules.d/40_mod_ssl.conf

             5: SSLRandomSeed startup builtin

             6: SSLRandomSeed connect builtin

            41: AddType application/x-x509-ca-cert .crt

            42: AddType application/x-pkcs7-crl .crl

            49: SSLPassPhraseDialog builtin

            55: SSLSessionCache shmcb:/var/run/ssl_scache(512000)

            56: SSLSessionCacheTimeout 300

            61: SSLMutex file:/var/run/ssl_mutex

          In file: /etc/apache2/modules.d/70_mod_php5.conf

             9: AddType application/x-httpd-php .php

            10: AddType application/x-httpd-php .phtml

            11: AddType application/x-httpd-php .php3

            12: AddType application/x-httpd-php .php4

            13: AddType application/x-httpd-php .php5

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

            17: DirectoryIndex index.php index.phtml

          In file: /etc/apache2/vhosts.d/00_default_ssl_vhost.conf

             9: Listen 443

            11: <VirtualHost _default_:443>

            12:   ServerName localhost

          In file: /etc/apache2/vhosts.d/default_vhost.include

             4:   ServerAdmin root@localhost

            12:   DocumentRoot "/var/www/localhost/htdocs"

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

            26:     Options Indexes FollowSymLinks

            31:     AllowOverride All

            34:     Order allow,deny

            35:     Allow from all

              :   </Directory>

            61:   ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/"

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

            67:     AllowOverride None

            68:     Options None

            69:     Order allow,deny

            70:     Allow from all

              :   </Directory>

          In file: /etc/apache2/vhosts.d/00_default_ssl_vhost.conf

            14:   ErrorLog /var/log/apache2/ssl_error_log

            17:   TransferLog /var/log/apache2/ssl_access_log

            22:   SSLEngine on

            27:   SSLCipherSuite

          ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

            35:   SSLCertificateFile /etc/apache2/ssl/server.crt

            43:   SSLCertificateKeyFile /etc/apache2/ssl/server.key

           129:   <FilesMatch "\.(cgi|shtml|phtml|php)$">

           130:     SSLOptions +StdEnvVars

              :   </FilesMatch>

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

           134:     SSLOptions +StdEnvVars

              :   </Directory>

           166:   BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown

          downgrade-1.0 force-response-1.0

           174:   CustomLog /var/log/apache2/ssl_request_log "%t %h

          %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

              : </VirtualHost>

          In file: /etc/apache2/vhosts.d/00_default_vhost.conf

            26: Listen 80

            29: NameVirtualHost *:80

            38: <VirtualHost *:80>

            39:   ServerName localhost

          In file: /etc/apache2/vhosts.d/default_vhost.include

             4:   ServerAdmin root@localhost

            12:   DocumentRoot "/var/www/localhost/htdocs"

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

            26:     Options Indexes FollowSymLinks

            31:     AllowOverride All

            34:     Order allow,deny

            35:     Allow from all

              :   </Directory>

            61:   ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/"

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

            67:     AllowOverride None

            68:     Options None

            69:     Order allow,deny

            70:     Allow from all

              :   </Directory>

          In file: /etc/apache2/vhosts.d/00_default_vhost.conf

              : </VirtualHost>

Server Settings

   Server Version: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g

          PHP/5.2.6RC4-pl0-gentoo

   Server Built: Jul 1 2008 18:21:44

   Module Magic Number: 20051115:15

   Hostname/port: localhost:80

   Timeouts: connection: 300    keep-alive: 300

   MPM Name: Prefork

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

   Server Architecture: 32-bit

   Server Root: /usr/lib/apache2

   Config File: /etc/apache2/httpd.conf

   Server Built 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

          SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D

          AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/usr" -D

          SUEXEC_BIN="/usr/sbin/suexec" -D

          DEFAULT_ERRORLOG="logs/error_log" -D

          AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types" -D

          SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"

   Server Module List

          mod_php5.c

          mod_vhost_alias.c

          mod_usertrack.c

          mod_unique_id.c

          mod_ssl.c

          mod_speling.c

          mod_setenvif.c

          mod_rewrite.c

          mod_negotiation.c

          mod_mime_magic.c

          mod_mime.c

          mod_logio.c

          mod_log_config.c

          mod_info.c

          mod_include.c

          mod_headers.c

          mod_filter.c

          mod_ext_filter.c

          mod_expires.c

          mod_env.c

          mod_dir.c

          mod_deflate.c

          mod_cgi.c

          mod_autoindex.c

          mod_authz_user.c

          mod_authz_owner.c

          mod_authz_host.c

          mod_authz_groupfile.c

          mod_authz_default.c

          mod_authz_dbm.c

          mod_authn_file.c

          mod_authn_default.c

          mod_authn_dbm.c

          mod_authn_anon.c

          mod_authn_alias.c

          mod_auth_basic.c

          mod_alias.c

          mod_actions.c

          mod_so.c

          http_core.c

          prefork.c

          core.c

```

----------

## XenoTerraCide

what is the name of your 'hello world' file... extension included.

----------

## AMABITxS

 *XenoTerraCide wrote:*   

> what is the name of your 'hello world' file... extension included.

 

'index.php'

But I have also tried 'index.html'

----------

## XenoTerraCide

it would have to be .php or any of the extensions listed in 70_mod_php to work...

in /etc/apache2/modules.d/00_default_settings.conf set LogLevel to debug. restart apache2 and then try accessing the page. check the error log to see if any new errors have shown up.

edit: also to be sure what is the url you are using to view index.php (I'm just making sure you aren't trying to open it with file://)

----------

## AMABITxS

The url I'm using is http://192.168.1.112/index.php from a different computer also plugged into my router.

I changed the log level and restarted apache and this is the part of the log from the restart until after i accessed the page.

```
[Wed Jul 09 21:51:11 2008] [info] Init: Seeding PRNG with 136 bytes of entropy

[Wed Jul 09 21:51:11 2008] [info] Init: Generating temporary RSA private keys (512/1024 bits)

[Wed Jul 09 21:51:11 2008] [info] Init: Generating temporary DH parameters (512/1024 bits)

[Wed Jul 09 21:51:11 2008] [info] Init: Initializing (virtual) servers for SSL

[Wed Jul 09 21:51:11 2008] [info] mod_ssl/2.2.9 compiled against Server: Apache/2.2.9, Library: OpenSSL/0.9.8g

[Wed Jul 09 21:51:11 2008] [info] mod_unique_id: using ip addr 127.0.0.1

[Wed Jul 09 21:51:12 2008] [info] Init: Seeding PRNG with 136 bytes of entropy

[Wed Jul 09 21:51:12 2008] [info] Init: Generating temporary RSA private keys (512/1024 bits)

[Wed Jul 09 21:51:12 2008] [info] Init: Generating temporary DH parameters (512/1024 bits)

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(374): shmcb_init allocated 512000 bytes of shared memory

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(554): entered shmcb_init_memory()

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(576): for 512000 bytes, recommending 4266 indexes

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(619): shmcb_init_memory choices follow

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(621): division_mask = 0x1F

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(623): division_offset = 64

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(625): division_size = 15998

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(627): queue_size = 1604

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(629): index_num = 133

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(631): index_offset = 8

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(633): index_size = 12

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(635): cache_data_offset = 8

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(637): cache_data_size = 14386

[Wed Jul 09 21:51:12 2008] [debug] ssl_scache_shmcb.c(650): leaving shmcb_init_memory()

[Wed Jul 09 21:51:12 2008] [info] Shared memory session cache initialised

[Wed Jul 09 21:51:12 2008] [info] Init: Initializing (virtual) servers for SSL

[Wed Jul 09 21:51:12 2008] [info] mod_ssl/2.2.9 compiled against Server: Apache/2.2.9, Library: OpenSSL/0.9.8g

[Wed Jul 09 21:51:12 2008] [info] mod_unique_id: using ip addr 127.0.0.1

[Wed Jul 09 21:51:13 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g PHP/5.2.6RC4-pl0-gentoo configured -- resuming normal operations

[Wed Jul 09 21:51:13 2008] [info] Server built: Jul  1 2008 18:21:44

[Wed Jul 09 21:51:13 2008] [debug] prefork.c(1001): AcceptMutex: sysvsem (default: sysvsem)

```

I don't think any of that stuff is php related, but I don't really know.

I also tried changing my index page (index.php) to the following and it didn't send any errors out either:

```
<php?

echo "Hello World";

?>

```

EDIT: I just figured it out.... my php code should have been writen:

```
<?php

echo "Hello World";

?>

```

One character out of place and BAM!!!

Thanks for all the help everyone!!!!!!!!!!!!

----------

## XenoTerraCide

hah... I can't believe I didn't notice that... glad you figured it out...

----------

