{"id":21,"date":"2008-08-15T13:24:28","date_gmt":"2008-08-15T17:24:28","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=21"},"modified":"2008-08-15T13:24:28","modified_gmt":"2008-08-15T17:24:28","slug":"embeder-a-free-php-to-exe-solution","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2008\/08\/15\/embeder-a-free-php-to-exe-solution\/","title":{"rendered":"Embeder &#8211; a free PHP to EXE solution"},"content":{"rendered":"<p>If you&#8217;re looking for a PHP to EXE solution <span style=\"font-weight: bold;\">that supports PHP5<\/span>, <a rel=\"nofollow\" href=\"http:\/\/wildphp.free.fr\/wiki\/doku.php?id=win32std:embeder\">Embeder<\/a> is one rarely mentioned application that will convert your PHP applications into a Windows executable file, although it will <span style=\"font-weight: bold;\">only work with PHP 5.0.3<\/span>. Below are the steps to set it up on your system. (Will run under Linux with <a rel=\"nofollow\" href=\"http:\/\/www.winehq.org\/\">Wine<\/a>, too.)<\/p>\n<ol>\n<li>Download <a href=\"\/labs\/files\/embeder.exe\">embeder<\/a> and it&#8217;s <a href=\"\/labs\/files\/php-embed.ini\">php-embed.ini<\/a>.<\/li>\n<li>Download <a href=\"\/labs\/files\/php-5.0.3-Win32.zip\">PHP<\/a> and <a href=\"\/labs\/files\/php_win32std.dll\">php_win32std.dll<\/a>. (<span style=\"font-weight: bold;\">Do not use the PHP binary provided on php.net<\/span>)<\/li>\n<li>Extract PHP to a directory (preferably short with no spaces). Put embeder.exe and php-embed.ini inside the directory.<\/li>\n<li>Put php_win32std.dll inside the ext directory.<\/li>\n<li>Add the directory to your PATH.<\/li>\n<li>You&#8217;re done! To test it, compile the following test program (save as test.php):<code><span style=\"color: #000000;\"><br \/>\n<span style=\"color: #0000bb;\">&lt;?php<br \/>\n<\/span><span style=\"color: #007700;\">echo <\/span><span style=\"color: #dd0000;\">\"Testing...\\r\\n\"<\/span><span style=\"color: #007700;\">;<br \/>\n<\/span><span style=\"color: #0000bb;\">?&gt;<\/span><br \/>\n<\/span><\/code><br \/>\nRun these commands to make test.exe:<br \/>\n<strong>Windows:<\/strong><br \/>\n<code>embeder new test<br \/>\nembeder main test test.php<br \/>\n<\/code><strong>Linux:<\/strong><br \/>\n<code>wine embeder.exe new test<br \/>\nwine embeder.exe main test test.php<br \/>\n<\/code><\/li>\n<\/ol>\n<p>Notes:<\/p>\n<ol>\n<li>If you are using Wine, you can safely ignore these messages:<br \/>\n&#8220;<span style=\"font-weight: bold;\">fixme:msvcrt:MSVCRT__sopen : pmode 0x01b6 ignored<\/span>&#8221;<br \/>\n&#8220;<span style=\"font-weight: bold;\">fixme:advapi:DeregisterEventSource ((nil)) stub<\/span>&#8220;<\/li>\n<li>(Wine users only) If you experience the crash <strong>wine: Unhandled page fault on read access to 0x00000000 at address 0x100c5619 (thread 0009), starting debugger&#8230;<\/strong>, it means that you are <strong>not using<\/strong> PHP 5.0.3. See full log for details.<\/li>\n<li>(Windows users only) If you experience the following crash dialog, it also means that you are <span style=\"font-weight: bold;\">not using<\/span> PHP 5.0.3.<br \/>\n<img decoding=\"async\" loading=\"lazy\" title=\"Embeder Crashing on Windows XP with PHP 5.2.6\" src=\"\/images\/labs\/embeder_crash.png\" alt=\"Embeder Crashing on Windows XP with PHP 5.2.6\" width=\"553\" height=\"234\" \/><\/li>\n<\/ol>\n<p>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&#8217;t forget to <a href=\"\/labs\/feed\/\">subscribe<\/a> to Compdigitec Labs for more interesting articles!<\/p>","protected":false},"excerpt":{"rendered":"<p>If you&#8217;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.) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,5,4],"tags":[13,43,73,71,864,70,72,9,69],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/21"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}