PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:gtkhtml (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:gtkhtml


#2836
neil (User)
Senior Boarder
Posts: 53
graphgraph
User Offline Click here to see the profile of this user
gtkhtml 10 Months, 2 Weeks ago Karma: 1  
Hi,

I've read discussions and instructions elsewhere in this forum:
http://www.kksou.com/php-gtk2/PHP-GTK2-Help/577-ReProblem-in-running-GTKHtml-example/Page-2.php#577

and
http://www.kksou.com/php-gtk2/PHP-GTK2-Help/919-ReClass-GtkHTML-not-found.php

I've downloaded : php-gtk2_with-gtkhtml.zip

I'm still getting "class gtkhtml not found' error.

In the solution presented at : http://www.kksou.com/php-gtk2/PHP-GTK2-Help/919-ReClass-GtkHTML-not-found.php

it says to download file : required_files_for_gtkhtml.zip

Where do I find this file please ?

Neil.
 
  The administrator has disabled public write access.

#2841
kksou (Admin)
Admin
Posts: 1240
graph
User Online Now Click here to see the profile of this user
Re:gtkhtml 10 Months, 2 Weeks ago Karma: 20  
Hi,

The file at:
http://www.kksou.com/php-gtk2/tmp/php-gtk2_with-gtkhtml.zip

is correct.

Just download and unzip it into a folder.

You're still getting "class gtkhtml not found" error because you must have run the other version of php-gtk.

To be sure, please open a command window and cd to the folder where you unzip the file. Then from the command prompt, type

.\php full_path_to_your_php_file.php

If it still gives error, then it must be your PATH pointing to another PHP-GTK folder that contains the wrong dll. If this is the case, you can edit your PATH.

Or, if you have another PC, or VMWare, you can try the php-gtk2_with-gtkhtml.zip on a fresh windows machine that has not installed php-gtk before. Have tried it many times. It should work.

Regards,
/kksou
 
  The administrator has disabled public write access.

#2856
neil (User)
Senior Boarder
Posts: 53
graphgraph
User Offline Click here to see the profile of this user
Re:gtkhtml 10 Months, 2 Weeks ago Karma: 1  
kksou, Thanks for your prompt reply (as usual).

Sorry to be a nuisance.
I must be overlooking something.

Here's the text from my DOS window:

cd C:\gtkhtml\php-gtk2_with-gtkhtml\php-gtk2

C:\gtkhtml\php-gtk2_with-gtkhtml\php-gtk2>path;

C:\gtkhtml\php-gtk2_with-gtkhtml\php-gtk2>path
PATH=(null)

C:\gtkhtml\php-gtk2_with-gtkhtml\php-gtk2>.\gconfd-2.exe|.\php gtkhtml_sample1.php

Fatal error: Class 'GtkHTML' not found in C:\gtkhtml\php-gtk2_with-gtkhtml\php-gtk2\gtkhtml_sample1.php on line 13


I think I am reading the correct versions of the files.
If I rename either "gconfd-2.exe" or "gtkhtml_sample1.php" (in the current directory) the error message I get tells me the command/file cannot be found.

I have not tried on a fresh machine (I have run other versions of php-gtk2 on the current machine, although not since I last booted it).

Perhaps a fresh machine is my only option, but I do find my results puzzling.

Neil.
 
  The administrator has disabled public write access.
#2857
kksou (Admin)
Admin
Posts: 1240
graph
User Online Now Click here to see the profile of this user
Re:gtkhtml 10 Months, 2 Weeks ago Karma: 20  
Hi,

I just tried the following zip file again on a fresh install of windows, and it's working fine.

http://www.kksou.com/php-gtk2/tmp/php-gtk2_with-gtkhtml.zip

Your commands look ok to me too.

It leads me to wonder there might be some problem with your sample code.

Can you show your sample code here?

Can you also try the following sample code:
Sample Code 316: How to display html text using gtkhtml?

You can also download a copy of the above sample code here:
http://www.kksou.com/php-gtk2/tmp/0316.zip

Regards,
/kksou
 
  The administrator has disabled public write access.
#2860
neil (User)
Senior Boarder
Posts: 53
graphgraph
User Offline Click here to see the profile of this user
Re:gtkhtml 10 Months, 2 Weeks ago Karma: 1  
Thanks kksou.

I tried: Sample Code 316: How to display html text using gtkhtml

And, perhaps, not surprisingly, given my results so far, got this:


Fatal error: Class 'GtkHTML' not found in C:\gtkhtml\php-gtk2_with-gtkhtml\php-gtk2\c.php on line 8


Looks like I'll have to take the "fresh install of windows" method.

If I get gtkhtml working, I'll post what I did.

Thanks again.
Neil.
 
  The administrator has disabled public write access.
#2874
neil (User)
Senior Boarder
Posts: 53
graphgraph
User Offline Click here to see the profile of this user
Re:gtkhtml 10 Months, 1 Week ago Karma: 1  
Hi kksou,

I now have gtkhtml working on the computer where another version of php is already installed.

The solution is simple !! (although I don't understand exactly what is happening).

I deleted (in fact, renamed) file "c:\windows\php-cli.ini".

That's all.

Even better ...

I then discovered that if I went to the directory from where I was running the php.exe containing the gtkhtml class, and renamed "php.ini" to "php-cli.ini", this also works. (The existence, or not, of "c:windows\php-cli.ini" then becomes irrelevant.)

Therefore kksou, if you can confirm my findings by producing the same results, perhaps you might consider changing the file name in the download provided at http://www.kksou.com/php-gtk2/tmp/php-gtk2_with-gtkhtml.zip from "php.ini" to "php-cli.ini". (I don't know if this as any other side-effects, but I haven't found any yet.)

(By the way, I still get the message "Gdk-WARNING **: gdkselection-win32.c:1068: OpenClipboard failed: Invalid window handle"
and have to press CTRL|C and run the progam a second time. That's, perhaps, the next challenge ! :)

Neil.
 
  The administrator has disabled public write access.
#2876
neil (User)
Senior Boarder
Posts: 53
graphgraph
User Offline Click here to see the profile of this user
Re:gtkhtml 10 Months, 1 Week ago Karma: 1  
Now I'm really getting out of my depth.

However, using the technique:

$handle = popen('.\gconfd-2.exe','r');
// gtkhtml etc goes here ...
pclose($handle);


If I omit the "pclose" statement from my script, my gtkhtml window opens successfully the first time I run the php script.

(No need to CTRL|c and run the script a second time.)

I've no idea why this works, or if I'm potentially causing other problems. If I open multiple dos command windows, and run the gtkhtml script from each of them, each one successfully opens the gtkhtml window. In the Windows Task Manager 'Processes' php.exe appears once for each execution, but 'gconfd-2' appears once only.

Neil.
 
  The administrator has disabled public write access.
#2877
kksou (Admin)
Admin
Posts: 1240
graph
User Online Now Click here to see the profile of this user
Re:gtkhtml 10 Months, 1 Week ago Karma: 20  
Thanks much for sharing. I think it will save other people facing the sample problem as you a lot of time.


The solution is simple !! (although I don't understand exactly what is happening).

I deleted (in fact, renamed) file "c:\windows\php-cli.ini".

That's all.


Out of curiosity, why do you put a php-cli.ini in c:\windows?

Most people place the php-cli.ini or php.ini in the folder where your php-gtk is.


Even better ...

I then discovered that if I went to the directory from where I was running the php.exe containing the gtkhtml class, and renamed "php.ini" to "php-cli.ini", this also works. (The existence, or not, of "c:windows\php-cli.ini" then becomes irrelevant.)


As mentioned earlier, most people do not put php-cli.ini in c:\windows.

When you don't put php-cli.ini in c:\windows, you can use either php.ini or php-cli.ini in the folder where your php-gtk is.

As you have php-cli.ini in c:\windows, most likely the program loads that first. This is why you get the result you're seeing earlier.


(By the way, I still get the message "Gdk-WARNING **: gdkselection-win32.c:1068: OpenClipboard failed: Invalid window handle"
and have to press CTRL|C and run the progam a second time.


As stated in the article Sample Code 316: How to display html text using gtkhtml?

The warning was already there 2 years ago when I tried it. Till now it's still there. Maybe someone will look into it someday.

Regards,
/kksou
 
  The administrator has disabled public write access.
#2878
kksou (Admin)
Admin
Posts: 1240
graph
User Online Now Click here to see the profile of this user
Re:gtkhtml 10 Months, 1 Week ago Karma: 20  

However, using the technique:

$handle = popen('.\gconfd-2.exe','r');
// gtkhtml etc goes here ...
pclose($handle);


If I omit the "pclose" statement from my script, my gtkhtml window opens successfully the first time I run the php script.

(No need to CTRL|c and run the script a second time.)

I've no idea why this works, or if I'm potentially causing other problems. If I open multiple dos command windows, and run the gtkhtml script from each of them, each one successfully opens the gtkhtml window. In the Windows Task Manager 'Processes' php.exe appears once for each execution, but 'gconfd-2' appears once only.


Your method is similar to the one outlined in:

Sample Code 474: How to display html text using gtkhtml - Part 2?

If you don't use pclose(), when the program ends, I think it will automatically do a pclose(). This is similar to fopen(). If you don't do a fclose(), the program will do it for you when it ends.

Regards,
/kksou
 
 
Last Edit: 2009/11/03 00:12 By kksou.
  The administrator has disabled public write access.
#2881
neil (User)
Senior Boarder
Posts: 53
graphgraph
User Offline Click here to see the profile of this user
Re:gtkhtml 10 Months, 1 Week ago Karma: 1  
Thanks for your response, kksou.

> Out of curiosity, why do you put a php-cli.ini in c:\windows?

I'm asking myself the same question.
It must be something I tried when I was less experienced than I am now.

Will delete the file right away !



>Your method is similar to the one outlined in:
>Sample Code 474: How to display html text using gtkhtml - Part 2?

That's exactly the code I am running to test my gtkhtml environment, except I have now removed the statement :

pclose($handle);// note 2

and I am very happy with the result !

Thanks for your help.

Neil.
 
  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-2009. kksou.com. All Rights Reserved