Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Apache PHP problem after update world
View unanswered posts
View posts from last 24 hours

rackathon
 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
midnite
Apprentice
Apprentice


Joined: 09 Apr 2006
Posts: 232
Location: Hong Kong

PostPosted: Thu Sep 13, 2007 4:36 am    Post subject: [SOLVED] Apache PHP problem after update world Reply with quote

Just, i updated portage and world.
My apache server was work fine with PHP pages. But after updated, it return the _RAW_ codes for .php pages!!
it is even text/plain!!! the html tags (eg <BR>) are showing also!!!
why ? :cry:

all i have done is just the following lines:
Code:
# emerge --sync
# emerge --ask --deep --newuse --update --verbose world

then replace the files with the ._cfg0000_ ones

one thing i have noticed is that, the http.conf changed a lot. Before, there was many things such as DirectoryIndex index.html. Now it shrank from 1104 to 184 lines and contains mainly LoadModule directives. It seems that it is grouping things in other files, but where are they??

PS my previous version was installed several months ago only.


Last edited by midnite on Thu Sep 13, 2007 7:17 am; edited 1 time in total
Back to top
View user's profile Send private message
Dagger
Developer
Developer


Joined: 11 Jun 2003
Posts: 673
Location: UK

PostPosted: Thu Sep 13, 2007 4:50 am    Post subject: Reply with quote

Let's start from checking your /etc/conf.d/apache2 if it contains APACHE2_OPTS="-D PHP5"
_________________
95% of all computer errors occur between chair and keyboard (TM)
Join the FSF as an Associate Member!
Post under CC license.
Back to top
View user's profile Send private message
midnite
Apprentice
Apprentice


Joined: 09 Apr 2006
Posts: 232
Location: Hong Kong

PostPosted: Thu Sep 13, 2007 5:13 am    Post subject: Reply with quote

Thanks. I though it works too, but sadly....

first, my /etc/conf.d/apache2 really do not have APACHE2_OPTS="-D PHP5". Then i added it and it become:
Code:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC -D PHP5"

(as i remember, the previous /etc/conf.d/apache2 have no APACHE2_OPTS="-D PHP5" too. But there was KEEPENV="PATH")

then it fails when i want to restart it:
Code:
# /etc/init.d/apache2 restart
 * Caching service dependencies ...
 *  Can't find service 'logger' needed by 'sensord';  continuing...                                                                                    [ ok ]
 * Apache2 has detected a syntax error in your configuration files:
apache2: Syntax error on line 175 of /etc/apache2/httpd.conf: Syntax error on line 4 of /etc/apache2/modules.d/70_mod_php5.conf: API module structure 'php5_module' in file /usr/lib/apache2/modules/libphp5.so is garbled - expected signature 41503232 but saw 41503230 - perhaps this is not an Apache module DSO, or was compiled for a different Apache version?

then i changed -D PHP5 to -D PHP, it have no problem for restart. But still do not support PHP :cry:

for your reference:
/etc/apache2/modules.d/70_mod_php5.conf
Code:
<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>

        AddDirectoryIndex index.php index.phtml
</IfDefine>

/etc/conf.d/apache2 (with comments)
Code:
# /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 be an
# <IfDefine NNN> where NNN is the option to enable that module.
# Here are the options available in the default configuration:
#
#  CACHE      Enables mod_cache
#  MEM_CACHE  Enables default configuration mod_mem_cache
#  DAV        Enables mod_dav
#  DEFAULT_VHOST   Enables name-based virtual hosts, with the default
#                  virtual host being in /var/www/localhost/htdocs
#  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)
#  AUTH_LDAP  Enables authentication through mod_ldap (available if USE=ldap)
#  MANUAL     Enables /manual/ to be the apache manual (available if USE=docs)
#  PROXY      Enables mod_proxy
#  SSL        Enables SSL (available if USE=ssl)
#  SSL_DEFAULT_VHOST   Enables default vhost for SSL (you should enable this
#                      when you enable SSL unless you know what you are doing)
#  SUEXEC     Enables running CGI scripts (in USERDIR) through suexec.
#  USERDIR    Enables /~username mapping to /home/username/public_html
#
# Warning: You need one of DEFAULT_VHOST or SSL_DEFAULT_VHOST, otherwise apache
#          will not listen for incomming connections on any port.
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC -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"

# 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"
Back to top
View user's profile Send private message
PraetorZero
Tux's lil' helper
Tux's lil' helper


