| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2013-06-21 00:15 UTC] info at icod dot de
 Description: ------------ Startup Failed Opcode Caching is only supported in Apache, ISAPI, FPM and FastCGI SAPIs uwsgi (my version 1.9.12) http://projects.unbit.it/uwsgi/ uses the embed sapi to compile a php plugin you can build plugins with different versions of php, good stuff. you can use apc in php-5.4, one could use apc in php-5.5 but why? the opcode cache is disabled because uwsgi is using the embedded sapi to build the plugin. Test script: --------------- <?php phpinfo(); ?> Expected result: ---------------- Opcode Caching Enabled Optimization Enabled Actual result: -------------- Opcode Caching Disabled Optimization Disabled Startup Failed Opcode Caching is only supported in Apache, ISAPI, FPM and FastCGI SAPIs PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 08:00:01 2025 UTC | 
I tried patching php to allow opcache to run inside uwsgi, by manually adding "uwsgi" to the list of enabled SAPIs (turns it that it used "uwsgi", not "embed" as I had expected). In any case, with that patch, things seem to run just fine. Performance increases to the expected level (compared with Apache and mod_php) and I haven't found any unexpected behaviour so far. Some tests (looking at phpinfo() generated by different uwsgi workers) suggests that the cache is properly shared between all uwsgi workers too). It's trivial, but here's the patch I'm running with now: --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2434,6 +2434,7 @@ static inline int accel_find_sapi(TSRMLS "apache2filter", "apache2handler", "litespeed", + "uwsgi", NULL }; const char **sapi_name;