• 12
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

How to install PHP pthreads extension on Ubuntu? [closed]

ZTS: [Z]end [T]hread [S]afety.

ZTS is a compile time option that cannot be enabled at runtime. It allows the PHP interpreter, which usually executes in a single thread, to be executed in many, each with their own isolated instance of the interpreter.

The only option for you appears to be a fresh build, and then using package building tools for your distribution.

I'm not able to advise on the creation of a deb directly, however, creating an rpm is quite trivial, https://github.com/krakjoe/spex there's a starting place for that, you can then use alien to turn an RPM into a deb if you are not able to find out how to create deb packages directly.

Building from source is going to be inescapable, unless you can find some repository with a thread safe build of PHP, with a complete build environment. To that end, the information http://pthreads.org/building may be of use to you. It really isn't that hard to build PHP, nor does it take many hours, on modern hardware you can have a build in less than a minute. You can and should take the opportunity to trim the fat from your installation.

On a side note, the article you reference about PHP not being thread safe is from 2008, it's very wrong. The core is thread safe, there are a few extensions that are inherently unsafe ( not abstracted badly, but fundamentally unsuitable ).

  • 9
Reply Report

It seems, Ubuntu doesn't have a package for the thread-safe PHP in the official repositories. Pthreads extension requires ZTS. Thus, you have two options:

  1. compile it yourself:
  2. find a .deb package somewhere, e.g. repositories of the other Debian-like systems.

I'd compile and package it myself using "checkintsall" utility. Thus, Apt will have ability to keep track of PHP version. I would also request Canonical for a package for ZTS PHP.

  • 6
Reply Report
      • 2
    • Thank you for your answer. I think many people should do this when installing pthreads on Ubuntu. This is why I thought that there should be some solution. But this turned out to be rather complicated question. And I guess Canonical does not include thread-safe PHP binaries intentionally. But may be there is some project where this is already done?
    • Good note on checkinstall. This will help to keep maintainable packet cache. With checkinstall it is also possible to set up a corresponding version, since there can be problems adding the deb to the installed packages. Best check with apt-cache show to get the required version or just pack it (checkinstall) with your systems version apt-cache show php5 | grep Version.

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions