# [Solved] PHP MYSQL getting me crazy

## Lord_Orion

Hello,

i made an update of my computer, since this moment php isn't working anymore.

it shows me the source code, dut doesn't interpret php.

So my /etc/conf.d/apache2

```

# /etc/conf.d/apache2: 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 have an

# <IfDefine NNN> directive where NNN is the option to enable that module.

#

# Here are the options available in the default configuration:

#

#  AUTH_DIGEST  Enables mod_auth_digest

#  AUTHNZ_LDAP  Enables authentication through mod_ldap (available if USE=ldap)

#  CACHE        Enables mod_cache

#  DAV          Enables mod_dav

#  ERRORDOCS    Enables default error documents for many languages.

#  INFO         Enables mod_info, a useful module for debugging

#  LANGUAGE     Enables content-negotiation based on language and charset.

#  LDAP         Enables mod_ldap (available if USE=ldap)

#  MANUAL       Enables /manual/ to be the apache manual (available if USE=docs)

#  MEM_CACHE    Enables default configuration mod_mem_cache

#  PROXY        Enables mod_proxy

#  SSL          Enables SSL (available if USE=ssl)

#  SUEXEC       Enables running CGI scripts (in USERDIR) through suexec.

#  USERDIR      Enables /~username mapping to /home/username/public_html

#

#

# The following two options provide the default virtual host for the HTTP and

# HTTPS protocol. YOU NEED TO ENABLE AT LEAST ONE OF THEM, otherwise apache

# will not listen for incomming connections on the approriate port.

#

#  DEFAULT_VHOST      Enables name-based virtual hosts, with the default

#                     virtual host being in /var/www/localhost/htdocs

#  SSL_DEFAULT_VHOST  Enables default vhost for SSL (you should enable this

#                     when you enable SSL)

#

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -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.

# PID file

#PIDFILE=/var/run/apache2.pid

# timeout for startup/shutdown checks

#TIMEOUT=10

# ServerRoot setting

#SERVERROOT=/usr/lib64/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"

# A command that outputs a formatted text version of the HTML at the URL

# of the command line. Designed for lynx, however other programs may work.

#LYNX="lynx -dump"

# The URL to your server's mod_status status page.

# Required for status and fullstatus

#STATUSURL="http://localhost/server-status"

# Method to use when reloading the server

# Valid options are 'restart' and 'graceful'

# See http://httpd.apache.org/docs/2.2/stopping.html for information on

# what they do and how they differ.

#RELOAD_TYPE="graceful"

```

my /etc/apache2/modules.d/70_mod_php5_concurr.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>

                AddHandler application/x-httpd-php .php .php3 .php4 .php5 .phtml

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

        </IfModule>

        DirectoryIndex index.php index.phtml

</IfDefine>

```

My seted useflags :

[ebuild   R   ] www-servers/apache-2.2.16  USE="ssl -debug -doc -ldap (-selinux) -static -suexec -threads" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 0 kB

[ebuild   R   ] dev-lang/php-5.2.14  USE="apache2 berkdb bzip2 cli concurrentmodphp crypt ctype filter gdbm hash iconv ipv6 json mysql ncurses nls pcre posix readline reflection session simplexml spl ssl tokenizer unicode xml xmlreader xmlwriter zlib (-adabas) -bcmath (-birdstep) -calendar -cdb -cgi -cjk -curl -curlwrappers -db2 -dbase (-dbmaker) -debug* -discard-path -doc -embed (-empress) (-empress-bcs) (-esoob) -exif (-fdftk) (-firebird) -flatfile -force-cgi-redirect (-frontbase) -ftp -gd -gd-external -gmp -imap -inifile -interbase -iodbc -kerberos -kolab -ldap -ldap-sasl -libedit -mcve -mhash -msql -mssql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -postgres -qdbm -recode -sapdb -sharedext -sharedmem -snmp -soap -sockets (-solid) -spell -sqlite -suhosin (-sybase-ct) -sysvipc -threads -tidy -truetype -wddx -xmlrpc -xpm -xsl -yaz -zip" 0 kB  

and forgot a /etc/init.d/apache2 modules

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)

 cgid_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)

 info_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)

 ssl_module (shared)

 unique_id_module (shared)

 usertrack_module (shared)

 vhost_alias_module (shared)

 php5_module (shared)

Syntax OK

but nothing to do...

Is there anyone to help me please ?

Thanks

Lord_OrionLast edited by Lord_Orion on Mon Sep 20, 2010 11:04 am; edited 1 time in total

----------

## JC99

Try running revdep-rebuild.

----------

## Lord_Orion

Tried but nothing...

Did even a python-updater and a perl cleaner

Will try, do you think an 

```
 emerge -e apache php 
```

 could help ?

----------

## tomk

Check the suggestions in PHP not working with apache.

----------

## Lord_Orion

Checked all is ok but no interpreted php...

Showed the computer to a friend who uses linux at work fo a long time no result.

did a reemerge but nothing

A really desesperated

----------

## M

Hi, do you have anything in apache logs? Have you tried to use some simple info.php with <?php phpinfo(); ?> ? 

Can you try to add in 70_mod_php5.conf this:

AddType application/x-httpd-php .php

Dont remove AddHandler, just add one line after </IfModule>

----------

## magic919

Do you need that concurrent mod php?

----------

## Lord_Orion

No change...

addes the file but always phpcode and not interpreted by php and apache  :Sad: 

And yes always code, verified that files end well with .php and no log concerning that.

just apache lines that indicate the file is accessed

----------

## magic919

Does PHP work on these files when you run it on the command line?

If so, can you make sure Apache stops.   Kill it if need be, to ensure you have the latest one you built running.  Then start Apache and test.

----------

## Lord_Orion

Php runs in command line

I completly restarted computed 5 or 6 time

and yes when i stop apache all is stopped

----------

## olemarkus

When you enter PHP mode, do you use <? or <?php? If you use the former, make sure that you have short_open_tags enabled in your php.ini.

----------

## Lord_Orion

I use <?php

as sample , my php testing file

http://joerger.dyndns.org/test.php you can see the result

```
<?php

