1

I have googled for a long time but still cannot figure out why the installation does not work.

I have a machine installed with Ubuntu and php version 5.3.6-13ubuntu3.10 installed, as I want pthreads feature, I try to recompile the downloaded PHP (from the official site, 5.4.14) and recompile with the pthreads enabled, all the processes seem successful, I can recompile and install the php successfully, and type in php -v to check if the version has been upgrade, it shows as follows:

PHP 5.4.14 (cli) (built: May 9 2013 14:27:10) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

And the pthreads seems to be installed correctly

Build process completed successfully Installing '/usr/local/lib/php/extensions/no-debug-zts-20100525/pthreads.so' install ok: channel://pecl.php.net/pthreads-0.0.44 Extension pthreads enabled in php.ini

but the when I restart the apache and run the phpinfo() function, the version is not the same as the above (still 5.3.6-13ubuntu3.10), and the pthreads extension still cannot function properly, encounter the following error)

Fatal error: Class 'Thread' not found

Is there anything I have missed/wrong during the whole process?

Thanks a lot for the help!

user2361494
  • 141
  • 4
  • 9
  • 1
    I think you have compiled the thread safe cli but not the apache module (which requires worker-mpm apache) ... can I see phpinfo output as served by apache ? – Joe Watkins May 09 '13 at 07:26
  • Thanks for the answer, here is the phpinfo information https://docs.google.com/file/d/0BzjkM5qIfmJmd3B2VkhuelBjbmM/edit?usp=sharing – user2361494 May 09 '13 at 09:52
  • Yeah, as I suspected; you need to compile the apache2 module, right now your apache installation is non thread safe. You need to make sure your apache installation has the worker mpm too. – Joe Watkins May 09 '13 at 10:02
  • Thanks! But this has relationship of the problem of version difference problem?? – user2361494 May 09 '13 at 10:04
  • So can I conclude that both apache and php should be recompile in order to satisfy my situation? – user2361494 May 09 '13 at 10:12
  • I have tried to recompile and install the apache with ./configure --prefix=/usr/bin --with-mpm=prefork It installs successfully, but does not seems to "upgrade" the apache, is there any reason for this? – user2361494 May 09 '13 at 10:39
  • Apache needs --with-mpm=worker, additionally there is a difference in how the mpm is configured, google is your friend :) You also need to ensure that when php is configured, you include apache2filter/handler configure option. – Joe Watkins May 09 '13 at 11:06

0 Answers0