« How to use dd to copy, move and erase disks | Home | Stopping the “PHP Fatal error: Internal object missing in” error in PHP-GTK2 »
Embeder – a free PHP to EXE solution
By admin | August 15, 2008
If you’re looking for a PHP to EXE solution that supports PHP5, Embeder is one rarely mentioned application that will convert your PHP applications into a Windows executable file, although it will only work with PHP 5.0.3. Below are the steps to set it up on your system. (Will run under Linux with Wine, too.)
- Download embeder and it’s php-embed.ini.
- Download PHP and php_win32std.dll. (Do not use the PHP binary provided on php.net)
- Extract PHP to a directory (preferably short with no spaces). Put embeder.exe and php-embed.ini inside the directory.
- Put php_win32std.dll inside the ext directory.
- Add the directory to your PATH.
- You’re done! To test it, compile the following test program (save as test.php):
<?php
echo "Testing...\r\n";
?>
Run these commands to make test.exe:
Windows:
embeder new test
Linux:
embeder main test test.php
wine embeder.exe new test
wine embeder.exe main test test.php
Notes:
- If you are using Wine, you can safely ignore these messages:
“fixme:msvcrt:MSVCRT__sopen : pmode 0x01b6 ignored”
“fixme:advapi:DeregisterEventSource ((nil)) stub“ - (Wine users only) If you experience the crash wine: Unhandled page fault on read access to 0x00000000 at address 0x100c5619 (thread 0009), starting debugger…, it means that you are not using PHP 5.0.3. See full log for details.
- (Windows users only) If you experience the following crash dialog, it also means that you are not using PHP 5.0.3.
So as you can see, Embeder is an good solution to use for PHP to EXE or php2exe problems. You can even combine it with bcompiler to create commercial software. If you found this article or guide useful, please help us spread the word or leave a comment. Don’t forget to subscribe to Compdigitec Labs for more interesting articles!
If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!
Topics: Linux, PHP, Windows | 17 Comments »
April 18th, 2009 at 03:52
Dear Compdigitec Labs,
Embeder is a great php to exe converter and it works fine. But how can it includes extensions? Especially I’d like to use php_dio.dll to handle a serial port with open_dio() etc. functions.
Could you please answer this question? It would be very important.
Thank you very much
Best regards
Róbert Szabó
July 9th, 2009 at 17:01
I dont understand = > Add the directory to your PATH.
what do yuo mean by that????
July 9th, 2009 at 17:16
i have php 5.2.8 it will work to??????
but i have install php with appserv
July 10th, 2009 at 08:54
@Rita:
Add the directory to your PATH means that you must add the directory that you extracted PHP and Embeder to the PATH environmental variable. To do so, right click “My Computer” and select “Properties”. Then go to the “Advanced” tab and click the “Environmental Variables” near the bottom of the dialog window. In the “System variables” section, scroll down until you see the “PATH” variable. Once you get there click the “Edit” button and add a semi-colon, followed the full absolute path of the folder that you extracted PHP and Embeder to. Click OK in the dialog and also in the next dialog to apply the settings.
August 15th, 2009 at 21:41
Yay It worked for me…
You just have to put “php_win32std.dll” (without quotes) in the “ext” folder (without quotes) in the extracted folder (PHP) and it will work just fine
September 28th, 2009 at 22:45
Run these commands to make test.exe:
Windows:
embeder new test
embeder main test test.php
how to do this? i dont get it. sorry
September 28th, 2009 at 22:54
Okay! i got it!
but this is my another problem
The instruction at “0x000000001” referenced memory at “0x000000001”. The memory could not be “read”.
Click on OK to terminate the program
Click on Cancel to debug the program
March 28th, 2010 at 05:45
Hello,
This is good tool.
I installed and follow all steps and works seems fine. with cli commands displays:
>embeder new test
‘.\test.exe’ created
>embeder main test test.php
Updated ‘res://.\test.exe/PHP/RUN’ with 33 bytes
but when i double click/ launch the test.exe
then crash error:
“test.exe has encountered a problem and needs to close. We are sorry for the inconvenience.”
OS: winxp.
Could you please tell where i am missing.
Regards,
March 28th, 2010 at 06:05
Hello,
I had downloaded the PHP 5.0.3 and all files from your site links.
— i extract the php in new folder in that folder i put the embeder.exe and php-embed.ini inside the directory and php_win32std.dll inside the ext directory and Added the directory to system environment Variable PATH
then run cli commands displays:
>embeder new test
‘.\test.exe’ created
>embeder main test test.php
Updated ‘res://.\test.exe/PHP/RUN’ with 33 bytes
but when i double click/ launch the test.exe
then crash error:
“test.exe has encountered a problem and needs to close. We are sorry for the inconvenience.”
can we use higher version than PHP 5.0.3 and what kind of php have to download from php.net in case need to work with higher version.
— and how can i include mysql with same exe , in case database i used with php application.
Regards,
May 6th, 2011 at 03:22
Hello
I use php5.2.7 how to add embeder and it’s php-embed.ini. please Did u explain me?
October 15th, 2012 at 14:41
Interesting tool. Does it make console or gui exe?
May 7th, 2016 at 00:07
je vous compred pas quesqu’on peut executer par la suite
May 7th, 2016 at 00:08
je vous compred pas quesqu’on peut executer par la suite pour tapez les commandes ?
May 7th, 2016 at 00:10
what we can execute after that process ?
November 12th, 2024 at 15:17
… [Trackback]
[…] There you will find 19618 more Info to that Topic: compdigitec.com/labs/2008/08/15/embeder-a-free-php-to-exe-solution/ […]
November 15th, 2024 at 21:38
… [Trackback]
[…] Read More Information here on that Topic: compdigitec.com/labs/2008/08/15/embeder-a-free-php-to-exe-solution/ […]
November 27th, 2024 at 19:09
… [Trackback]
[…] Find More on to that Topic: compdigitec.com/labs/2008/08/15/embeder-a-free-php-to-exe-solution/ […]