phpinfo();

?>

```

----------

## Lord_Orion

Tried even to clean all php files and apache files but nothing to do

always same result

have i forgotten an old file to remove and that is conflicting?

----------

## olemarkus

As far as I can tell, everything looks okay with the configs then. I assume you have checked the error log for errors?

----------

## Lord_Orion

Yes but no errors are indicated

i send you here a part of the log (10 last lines)

```

joerger altair # tail -n10 /var/log/apache2/access_log
```

190.120.232.106 - - [19/Sep/2010:21:28:10 +0200] "GET /user/soapCaller.bs HTTP/1.1" 404 279

173.176.186.233 - - [19/Sep/2010:22:45:13 +0200] "GET /~petanque.Conception/photo36.jpg HTTP/1.1" 404 298

94.189.183.99 - - [19/Sep/2010:22:45:49 +0200] "GET /test.php HTTP/1.1" 200 21

94.189.183.99 - - [19/Sep/2010:22:45:49 +0200] "GET /favicon.ico HTTP/1.1" 404 277

94.189.183.99 - - [19/Sep/2010:22:45:52 +0200] "GET /favicon.ico HTTP/1.1" 404 277

74.59.125.195 - - [19/Sep/2010:23:11:14 +0200] "GET /~petanque.Conception/photo36.jpg HTTP/1.1" 404 298

74.59.125.195 - - [19/Sep/2010:23:11:14 +0200] "GET /~petanque.Conception/photo36.jpg HTTP/1.1" 404 298

66.249.65.235 - - [20/Sep/2010:01:01:03 +0200] "GET /vampire/menus/menuclansl.html HTTP/1.1" 200 805

66.249.65.235 - - [20/Sep/2010:01:34:07 +0200] "GET /webcalendar/day.php?date=20050118 HTTP/1.1" 200 3917

192.168.0.253 - - [20/Sep/2010:02:16:25 +0200] "GET /favicon.ico HTTP/1.1" 404 277

```
joerger altair # tail -n10 /var/log/apache2/error_log
```

[Sun Sep 19 20:07:41 2010] [error] [client 88.77.13.175] File does not exist: /var/www/localhost/htdocs/favicon.ico

[Sun Sep 19 20:08:27 2010] [error] [client 88.77.13.175] File does not exist: /var/www/localhost/htdocs/startrek-ng/inc

[Sun Sep 19 20:19:29 2010] [error] [client 213.5.64.11] File does not exist: /var/www/localhost/htdocs/startrek-ng/forum/.append_sid(, referer: http://joerger.dyndns.org/.append_sid%28

[Sun Sep 19 21:28:10 2010] [error] [client 190.120.232.106] File does not exist: /var/www/localhost/htdocs/user

[Sun Sep 19 22:45:13 2010] [error] [client 173.176.186.233] File does not exist: /var/www/localhost/htdocs/~petanque.Conception, referer: http://aux-fours-a-pain.aceboard.fr/20063-355-5339-0-.htm

[Sun Sep 19 22:45:49 2010] [error] [client 94.189.183.99] File does not exist: /var/www/localhost/htdocs/favicon.ico

[Sun Sep 19 22:45:52 2010] [error] [client 94.189.183.99] File does not exist: /var/www/localhost/htdocs/favicon.ico

[Sun Sep 19 23:11:14 2010] [error] [client 74.59.125.195] File does not exist: /var/www/localhost/htdocs/~petanque.Conception, referer: http://aux-fours-a-pain.aceboard.fr/20063-355-5339-0-.htm

[Sun Sep 19 23:11:14 2010] [error] [client 74.59.125.195] File does not exist: /var/www/localhost/htdocs/~petanque.Conception, referer: http://aux-fours-a-pain.aceboard.fr/20063-355-5339-0-.htm

[Mon Sep 20 02:16:25 2010] [error] [client 192.168.0.253] File does not exist: /var/www/localhost/htdocs/favicon.ico

----------

## olemarkus

All I can see that remains then is that you have concurrentmodphp enabled. That flag will go away soon anyway and you have no use for it now since we only support one PHP slot.

Can you try emerging PHP without it?

----------

## Lord_Orion

olemarkus you are a genius...

Thank you 1000 times... It works !

Hanged toi solved

----------

## olemarkus

No problem. Good to know that concurrentmodphp is broken.

----------

## magic919

 *Lord_Orion wrote:*   

> olemarkus you are a genius...
> 
> Thank you 1000 times... It works !
> 
> 

 

Cough.

----------

## Lord_Orion

You seem not to agree with me magic   :Embarassed:   :Embarassed: 

Thanks again to everyone who tried to and who helped me... it saves my hollidays.

A week i tried to make it work.

It's really a great distribution the gentoo... and a great community.

May the gento live for ever   :Very Happy: 

----------

## magic919

Not at all.  I'm just suggesting you scroll up to my very first post on this thread.

----------

## Lord_Orion

Oups am confused didn'tt understand what you wanted to say.

Understood it was necessary to have concrentmodphp... you were the first in this case to give the answer.

Am really sorry.

----------

## magic919

No worries.  We are all friends on here  :Smile: 

I'm glad you got the problem fixed.

----------

