PHP/GTK (reprinted)

Source: Internet
Author: User
Tags gtk ini php programming
PHP/GTK (reprinted)
Published on at PM in PHP Programming Forum
In the past, PHP was considered to be only used to write CGI programs on the server. If PHP can develop GUI (Graphical User Interface) programs in Windows, do you believe this? Recently, the PHP development team has successfully developed a PHP program bound with GTK +, so you can develop GUI programs in Windows.
1. Create a PHP/GTK runtime environment:
In fact, the GUI program is no different from the common PHPCGI program, but the PHP/GTK program is generated by the GTK class to generate the GUI. They are also open source code and rely on PHP to parse and create a window. If you have already set up the PHP debugging environment, it is relatively simple to install the PHP/GTK environment:
1. Download php_gtk.dll (this dll file is used to parse the GTK code in the PHP source program) and decompress it to the extension directory of PHP;
2. Download other PHP/GTK dll files (6 in total) and decompress them to the system32 directory of Windows;
3. Open php. ini: add the "extension = php_gtk.dll" statement at the bottom of "Windows Extensions" in the extended settings section. We recommend that you back up php first. ini to avoid modification failure and invalidate the established PHP runtime environment;
Now the PHP/GTK runtime environment has been established. Of course, you can add "dl ('php _ GTK. dll ') to dynamically load GTK support.
If you have not created a PHP runtime environment, it is easier to install it:
1. Download the entire PHP/GTK bundle support package and decompress it to the PHP4 directory of drive C;
2. Copy the dll file under the winnt directory to the system32 directory of Windows, and copy the php. Ini file to the directory of Windows;
After PHP/GTK is set up, you can run a PHP/GTK program in command line mode: Enter "c: php4php-q gtkprogrampath" in the running state ", change "c: php4php" to PHP. EXE path. "gtkprogrampath" is the path of the PHP/GTK program. For example, "c: php4php-q c: php4sampleshello. php" will run the example "hello world" program included in the PHP/GTK runtime package.
2. Compile the PHP/GTK program:
If you create a PHP/GTK application, and you need to build a PHP running environment on the other computer and use the PHP command line mode for parsing to execute the application, it is too complicated. So how can we compile a PHP/GTK program? After some searches, I found the PHPCompiler software.
PHPCompiler is developed by www.javascode.com (http://www.deskcode.com/phpcompiler), which can compile PHP into an EXE executable file with built-in PHP support. If you want to compile a PHP/GTK program, you must create a runtime environment for PHP/GTK (refer to the previous steps ). To compile a PHP/GTK program, follow these steps:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.