On Tue, Mar 13, 2001 at 05:24:58PM +0000, Barry Mitchelson wrote:
> hi,
> 
> i've been playing around with the php-gtk extension (don't worry this is not OT), 
>but am having problems after installing the latest cvs version of php4.
> 
> when I try and run a script (and even when i do 'php -v') i get the following error :
> 
> PHP Warning:  Invalid library (maybe not a PHP library) 'php_gtk.so'  in Unknown on 
>line 0
> 
> now, I know that this library works because I had it running with my previous cvs 
>version of php.  I've tried reinstalling php-gtk, and also php4 from both cvs and 
>snaps.php.net but still the same problem.
> 
> has anyone got any ideas what could be causing this problem ?
Yes and I have partial solution. Not pretty though but it works for me at least.
So, problem caused by several things:

1. Build environment for self contained extensions (SCE) is generally broken
in PHP4. It wasn't work in past, it does not work now in one
particular case: when you have several PHP_ARG_WITH or PHP_ARG_ENABLE   
in config.m4. In case of SCE, all of these macroses get positive
answer regardless of user input or library checks because of this code
in PHP_ARG_ANALYZE (acinclude.m4):

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "[$]$1" = "no" && $1=yes
fi

So, even if user states PHP_SOMETHING = no, this code will rewrite it to
PHP_SOMETHING = yes

This particulary touches 'readline', 'mysql', 'dba', 'interbase',
'mcrypt', 'mhash' and other extensions.

2. PHP-GTK suffers from other bug. It is also a problem with build
environment: when you do

    #include "php_config.h"
    
in SCE module, then main PHP4 php_config.h which is installed on the
system is included, not locally created php_config.h which contains
proper definitions of HAVE_PHP_GTK and COMPILE_DL_PHP_GTK symbols.

In the CVS version of PHP4 header file which is generated as SCE config
file is renamed to config.h from php_config.h few days ago. But modules
themselves were not updated, so there are no modules in PHP4 than really
include config.h from the current directory, so HAVE_MODULENAME will be
undefined for all of them (if they are compiled as SCE) and all code
will be skipped due

#if HAVE_MODULENAME
 <actual code>
#endif

in most of them.

This particulary touches PHP-GTK, mysql, dba, and most of other modules.

Solution for PHP-GTK is to pass -DHAVE_PHP_GTK=1 -DCOMPILE_DL_PHP_GTK=1 to configure
through CFLAGS. Or fix SCE build environment (macros in acinclude.m4, pear/pear.m4
and #include "php_config.h" in all modules).

-- 
Sincerely yours, Alexander Bokovoy 
  The Midgard Project   | www.midgard-project.org |    Aurora R&D team 
Minsk Linux Users Group |    www.minsk-lug.net    |  www.aurora-linux.com  
    ALT Linux Team      |    www.alt-linux.org    | Architecte Open Source
-- Conscience is what hurts when everything else feels so good.

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to