PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:It doesn't fit together - GladeXML (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:It doesn't fit together - GladeXML
#833
sutterp (User)
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
It doesn't fit together - GladeXML 1 Month, 4 Weeks ago Karma: 0  
I am developing an application under Linux, using glade to create the layouts. The glade.glade file is in the same directory as the php code.

This runs fine under Linux.

The tree in which the application resides is shared out via samba. Windows machines connect to the share and execute the php programs from the share. Programs that do not use glade.glade files run smoothly. Programs that use glade.glade crash with:
Code:
Fatal error: Class 'GladeXML' not found in W:\gtk2\Example\php\example.php on line 36

class CompositionPlanner extends GladeXML {...
Obviously, class GladeXML in not known by php-gtk2 under windows. What am I missing? Do I need the complete glade3 development system installed on the windows machine, even if it never gets used for development. To test this theory, installed glade2 using the installer as described in Sample Code 328: How to install glade3 for PHP GTK2 on windows? This went well and I can run glade2 and glade3; however, GladeXML still can't be found. What do I try next?
 
  The administrator has disabled public write access.
#834
kksou (Admin)
Admin
Posts: 391
graph
User Online Now Click here to see the profile of this user
Re:It doesn't fit together - GladeXML 1 Month, 4 Weeks ago Karma: 8  
For the windows machine, can you check the php.ini if it contains the following:

Code:
php-gtk.extensions = php_gtk_libglade2.dll
The glade tool that you've setup (the one in Sample Code 328) is the Glade developmet tool. It is used to generate the .glade file.
    When you run the php-gtk2 application, it needs the glade library (in php_gtk_libglade2.dll) in order to run the file. I suspect this library is not loaded on your windows machine.
      Regards,
        /kksou
         
         
        Last Edit: 2008/09/22 14:47 By kksou.
          The administrator has disabled public write access.
        #842
        sutterp (User)
        Fresh Boarder
        Posts: 19
        graphgraph
        User Offline Click here to see the profile of this user
        Re:It doesn't fit together - GladeXML 1 Month, 4 Weeks ago Karma: 0  
        Hi kksou,

        I'm sure you are spot on with the missing library entry in php.ini.

        But where is php_gtk_libglade2.dll coming from? The only piece that could match is, after I installed glade2 on the windows machine, libglade-2.0-0.dll in the bin directory where I installed glade2.

        This is what I tried:
        1. I copied libglade-2.0-0.dll to the \ext directory of php-gtk and renamed it to php_gtk_libglade2.dll.

        2. Putting php-gtk.extensions = php_gtk_libglade2.dll
          into the php-gtk section of php-cli.ini has no effect; this section appears to be ignored.

        3. The result is as in my earlier post.

        4. My next try was to copy libglade-2.0-0.dll to the \ext directory of php-gtk and put
          extension = php_gtk_libglade-2.0-0.dll
          into the php section of php-cli.ini, which had some effect, also not quite the desired one. I now get
          Code:
          C:\Documents and Settings\sutterp>C:\php-gtk2\php.exe w:\gtk2\Example\php\example.php
          PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'php_gtk_libglade-2.0-0.dll'  in Unknown on line 0
          
          Fatal error: Class 'GladeXML' not found in W:\gtk2\Example\php\example.php on line 36
        I am now confused completely. The notes for [gtk-php] in php-cli.ini state:
        Code:
        ;;;;;;;;;;;;;;;;;;;;;;
        ; PHP-GTK extensions ;
        ;;;;;;;;;;;;;;;;;;;;;;
        
        ; Extensions written for PHP-GTK are in the format php_gtk_*.dll (Windows) or
        ; php_gtk_*.so (Unix), written here as a comma-separated list. The library
        ; files need to be in the same directory as the PHP-GTK library, along with
        ; any other PHP extensions you are using.
        
        php-gtk.extensions = php_gtk_libglade2.dll
        Wich I interprete as 'In the php-cli.ini file I have to prefix the filename of the dll with either php_ or php_gtk_'; at least this holds true under Linux. I am sure the dll file exists, because I copied libglade-2.0-0.dll there and
        Code:
        C:\Documents and Settings\sutterp>dir "C:\Program Files\PHP\ext\libglade2.dll"
         Volume in drive C has no label.
         Volume Serial Number is C0E1-4802
        
         Directory of C:\Program Files\PHP\ext
        
        17-06-2005  15:41            87,040 libglade-2.0-0.dll
        17-06-2005  15:41            87,040 libglade2.dll
                       2 File(s)        174,080 bytes
                       0 Dir(s)   4,410,286,080 bytes free
        Here is my php-cli.ini file
        Code:
        [PHP]
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ; About the php.ini in PHP-GTK ;
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ;
        ; This file introduces the php.ini settings that you will need in order to
        ; run PHP-GTK on your system. You may also need other settings from PHP's
        ; standard php.ini file, e.g. to load further extensions or otherwise control
        ; PHP's behaviour in matters such as error reporting. Please add those in
        ; the upper part of this file, in the PHP section.
        
