You must compile with the preprocessor definition "ZTS=1".
So, the "Preprocessor definition" line under "Project>Settings>C/C++>General" will look like the following:
WIN32,NDEBUG,WINDOWS,MBCS,_USRDLL,ZEND_WIN32,PHP_WIN32,ZEND_DEBUG=0,PHP_EXPORTS,ZTS=1