# Suhosin not loading in PHP5 CGI

## fishsauce

Hi,

I'm getting this message in my apache error logs:

[Sat Nov 17 16:01:49 2007] [error] [client 192.168.1.5] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/suhosin.so' - /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://192.168.1.10:8920/index.php

It looks like suhosin is actually in the no-debug-zts-20060613 folder.  I tried moving it to the non-zts folder but I got this instead:

[Sat Nov 17 16:36:44 2007] [error] [client 192.168.1.5] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/suhosin.so' - /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/suhosin.so: undefined symbol: core_globals_id in Unknown on line 0, referer: https://192.168.1.10:8920/

PHP5 was compiled as CGI without apache2 support and with the suhosin USE flag.  phpinfo() does say:

This server is protected with the Suhosin Patch 0.9.6.2

Copyright (c) 2006 Hardened-PHP Project

even with that message in the apache error log.  It doesn't look like the extension is loaded as there's no block for it in the bottom though (which is expected since it failed).

Any ideas on how to fix this?  Thanks in advance.

----------

## steveb

Have you executed "etc-update" after emerging php5?

// SteveB

----------

## fishsauce

Yes, I have and there is nothing else to update.

----------

## ScOut3R

I have similar problems.

----------

## hoffie

Simply re-merge suhosin. You have switched from USE="threads" to USE="-threads" (or the other way round) which makes all existing extensions incompatible (and changes the extension directory as well). The same happens when switching between USE="-debug" / USE="debug", btw.

----------

## ScOut3R

 *hoffie wrote:*   

> Simply re-merge suhosin. You have switched from USE="threads" to USE="-threads" (or the other way round) which makes all existing extensions incompatible (and changes the extension directory as well). The same happens when switching between USE="-debug" / USE="debug", btw.

 

I've switched from mod_php to php_cgi. The re-emerge would solve the problem?

----------

## hoffie

 *ScOut3R wrote:*   

> 
> 
> I've switched from mod_php to php_cgi.

 

I don't think this would matter in any way. Whenever you are swapping USE="threads" or USE="debug" you have to rebuild all php extensions to get them working again (and run dispatch-conf or similar after, of course). Apparently you've switched from USE="threads" to USE="-threads" when switching to php-cgi (which is a good idea since thread-safe php builds seem to still have some problems and are known to be slightly slower. Thread-safety is only required when using PHP as mod_php with multi-threaded Apache workers).

So, yes, simply do emerge -av dev-php5/suhosin && dispatch-conf and suhosin should start working again.

Manually moving portage-owned files around is not a good idea, by the way.

----------

## ScOut3R

Thank You!

Re-emerging suhosin solve it!

----------

## Berty

guys, the same problem! After re-emerging suhosin the following error appears:

```

web # /usr/bin/php test.php

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/zip.so' - /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0

```

I've got no idea what zip.so is.

 :Sad: 

----------

