{"id":477,"date":"2007-09-10T10:12:38","date_gmt":"2007-09-10T10:12:38","guid":{"rendered":"http:\/\/neosmart.net\/blog\/2007\/eaccelerator-php-extension-isnt-thread-safe\/"},"modified":"2013-08-26T18:14:58","modified_gmt":"2013-08-26T23:14:58","slug":"eaccelerator-php-extension-isnt-thread-safe","status":"publish","type":"post","link":"https:\/\/neosmart.net\/blog\/eaccelerator-php-extension-isnt-thread-safe\/","title":{"rendered":"eAccelerator PHP Extension Isn&#8217;t Thread-Safe&hellip;"},"content":{"rendered":"<p>For all the Windows-bound PHP users out there, consider yourselves warned: even if you&#8217;re running the (supposedly) thread-safe PHP Win32 binary redistribution, you&#8217;re still susceptible to PHP Access Violation Errors, race problems, heap corruption, and much worse if you use the popular <a href=\"http:\/\/eaccelerator.net\/\" rel=\"follow\">eAccelerator<\/a> opcode-caching extension.<\/p>\n<p>We did our testing with the <a href=\"http:\/\/www.sitebuddy.com\/PHP\/Accelerators\/eAccelerator_windows_binaries_builds\" rel=\"follow\">binaries compiled by SiteBuddy<\/a>&nbsp;using the latest versions of both PHP and eAccelerator. Almost immediately after initiating a stress test on our test servers we experienced the dreaded &#8220;PHP Access Violation&#8221; error &#8211; which brings down the entire IIS Worker Process to its heels. <\/p>\n<p><!--more--><\/p>\n<p>This bug is only encountered on Windows <em>on both Apache and IIS<\/em> when PHP is installed as *SAPI module. If you&#8217;re using it as a CGI process (not recommended!) or via a FastCGI handler (like <a href=\"http:\/\/www.iis.net\/learn\/application-frameworks\/install-and-configure-php-on-iis\/installing-php-on-windows-vista-with-fastcgi\" rel=\"follow\">this excellent one<\/a> by Microsoft), you&#8217;re not affected by this &#8220;bug.&#8221;<sup id=\"rf1-477\"><a href=\"#fn1-477\" title=\"Placed in quotation marks seeing as many fans of PHP, eAccelerator, and a good many more will insist that this is &ldquo;expected behavior&rdquo; and isn&rsquo;t really a bug; being an inherit &ldquo;feature&rdquo; of CGI-based processes.\" rel=\"footnote\">1<\/a><\/sup><\/p>\n<p>Ever since PHP released their &#8220;guaranteed thread-safe&#8221; package for download a month or two ago, it&#8217;s been a much more&#8230; relaxing world for Windows sysadmins everywhere. But it&#8217;s not really such a bright idea to run even a lightly-loaded server w\/ PHP without an opcode-caching extension installed.<\/p>\n<p>If you&#8217;re in the market for another opcode cacher, we recommend <a href=\"http:\/\/xcache.lighttpd.net\/wiki\/WikiStart\" rel=\"follow\">XCache<\/a>; produced by the guys behind the mighty-quick <a href=\"http:\/\/www.lighttpd.net\/\" rel=\"follow\">lighttpd<\/a>. It too is free, except it&#8217;s also thread-safe and has some nice bonus features thrown in the mix. Turk MMCache is history, and APC has (more than) its share of compatibility issues with various popular open source projects. As of&nbsp;the time of this post, we haven&#8217;t encountered any issues with XCache and it seems to be the right choice.<\/p>\n<hr class=\"footnotes\"><ol class=\"footnotes\"><li id=\"fn1-477\"><p>Placed in quotation marks seeing as many fans of PHP, eAccelerator, and a good many more will insist that this is &#8220;expected behavior&#8221; and isn&#8217;t really a bug; being an inherit &#8220;feature&#8221; of CGI-based processes.&nbsp;<a href=\"#rf1-477\" class=\"backlink\" title=\"Jump back to footnote 1 in the text.\">&#8617;<\/a><\/p><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>For all the Windows-bound PHP users out there, consider yourselves warned: even if you&#8217;re running the (supposedly) thread-safe PHP Win32 binary redistribution, you&#8217;re still susceptible to PHP Access Violation Errors, race problems, heap corruption, and much worse if you use &hellip; <a href=\"https:\/\/neosmart.net\/blog\/eaccelerator-php-extension-isnt-thread-safe\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[143,533,56,532,297,83,124,142,4,531],"class_list":["post-477","post","type-post","status-publish","format-standard","hentry","category-software","tag-apache","tag-apc","tag-bugs","tag-eaccelerator","tag-fastcgi","tag-iis","tag-php","tag-servers","tag-windows","tag-xcache"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4xDa-7H","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/comments?post=477"}],"version-history":[{"count":1,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/477\/revisions"}],"predecessor-version":[{"id":2271,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/477\/revisions\/2271"}],"wp:attachment":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/media?parent=477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/categories?post=477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/tags?post=477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}