gnope php gtk gui gnope.org  

How to load php_gtk2.so ?

 
Post new topic   Reply to topic    gnope.org Forum Index -> Installation problems
View previous topic :: View next topic  
Author Message
70630515



Joined: 02 Aug 2006
Posts: 5

PostPosted: Thu Aug 03, 2006 1:44 pm    Post subject: How to load php_gtk2.so ? Reply with quote

Hello , thanks for looking this article

I`m using

Suse 10.1
php-gtk2.0
apache2
php5

all of above I use tarball to install , but when I run the test page with these code

Quote:

<?php
if (!class_exists('gtk')) {
die("Please load the php-gtk2 module in your php.ini\r\n");
}
$wnd = new GtkWindow();
$wnd->set_title('Hello world');
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));

$lblHello = new GtkLabel("Just wanted to say\r\n'Hello world!'");
$wnd->add($lblHello);

$wnd->show_all();
Gtk::main();
?>

It can only show "Please load the php-gtk2 module in your php.ini "
so I thought my php5 enviroment is no problem , but the php-gtk module is not loaded

and I find some php.ini in my computer , the full path are
/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
/usr/local/lib/php.ini

and my php_gtk2.so is in path
/usr/lib/php5/extensions/php_gtk2.so

I try to append "extension=php_gtk.so" in the php.ini , after I do this, not only the php-gtk didn`t work but also the php5 , and I`ll see nothing from test page = =||

Do anyone know where the problem is ?
I have tried many ways (append "extension_dir=..." ,etc..), so I needed help ^^|

thanks a lot
Very Happy Embarassed
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Thu Aug 03, 2006 11:39 pm    Post subject: Reply with quote

First, you need to find out which php.ini you are using. I guess it's the "cli" one, the command line interface php.ini.

Second, look at the extension_dir setting in this php.ini. Maybe you need to adjust this, or, move the php_gtk2.so in the right directory.

Third, apache doesn't like php anymore since it tries to load the php-gtk2 module which requires an X screen - something that apache doesn't provide, since it's run from commandline as daemon. Disable php_gtk2.so for the apache php.ini
Back to top
70630515



Joined: 02 Aug 2006
Posts: 5

PostPosted: Fri Aug 04, 2006 3:55 am    Post subject: Reply with quote

hi ,

I adjusted the /etx/php5/cli/php.ini with extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20050922"
that where my php_gtk2.so is .

but it still not work,and how do I know which php.ini I`m using ? Sad

Or there`s something I should pay attention to somewhere (tarball , args ...etc).

Thanks for telling , really happy to get your answer Embarassed Smile
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Fri Aug 04, 2006 10:25 am    Post subject: Reply with quote

In apache, make a phpinfo() test site. It will be listed there. On command line, do a
Code:
php -i|grep Configuration
Back to top
70630515



Joined: 02 Aug 2006
Posts: 5

PostPosted: Fri Aug 04, 2006 5:17 pm    Post subject: Reply with quote

cweiske thanks,

I make a test site , this is what the web site show about .ini
Quote:

Configuration File (php.ini) Path /etc/php5/apache2/php.ini

and the command line with command " php -i|grep Configuration "
Quote:

Configuration File (php.ini) Path => /usr/local/lib/php.ini
Configuration


So ...? what should I do , I tried to adjust the extension_dir and extension option

but still not work...>"<

thanks.
Back to top
70630515



Joined: 02 Aug 2006
Posts: 5

PostPosted: Thu Aug 10, 2006 8:19 am    Post subject: Reply with quote

thank you cweiske , I have already solve the problem ,

but I still can not use it in Apache , only in command line I can use it

is there any ideas can that it work in Apache?

However , thanks again~!

^^ Very Happy Very Happy
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Thu Aug 10, 2006 1:21 pm    Post subject: Reply with quote

PHP-Gtk is to create *desktop* applications. Apache is to deliver *web* pages.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> Installation problems All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.