PHP optimisation in Windows IIS

18 Feb

Firstly, use the non-thread-safe version of PHP, its more efficient, see here.

If you are unsure which version you have, check the very top of phpinfo()

Then you can make some slight changes to php that will save some processing power, see here.

Notably, make these changes in php.ini:

expose_php = Off
short_open_tag = Off
display_errors = Off
display_startup_errors = Off
log_errors = Off
enable_dl = Off

Now within IIS you are going to want to use compression , but not for everything as compression = processor usage. Of course no compression = high bandwidth, so you will need to do some fine tuning here and see what works best for you.

With all that done, you may also want to check out the Winidws Cache extension for PHP, see here.

Stick the .dll in your /ext folder and add the following line toy your php.ini file (make sure you get the right version, also, this will only work with the non-thread-safe build.

extension = php_wincache.dll

See here for and interesting article on some benchmarking done with wincache, those figures pretty much speak for themselves.

Also, you may want to see my other post on improving the performance of MySQL.