resolved: [PHP-GTK] Glade @ phpGTK

From: Date: Thu, 21 Feb 2002 14:17:26 +0000
Subject: resolved: [PHP-GTK] Glade @ phpGTK
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-1296@lists.php.net to get a copy of this message
The problem: (Windows ME, php 4.11, phpGtk 0.5.0, glade) "Sebastian G." wrote: > [...] > Well, my quest is the following: I need to know, how to configure the > phpGTK to handle *.glade files. At this time, i'm using > > | // instantiate GUI > | $gx = &new GladeXML('gladefile.glade'); > | $gx->signal_autoconnect(); > > , but running it ends in an errormessage: > > | warning: failed to load external entity "gladefile.glade" > | > | ** WARNING **: document not well formed! > | > | ** WARNING **: Could not parse file > | X-Powered-By: PHP/4.2.0-dev > | Content-type: text/html > | > | <br> > | <b>Warning</b>: gladexml(): could not create GladeXML object in > | <b>c:\php4\test\phpfile.php</b> on line <b>15</b><br> > | <br> > | <b>Fatal error</b>: Call to a member function on a non-object in > | <b>c:\php4\test\scan_client.php</b> on line <b>16</b><br> The solving: The dll-files php_gtk_libglade.dll and php_gtk_sqpane.dll (which are located in \php4\@php-gtk-0.5.0-win32.zip@http://www.phpgtk.de/download/) where not loaded correctly when running PHP.EXE. The reason for this simply were _two_ things: 1. The fact that the PATH-Environment-variable was not set while running PHP in a windows-commandline (COMMAND.COM). I've solved this by adding the path to my PHP-folder to the PATH-line in my autoexec.bat-file (C:\autoexec.bat). It now looks like: | SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PATH_TO_PHP You can do this for the current (only!) session by typing the following line into the commandline: set PATH=%PATH%;C:\PATH_TO_PHP <enter> 2. The extension-dir, which gets set in the php.ini-file (C:\windows\php.ini), has been containing a UNIX-path ("./"), which cannot be understood by windows/PHP.EXE. Simply edit php.ini and change the value to nothing. It now should look like: | ; Directory in which the loadable extensions (modules) reside. | extension_dir = Maybe all this is done when running the Installer EXE-file (php-gtk-0.5.0-setup.exe@http://www.phpgtk.de/download/), which I've not been doing (weirdo, I know...) and which should be able to configure the system. Also remember the forgoing tips by: Steph. Fox: > Got it. It's caused by using "double quotes" where there is a backslash > in > the filepath. > The backslash isn't escaped, so the file is not found and the object not > created. Stefan Kreuzer: > try to put a full path description in the construct call to glade. > Something like this: > | $gx= &new GladeXML('c:\\mydir\\projectdir\\gladefile.glade'); An easy-to-use script to determine, what the errorsource could be: Alan Knowles: > if the glade file is the same directory.. > | $filename = dirname(__FILE__) . "/mygladefile.glade"; > | if (!file_exists($filename)) { > | echo "OOPS no glade file found $filename"; > | exit; > | } > | if (!class_exists("GladeXML")) { > | echo "OOPS need to configure php.ini in c:/winnt/ or C:/windows/ to > | load glade."; > | exit; > | } > | > | $gx = &new GladeXML($filename); Thanks to all of you. See you soon :) -- MfG, Sebastian G. <mailseppel@gmx.de>.germany-HH

« previous php.gtk.general (#1296) next »