Joined: 10 Dec 2004
Posts: 81
Location: /home

PostPosted: Thu Sep 13, 2007 6:35 am    Post subject: Reply with quote

Have you tried re-emerging PHP? I think the message gives you a decent idea.

Code:
/etc/init.d/apache2 restart
 * Caching service dependencies ...
 *  Can't find service 'logger' needed by 'sensord';  continuing...                                                                                    [ ok ]
 * Apache2 has detected a syntax error in your configuration files:
apache2: Syntax error on line 175 of /etc/apache2/httpd.conf: Syntax error on line 4 of /etc/apache2/modules.d/70_mod_php5.conf: API module structure 'php5_module' in file /usr/lib/apache2/modules/libphp5.so is garbled - expected signature 41503232 but saw 41503230 - perhaps this is not an Apache module DSO, or [b]was compiled for a different Apache version?[/b]
Back to top
View user's profile Send private message
midnite
Apprentice
Apprentice


Joined: 09 Apr 2006
Posts: 232
Location: Hong Kong

PostPosted: Thu Sep 13, 2007 7:15 am    Post subject: Reply with quote

yeah! Thanks PraetorZero and also thanks to the post http://forums.gentoo.org/viewtopic-t-580379.html, i have reemerged PHP and things go right now :D

the magic command:
Code:
# emerge -av php
Back to top
View user's profile Send private message
jody
Tux's lil' helper
Tux's lil' helper


Joined: 16 Oct 2007
Posts: 124
Location: Switzerland

PostPosted: Wed Feb 27, 2008 11:56 am    Post subject: Reply with quote

i have exactly the same problem except that it is libphp4.so which is garbled.
However if i try to
Code:
emerge -av php
it wont work:
Code:
!!! All ebuilds that could satisfy "dev-lang/php" have been masked.
!!! One of the following masked packages is required to complete your request:
- dev-lang/php-5.2.5_p20080206-r3 (masked by: package.mask)
- dev-lang/php-5.2.5_p20080206-r2 (masked by: package.mask, ~x86 keyword)
- dev-lang/php-5.2.5_p20080206 (masked by: package.mask)
- dev-lang/php-5.2.5-r1 (masked by: package.mask)
- dev-lang/php-5.2.4_pre200708051230-r2 (masked by: package.mask)
- dev-lang/php-4.4.8 (masked by: package.mask, ~x86 keyword)
/usr/portage/profiles/package.mask:
# Christian Hoffmann <hoffie@gentoo.org> (19 Oct 2007)
# masked for security reasons, bug 189172, removal scheduled for beginning of
# 2008

- dev-lang/php-4.4.8_pre20070816 (masked by: package.mask)
- dev-lang/php-4.4.4-r6 (masked by: package.mask)

how can i get a php-4 if they are all masked?

Thank you
Jody
Back to top
View user's profile Send private message
qQsh
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jan 2005
Posts: 85

PostPosted: Fri Jun 27, 2008 4:48 pm    Post subject: Reply with quote

jody wrote:
i have exactly the same problem except that it is libphp4.so which is garbled.
However if i try to
Code:
emerge -av php
it wont work:
Code:
!!! All ebuilds that could satisfy "dev-lang/php" have been masked.
!!! One of the following masked packages is required to complete your request:
- dev-lang/php-5.2.5_p20080206-r3 (masked by: package.mask)
- dev-lang/php-5.2.5_p20080206-r2 (masked by: package.mask, ~x86 keyword)
- dev-lang/php-5.2.5_p20080206 (masked by: package.mask)
- dev-lang/php-5.2.5-r1 (masked by: package.mask)
- dev-lang/php-5.2.4_pre200708051230-r2 (masked by: package.mask)
- dev-lang/php-4.4.8 (masked by: package.mask, ~x86 keyword)
/usr/portage/profiles/package.mask:
# Christian Hoffmann <hoffie@gentoo.org> (19 Oct 2007)
# masked for security reasons, bug 189172, removal scheduled for beginning of
# 2008

- dev-lang/php-4.4.8_pre20070816 (masked by: package.mask)
- dev-lang/php-4.4.4-r6 (masked by: package.mask)

how can i get a php-4 if they are all masked?

Thank you
Jody


You should switch to PHP5 because PHP4 is going to be unsupported. Anyway, if you really need PHP4, just unmask it by putting exact version in /etc/portage/package.unmask un package.keywords
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT - 5 Hours
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