Alan Zhao’s Blog

“Excellence is not a skill. It is an attitude.” – Ralph Marston
RSS icon Email icon Home icon
  • How to setup a complete PHP-GTK2 development environment under Ubuntu 9.04

    Posted on May 8th, 2009 admin 1 comment

    Folks great news, I’ve successfully setup the same PHP-GTK2 enviornment under Ubuntu 9.04 using the same method described in http://blog.xgra.com/2009/03/31/how-to-setup-a-complete-php-gtk2-development-enviornment-under-ubuntu-810/

    I also had chance to test this personal PHP-GTK2 Ubuntu repository described in http://php-gtk.eu/en/ubuntu-repository-with-php-gtk. However it failed on me when I tested it using a GtkAboutDialog widget. It says GtkAboutDialog is not found. I just gave up after seeing this message.

    GTK
  • How to setup a complete PHP-GTK2 development environment under Ubuntu 8.10

    Posted on March 31st, 2009 azhao 2 comments

    I’ve spent countless hours at night doing researches and tests on this topic. I hope my efforts will help you save tons of time. I even wrote a simple shell script to automate this process, however it’s far from perfection. I only recommend you run the shell script under a fresh Ubuntu 8.10 installation. My intention of this environment is to develop a full fledged windows based PHP applications. Thus, a lot of other essential development tools and packages are also included in the shell script and to be installed. These including MySQL, Apache, Vim and various font packages. I won’t go into details explaining what every package does. I know the purpose of some GTK packages can be confusing, fortunately most of them are documented. You can find more information on them on http://www.gnome.org. Feel free to modify the script to suit your needs. I recommend you set this up under a virtual machine to avoid the pain of re-installing system if anything goes wrong. This script will take about 15-30 minutes to complete depends on your hardware and network connection. Close monitoring is recommended when running this script since no error reporting is incorporated in the script.

    I also have a plan to come up with script to do the same thing under Debian 5.0.

    Warning: I don’t guarantee my method will work for you, use it at your own risk.

    Prerequisites

    Before you begin, please make sure:

    1. You have a fresh installation of Ubuntu 8.10
    2. You install all updates
    3. Enable the following repositories under System -> Administration -> Software Sources and update system again
      • http://archive.canonical.com/ubuntu intrepid partner
      • http://archive.canonical.com/ubuntu intrepid partner (Source Code)

    The Shell Script
    (I am no shell script expert, please don’t criticize me on this)

    #!/bin/sh

    # Make sure you’ve done what I told you to do
    sudo apt-get update -y
    sudo apt-get upgrade -y

    # Development essentials
    sudo apt-get install -y php5 php5-dev php5-cli mysql-server-5.0 mysql-client-5.0 apache2 libapache2-mod-php5 php5-mysql php5-curl php5-mcrypt php5-gd re2c

    # GTK2 essentials
    sudo apt-get install -y libgtk2.0-0 libgtk2.0-dev libglib2.0-0 libglib2.0-dev libgtkextra-x11-2.0-1 libgtkextra-x11-2.0-dev libgtksourceview-dev libgnomeprint2.2-dev libgtksourceview2.0-0 libgtksourceview2.0-dev libsexy2 libsexy-dev libgtkhtml3.14-19 libgtkhtml3.14-dev libgtkhtml3.8-15 libgtkhtml3.8-dev libglade2-0 libglade2-dev libgtkspell0 libgtkspell-dev

    # https://bugs.launchpad.net/ubuntu/+source/php5/+bug/262251
    cd /usr/share/aclocal
    sudo cp libtool.m4 libtool.m4.bk
    sudo chmod 777 libtool.m4
    sudo cat lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 >> libtool.m4
    sudo chmod 644 libtool.m4

    # Build php-gtk2
    cd ~/Desktop
    wget http://gtk.php.net/do_download.php?download_file=php-gtk-2.0.1.tar.gz
    tar -xvvf php-gtk-2.0.1.tar.gz >> /dev/null
    cd php-gtk-2.0.1
    ./buildconf
    sudo ./configure –with-extra –with-sourceview –with-libsexy –with-html –with-spell –enable-scintilla
    sudo make
    sudo make install

    # Install php-gtk2
    cd /usr/lib/php5/200*
    sudo chmod 744 php_gtk2.so
    cd /etc/php5/conf.d/
    sudo touch php_gtk2.ini
    sudo chmod 777 php_gtk2.ini
    sudo echo ‘extension=php_gtk2.so’ > php_gtk2.ini
    sudo chmod 644 php_gtk2.ini

    # Add multilingual support to GTK2, you gotta thank me for that
    sudo chmod 777 /etc/php5/cli/php.ini
    sudo echo ‘php-gtk.codepage = UTF8′ >> /etc/php5/cli/php.ini
    sudo chmod 644 /etc/php5/cli/php.ini

    # Remove build
    cd ~/Desktop
    sudo rm -rf php-gtk-2.0.1*

    # Install SVN, VIM, SSH
    sudo apt-get install -y subversion vim ssh

    # Better fonts
    sudo apt-get install -y msttcorefonts

    # Install CLI sound player
    sudo apt-get install -y music123

    # Clean up
    sudo apt-get autoremove -y

    Download The Shell Script

    php-gtk2-ubuntu-810

    Run A Test

    A test GTK application is included in the download. Run it to make sure everything is setup correctly.

  • History of XGRA.com

    Posted on March 26th, 2009 azhao 1 comment

    For those of you don’t know, the XGRA.com was an open source web site I developed back around 2002 to distribute free PHP programs and web graphics that I created. It gained a short time popularity with my zForum and zClassifieds projects, then the site was closed due to lack of maintaince time. XGRA.com was originally named XGraphics because of my interests in graphic design.

    Me
  • Create a piechart with PHP

    Posted on March 26th, 2009 azhao No comments

    A piechart script I wrote back in 2001.

    http://www.pantz.org/software/php/piechartwithphp.html

  • Past C# custom controls

    Posted on March 26th, 2009 azhao No comments

    A few C# custom controls I’ve done in the past:

    http://www.codeproject.com/KB/buttons/zhaocolorbutton.aspx

    http://www.codeproject.com/KB/cpp/colorprogressbar.aspx

    It has been a while since I last played with C#. I hope to pick it up some day soon.

  • A site I recommend for PHP-GTK enthusiasts

    Posted on March 26th, 2009 azhao No comments

    http://www.kksou.com

    GTK
  • 2nd MBP shipment hit natural disaster in AK

    Posted on March 26th, 2009 azhao No comments

    It happens to be vocano eruption.

  • Green MacBook?

    Posted on March 26th, 2009 azhao No comments

    A point made by people from: http://forums.macrumors.com/showthread.php?t=673714&page=2

    “how can apple call their notebook green when they have to fly all the way from china to USA?”

  • MBP lost in plane crash

    Posted on March 25th, 2009 admin No comments

    I ordered my first MacBook Pro a week ago and suppose to receive it today.

    Unforturnely, Apple sent me a email says that the shipment was lost in the plane crash:

    http://www.nowpublic.com/world/fedex-plane-crashes-tokyo

    They are sending me a new one. However there will be another week of waiting since most Apple products are shipped from China.

    My condolence to the pilots’ families.

  • Welcome to my blog!

    Posted on March 25th, 2009 admin No comments