打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
linux安装php-gtk

The best way to install PHP-GTK 2 on Linux is to compile it. No binary or source packages are available as yet for any distribution, so you can't use your favorite package manager to install PHP-GTK 2! These instructions should be valid for most distributions of Linux, as well as other POSIX compliant systems.

The methods listed here reportedly don't work on FreeBSD

There are two ways to go about installing PHP-GTK 2 on your Linux system. You can either choose to use your existing PHP installation, or decide to install a separate one and dedicate it to PHP-GTK 2. The latter is a simpler method and is recommended for users with little or no Linux experience. In any case, you need Gtk+ version 2.6 upwards installed.

Just follow these steps, and you should be okay! First thing you need is a fresh checkout of PHP. You can choose either the 5_1 or 5_2 branches, both work fine:

$ cvs -d :pserver:cvsread@cvs.php.net:/repository login            $ cvs -d :pserver:cvsread@cvs.php.net:/repository co -r PHP_5_2 php-src
Now, you need to compile and install it:
$ cd php-src            $ ./buildconf            $ ./configure --prefix=/opt/php5_2 --disable-cgi            $ make            $ su            $ make install            $ echo extension=php_gtk2.so >> /opt/php5_2/lib/php.ini            $ /opt/php5_2/bin/php-config --extension-dir | xargs echo 'extension_dir=' >> /opt/php5_2/lib/php.ini

If the current CVS of PHP does not compile, try an official release from the php downloads page, or a snapshot.

Now, let's checkout and install PHP-GTK 2:

$ cd ..            $ cvs -d :pserver:cvsread@cvs.php.net:/repository co php-gtk            $ cd php-gtk            $ ./buildconf --with-phpize=/opt/php5_2/bin/phpize            $ ./configure --with-php-config=/opt/php5_2/bin/php-config            $ make            $ make install

You might want to create a link to the new php executable:

$ ln -s /opt/php5_2/bin/php /usr/bin/php-gtk
That's it, you're done!

If you decide to 'add-on' PHP-GTK 2 to your existing PHP installation, ensure that your version of PHP is at least 5.1 with CLI enabled. PHP-GTK 2 will NOT work with any other versions of PHP. You can check your PHP version by typing php -v on the command line. Don't forget to check if the word cli appears in the output!

Now, checkout the latest CVS source of PHP-GTK 2, or download the Alpha source tarball, as per instructions on the PHP-GTK 2 download page. cd into the checked out / extracted directory, and execute the following:

$ ./buildconf            $ ./configure            $ make            $ make install

This should just work for most people. However, if there are multiple installations of PHP in your machine or you have installed PHP in some exotic location, you might face trouble. Most of these cases can be solved by specifying the exact locations of the phpize and php-config files:

$ ./buildconf --with-phpize=/path/to/phpize            $ ./configure --with-php-config=/path/to/php-config

Before you can use PHP-GTK 2, you need to enable the extension in your php.ini. Just add a

extension=php_gtk2.so
below all the other extension= settings.

You can test whether your installation was successful by executing:

$ php -m | grep php-gtk
You should get a single line that reads php-gtk.

Next, you can try out the demo applications in the demos directory of the php-gtk sources, e.g. demos/phpgtk2-demo.php.


User Contributed Notes
tutorials.installation.linux.php
 

There are no user contributed notes for this page.


Installation on Windows

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
linux 下编译安装php mongodb扩展
linux下php扩展curl的安装
实现Linux下安装mysql和curl扩展
编程语言Linux(CentOS)下PHP扩展PDO编译安装的方法,centospdo_PHP教程
linux里命令pkg-config工具的使用  - linux - LINUX系统维护与...
phpize是什么?
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服