Skip to content

initial set up for first wxphp #162

@davekimble2

Description

@davekimble2

When you have to reinstall your OS, you will have lost any wxphp stuff you had, and this is the hardest part of wxphp.
So this is a write up of how to do this for Ubuntu_20.04.

How to get wxWidgets and wxPHP, build them, and run wxphp scripts

wxphp (latest) package holds the wrappers for wxWidgets, and must be written and built for the latest stable version of wxWidgets, which is 3.0.5 .

Once only:
Install the dependencies:
sudo apt install libxml2-dev libxslt1-dev libcurl4-openssl-dev libgtk2.0-dev libgconf2-dev libsdl1.2-dev libjpeg-dev libgtk-3-dev libwebkit2gtk-4.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

Then to get latest version of wxphp and build it (it will bring in wxWidgets-3.0.5 and build it if needed):
git clone https://github.com/wxphp/wxphp.git // creates ./wxphp
cd wxphp
phpize
./configure --enable-wxwidgets-static
make
sudo make install

Then edit (as root) /etc/php/7.4/cli/php.ini
insert at end of extensions list (approx line 950):
extension=wxwidgets
Save and exit.

Put your wxphp script in ./wxPHP/folder/script.php
and then start it:
php ./wxPHP/template/template.php

There is currently an error in wxphp that fails to render controls after painting an image into a canvas (a wxPaintDC control).
This can be worked around by forcing the controls off the screen and back on, by moving the frame causing a refresh of the rendering.

Have fun.
My tutorial for beginners to wxphp is at https://www.davekimble.net/wxphp . It is on a satellite connection so is very slow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions