I want to try threads in PHP on my Ubuntu 12.04 machine. I understand that I need ZTS support in PHP in order to use the pthreads PECL extension. I uninstalled PHP and built it from source with the --enable-maintainer-zts option (I also applied the Suhosin patch). The PHP installation seems to be working (I can run all my applications).
The problem starts when I try to install pthreads. When I run "pecl install pthreads" I get the following error message:
In file included from /tmp/pear/temp/pthreads/php_pthreads.c:238:0: /tmp/pear/temp/pthreads/classes/thread.h: In function ‘zim_Thread_kill’: /tmp/pear/temp/pthreads/classes/thread.h:473:6: error: ‘SIGUSR1’ undeclared (first use in this function) /tmp/pear/temp/pthreads/classes/thread.h:473:6: note: each undeclared identifier is reported only once for each function it appears in In file included from /tmp/pear/temp/pthreads/php_pthreads.c:242:0: /tmp/pear/temp/pthreads/classes/worker.h: In function ‘zim_Worker_kill’: /tmp/pear/temp/pthreads/classes/worker.h:380:6: error: ‘SIGUSR1’ undeclared (first use in this function)
I tried to manually add signal.h to php_pthreads.c, but that led to a whole bunch of other problems. So it seems like something is missing in my installation.
Does anybody have any ideas I can try?
Edit: I'm using PHP 5.3.9