Using spdy with mod_php

420 Views Asked by At

The documentation for SPDY says it is not compatible with mod_php as its not thread safe:

https://developers.google.com/speed/spdy/mod_spdy/php

Much like the Apache Worker MPM, mod_spdy is a multithreaded module, and processes multiple SPDY requests from the same connection simultaneously. This poses a problem for other Apache modules that may not be thread-safe, such as mod_php. Fortunately, it is fairly easy to adjust your Apache configuration to make your existing PHP code safe to use with mod_spdy (and with the Worker MPM as well).

I have tried using SPDY with mod_php and I haven't had any issues. What is the danger of doing this?

1

There are 1 best solutions below

0
On

The PHP core is thread-safe since PHP5. However many of the extensions and libraries that extension use are not.

If you're not using those extensions you'll probably not going to get any problems. If you do, you might get segfaults, other memory access violations or just strange behavior.

A partial list is available op the PHP site. Unfortunately, there doesn't seem to be a conclusive list of thread-safe and thread-unsafe extensions.