        ; You should use PHP's CLI executable to run PHP-GTK. This php.ini file
        ; should be in the same directory as the PHP executable, to avoid conflict
        ; with any other copies of PHP that may be installed on your machine.
        
        ; The first thing you will need to do is tell PHP where you want it to look
        ; for the PHP extension libraries (php_*.dll or php_*.so files) on your system.
        
        extension_dir = "C:\Program Files\PHP\ext"
        
        ; Make sure that php-gtk2.dll under Windows, or php-gtk2.so under Unix, is in
        ; the directory named in extension_dir alongside any other shared PHP extensions
        ; you intend to use, and tell PHP to load it.
        
        extension = php_gtk2.dll
        ;extension = php_pdo.**
        ;extension = php_sqlite.**
        ;extension = php_pdo_sqlite.**
        
        [Date]
        ; Defines the default timezone used by the date functions
        ;date.timezone = 
        
        [PHP_BZ2]
        extension=php_bz2.dll
        [PHP_DBA]
        extension=php_dba.dll
        [PHP_DBASE]
        extension=php_dbase.dll
        [PHP_GD2]
        extension=php_gd2.dll
        [PHP_GMP]
        extension=php_gmp.dll
        [PHP_IMAP]
        extension=php_imap.dll
        [PHP_INTERBASE]
        extension=php_interbase.dll
        [PHP_MSQL]
        extension=php_msql.dll
        [PHP_MSSQL]
        extension=php_mssql.dll
        [PHP_MYSQL]
        extension=php_mysql.dll
        [PHP_MYSQLI]
        extension=php_mysqli.dll
        [PHP_PDO]
        extension=php_pdo.dll
        [PHP_SQLITE]
        extension=php_sqlite.dll
        [PHP_BZ2_FILTER]
        extension=php_bz2_filter.dll
        [PHP_CPDF]
        extension=php_cpdf.dll
        [PHP_DBX]
        extension=php_dbx.dll
        [PHP_FILEINFO]
        extension=php_fileinfo.dll
        [PHP_FILEPRO]
        extension=php_filepro.dll
        [PHP_PHPDOC]
        extension=php_phpdoc.dll
        [PHP_POP3]
        extension=php_pop3.dll
        [PHP_SPL_TYPES]
        extension=php_spl_types.dll
        
        [PHP-GTK]
        
        ;;;;;;;;;;;;;;;;;;;;;;
        ; PHP-GTK extensions ;
        ;;;;;;;;;;;;;;;;;;;;;;
        
        ; Extensions written for PHP-GTK are in the format php_gtk_*.dll (Windows) or
        ; php_gtk_*.so (Unix), written here as a comma-separated list. The library
        ; files need to be in the same directory as the PHP-GTK library, along with
        ; any other PHP extensions you are using.
        
        php-gtk.extensions = php_gtk_libglade2.dll
        php-gtk.codepage = CP1250
        
         
         
        Last Edit: 2008/09/23 00:42 By sutterp.
          The administrator has disabled public write access.
        #844
        kksou (Admin)
        Admin
        Posts: 391
        graph
        User Online Now Click here to see the profile of this user
        Re:It doesn't fit together - GladeXML 1 Month, 4 Weeks ago Karma: 8  
        No, you do not use the .dll from the glade tool.

        Please download the latest windows binary of PHP-GTK2 from the official PHP-GTK website:
        http://gtk.php.net/download.php

        Download the second one:
        php-gtk-2.0.1 Windows binary pack - 16-May-2008

        No setup is required. All you need is to unzip into a folder of your choice. And you're ready to run. Everything has set up for you, yes, including the glade library.

        Try it, and let me know if it works.

        Regards,
        /kksou
         
          The administrator has disabled public write access.
        #845
        kksou (Admin)
        Admin
        Posts: 391
        graph
        User Online Now Click here to see the profile of this user
        Re:It doesn't fit together - GladeXML 1 Month, 4 Weeks ago Karma: 8  
        Oops, sorry, just downloaded the file. The glade library is not there.

        You need to get the extensions pack too:
        php-gtk-2.0.1 Windows binary extensions pack

        Unzip the downloaded file.

        1) Copy libglade-2.0-0.dll to the php-gtk root folder

        2) Copy php_gtk_libglade2.dll to the /ext folder

        3) Add the following to php.ini
        php-gtk.extensions = php_gtk_libglade2.dll

        Regards,
        /kksou
         
         
        Last Edit: 2008/09/23 00:58 By kksou.
          The administrator has disabled public write access.
        #849
        sutterp (User)
        Fresh Boarder
        Posts: 19
        graphgraph
        User Offline Click here to see the profile of this user
        Re:It doesn't fit together - GladeXML 1 Month, 4 Weeks ago Karma: 0  
        Thank you very much kksou


        I'm a happy man now works like a charm.

        These were concise instructions that even I could understand.

        Thanks again

        Peter
         
          The administrator has disabled public write access.
        Go to top Post Reply
        Powered by FireBoardget the latest posts directly to your desktop

        Blog - Forum - Privacy Policy - Contact Us
        Copyright © 2006-2008. kksou.com. All Rights Reserved