PHP WinBinder: Project
This page looks at creating a separate Windows application independent of Uniform Server.
Applications produced using this method are not compiled, hence are not standalone executables. They require several support files. That said, they are easy to program using PHP and Winbinder.
For quickness I will use example 4 as a template for the new application.
I have assumed you installed the plugin to Uniform Server's plugin folder.
Paths in both test_4.bat and test_4.phpw need editing
Edit file C:\project1\test_4.bat
Change this line:
..\php\php.exe -c ..\php\php-wb.ini test_4.phpw
winbinder\php\php.exe -c winbinder\php\php-wb.ini winbinder\test_4.phpw
Edit file C:\project1\winbinder\test_4.phpw
Change this line:
Include "../php/include/winbinder.php"; // Location Of Winbinder Library
Include "php/include/winbinder.php"; // Location Of Winbinder Library
Check that the configuration works by running test_4.bat
You now have a working project template. Use this to develop your application.
New batch file
After completing your application, create a new batch file named test_5.bat (or any name you like) with the following content:
start winbinder\php\php-win.exe -c winbinder\php\php-wb.ini winbinder\test_4.phpw
When run, it will automatically close the command window and start your application.
Create an EXE file
Using a batch file to start your windows application produces an annoying flicker as the command window opens and closes. This can be avoided by converting the batch file to an executable. It also provides an opportunity for personalising the file by including your own icon.
How to create EXE file
The plugin includes a powerful little utility to accomplish this. Navigate to folder C:\project1\winbinder\bat2exe and double click on file Bat_To_Exe_Converter.exe
That completes the first page set-up
Note: Steps G) and H) are optional and only required if using an icon for the exe file.
Navigate to folder C:\project1 and double click on the file created: test_5.exe
If you wish you can delete files test_4.bat and test_5.bat. They are no longer required.
If you like filling in forms you can add version details.
The above has shown how to create an independent windows application project. Your PHP script or scripts can be run using an executable file however you still require all the additional support files.
If you want a single executable file, the only way to do this is compile the project. However there is an alternative! It is more a sleight of hand where you compact all the necessary files into a single executable file.
I mentioned the included utility was small and powerful; it has the ability to perform the above. To implement this method requires a flat file structure. This is covered in project 2 on the next page.