Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 32

Thread: HOWTO: How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx

  1. #21
    Join Date
    Sep 2009
    Beans
    4

    Re: HOWTO: How to install PHP-GTK in 10.04 Lucid Lynx and Ubuntu 10.10 Maverick Meerk

    in 11.04 cairo can be installed through pecl
    sudo apt-get install php-pear
    sudo pecl install cairo-0.2.0

  2. #22
    Join Date
    Jan 2008
    Beans
    8

    Re: HOWTO: How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx

    Thank you very much bastones!!
    It Was very helpful, I have being trying to install it for a long time..

  3. #23
    Join Date
    Dec 2005
    Location
    South Coast, United Kingd
    Beans
    59
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: snafu Ahoy... (with Fix)

    Bastones ... Passing Gurus...

    I hit a snag with with these instructions (running 10.04 AMD64) and, to my complete and utter amazement (I'm a complete numpty) I managed to fix the problem... This is what happened...

    1. Got the packages ... all OK

    2. Copy in PECL-CAIRO from Subversion... all OK
    (I saw "Checked out revision 318190")

    3. phpize... all OK
    (I saw:-

    Configuring for:
    PHP Api Version: 20090626
    Zend Module Api No: 20090626
    Zend Extension Api No: 220090626)

    4. ./configure... not OK
    First time through I hit an error [Warning] relating to re2c.
    I did this:-

    sudo apt-get re2c

    and the warning went away...

    5. ./configure
    This now runs through, without apparent error, and with the last 4 lines being:-

    configure: creating ./config.status
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: executing libtool commands

    This seems OK...

    6. make... not OK
    I get an error message on line 647 of cairo_surface.c (partially truncated at front):-

    Downloads/pecl-cairo/cairo_surface.c: In function ‘php_cairo_get_surface_ce’:
    Downloads/pecl-cairo/cairo_surface.c:647: error: ‘CAIRO_SURFACE_TYPE_RECORDING’ undeclared (first use in this function)
    Downloads/pecl-cairo/cairo_surface.c:647: error: (Each undeclared identifier is reported only once
    Downloads/pecl-cairo/cairo_surface.c:647: error: for each function it appears in.)

    When I check the relevant section of the source file (cairo_surface.c) I see the following (in part):

    ================================================== ========================
    #ifdef CAIRO_HAS_SVG_SURFACE
    case CAIRO_SURFACE_TYPE_SVG:
    type = cairo_ce_cairosvgsurface;
    break;
    #endif

    #ifdef CAIRO_HAS_PS_SURFACE
    case CAIRO_SURFACE_TYPE_PS:
    type = cairo_ce_cairopssurface;
    break;
    #endif

    #ifdef CAIRO_HAS_PS_SURFACE
    case CAIRO_SURFACE_TYPE_RECORDING:
    type = cairo_ce_cairorecordingsurface;
    break;
    #endif
    ================================================== ========================

    If you look closely at the above source code, you can see that the ifdef statements don't look right...

    Solution:

    Copy the offending file (cairo_surface.c) and go to line 646. Change it from this:

    #ifdef CAIRO_HAS_PS_SURFACE

    [which you should see appears in the script twice, duh] to this:

    #ifdef CAIRO_HAS_RECORDING_SURFACE

    Save the file, and re-run the make. It should work OK. I can't promise there won't be more errors ahead, but I thought this might help...

  4. #24
    Join Date
    Dec 2005
    Location
    South Coast, United Kingd
    Beans
    59
    Distro
    Ubuntu 12.04 Precise Pangolin

    Seconded and Thirded...

    Bastones et al,

    Successfully running installation.

    Thank you so much for taking the time to write guidance notes that were clear enough even for this numpty to follow...

    I did try and look for any clues as to the reason for the error I saw with the Cairo file but didn't find any. I wonder if I was unlucky enough to catch an unstable release? I'll see if I can find somewhere to report what happened...

    Cheers!

  5. #25
    Join Date
    Jun 2006
    Beans
    Hidden!

    Re: HOWTO: How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx

    Thanks to bastones and ytene
    I had an erroneous cairo_surface.c:

    Code:
    #ifdef CAIRO_HAS_PS_SURFACE
    		case CAIRO_SURFACE_TYPE_RECORDING:
    			type = cairo_ce_cairorecordingsurface;
    			break;
    instead of

    Code:
    #ifdef CAIRO_HAS_RECORDING_SURFACE
    		case CAIRO_SURFACE_TYPE_RECORDING:
    			type = cairo_ce_cairorecordingsurface;
    			break;
    Will PHP-GTK be included in future releases of ubuntu?
    Last edited by iduas; January 16th, 2012 at 11:35 PM.

  6. #26
    Join Date
    Dec 2005
    Location
    South Coast, United Kingd
    Beans
    59
    Distro
    Ubuntu 12.04 Precise Pangolin

    Talking cairo_surface Fixed

    iduas,

    I saw exactly the same issue as yours. It turns out that there was an error in the uploaded source versions. I managed to implement the same fix as you identified, so I also filed a bug report, offering up my hack as a work-around.

    I got an email back acknowledging and confirming that the error had been corrected.

    Wish I'd seen your post though!

  7. #27
    Join Date
    Dec 2005
    Location
    South Coast, United Kingd
    Beans
    59
    Distro
    Ubuntu 12.04 Precise Pangolin

    Install PHP-GTK in Ubuntu 12.04 Precise Pangolin

    All, if you're interested in experimenting with PHP-GTK with the latest release (12.04, Precise Pangolin at the time of writing), then you will be pleased to know that bastones original how-to seems to work perfectly.

    Just one little point to watch for...

    I had already installed Apache2, MySQL and PHP before following the guidelines in this thread. When I got to the point where I was searching for the php.ini file, my system advised me that there were two such files in my environment:-

    /etc/php5/cli/php.ini

    and

    /etc/php5/apache2/php.ini

    To make this work, make your ini file edits only to the first of these - i.e. the ini file in the /cli/ folder. Leave the /apache2/ version un-touched. It may be obvious to most, but just in case... you only need to edit the one file.

    If you do make an edit to the /apache2/ file by mistake, your first clue to this should be when you can't get a web-based PHP script to work as expected, and in your Apache log files you see PHP related errors...

    Check in

    /var/log/apache2/error.log

    and look for something like this:-

    [Tue Jun 05 13:17:50 2012] [error] [client 127.0.0.1] PHP Fatal error: php-gtk: Could not open display in Unknown on line 0

    The "php-gtk" reference is your hint, and this is likely what you'll see if you edit the wrong file. Back it out and you should see both web and thick client scripts working perfectly.

    I hope this helps...

  8. #28
    Join Date
    Jan 2010
    Beans
    1

    Re: HOWTO: How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx

    I just tested this on ubuntu 12.04 works fine

  9. #29
    Join Date
    Apr 2008
    Beans
    82
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx

    You can follow the instructions for Ubuntu 12.04: They work perfectly.

    Hi everyone,

    I appreciate the warm response from everyone regarding this howto. I am hoping one day someone is going to develop a binary that makes it easy to install and make use of PHP-GTK applications on Linux distributions, but as of now, Ubuntu does not ship with PHP-GTK because there is not enough support for it nor considering the constraints of the size of a standard CD would it be considered "essential" or "important".

    Speaking of the installation steps I posted here a few years ago, the same steps work perfectly in Ubuntu 12.04 - I have tested this myself. Although certain steps are not necessary it seems, and I wanted to make the howto much cleaner, and I can't modify the original post anymore - so I've posted the howto here: How to install PHP-GTK on Ubuntu 12.04 / in Debian? with better explanations and easier to follow instructions. Either way, both instructions give the same end result - a working installation of PHP-GTK .

    Hope this helps.
    Last edited by bastones; August 17th, 2012 at 11:07 PM.

  10. #30
    Join Date
    Jul 2011
    Beans
    34
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx

    and search for your php.ini file. You may find two. Open each one and in gedit, look at application title bar and you'll see where the php.ini file is from. If it's in a cli directory, that's the one you need to add the extensions line in.

    if I understand this correctly,which I probably don't, I am supposed to add this line to the php.ini file?

    --extension-dir [/usr/lib/php5/20090626+lfs]

    and if so do I just copy and paste?
    Help! I'm kinda over my head here.

    wait, is this correct?:

    this is in the php.ini file:
    **************************

    ; Directory in which the loadable extensions (modules) reside.
    ; http://php.net/extension-dir
    ; extension_dir = "./"
    ; On windows:
    ; extension_dir = "ext"

    so I should uncomment the line "extension_dir" and add the path?
    extension_dir ="./usr/lib/php5/20090626+lfs"

    NEVER MIND ! I figured it out! Solution: no need to do anything with "extension_dir" listing in Php.ini file.
    I want to thank bastone for the most LUCID directions/tutorial I think I've ever come accross for something so complicated for a newbie like me!
    Last edited by steveray100; August 27th, 2012 at 10:27 PM. Reason: solved the problem

Page 3 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •