PHP7 Startup: pthreads: Unable to initialize module pthreads in Windows 7 - multithreading

I installed with success on Window 7 Enterprise the following:
httpd-2.4.25-win64-VC14
php-7.1.1-Win32-VC14-x64 (Thread Safe (2017-Jan-18 21:06:35))
php_pthreads-3.1.6-7.0-ts-vc14-x64 from http://windows.php.net/downloads/pecl/releases/pthreads/3.1.6/
The phpinfo page looks well and Thread Safety = enabled.
I followed all instructons on README.md file of php_pthreads-3.1.6-7.0-ts-vc14-x64 package.
However when I'm executing "php -m" I got this error:
PHP Warning: PHP Startup: pthreads: Unable to initialize module
Module compiled with module API=20151012
PHP compiled with module API=20160303
These options need to match
in Unknown on line 0
Warning: PHP Startup: pthreads: Unable to initialize module
Module compiled with module API=20151012
PHP compiled with module API=20160303
These options need to match
in Unknown on line 0
[PHP Modules]
bcmath
calendar
Core
ctype
date
...
I have used threads before with PHP 5.4.33 but I decided to upgrade to PHP7 to have support for tlsv1.1 and tlsv1.2

The reason for the error is that pthread dll is not compatible with the installed php version.
According to github issue discussion the last release php_pthreads-3.1.6-7.0-ts-vc14-x64 will not support php 7.0 or 7.1 on windows because of ZTS is broken on thease versions.
So if you are on windows, and want to work with pthread.. you have to degrade to PHP 5.6 or wait to PHP 7.2 and next release of php_pthreads.
Another option is to use this beta version of php_pthreads:
https://github.com/SirSnyder/pthreads/releases/tag/v3.1.7-beta.1

Related

What is the missing of "version.lib" in process of building clang with clang-cl?

I successfully built standalone llvm on windows with clang-cl (clang 8.0 downloadable binary) against back-end msvc build tool 2017 with windows 10 sdk using cmake/ninja
After that when I was building standalone clang, it reported "version.lib" in linking phase of clang-rename.exe is missing.
LINK Pass 1: command "....
" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'version.lib'
The weird thing is that word version.lib was slabbed in place amoung various lib\clang?????.libs and the leading -LIBPATH:llvm\\.\lib
I tried looking for version.lib in both build folders of llvm and clang, and found none.
Am I supposed to have verson.lib in llvm\lib?
What am I missing here?

Centos 7 with PHP 7.2 Pthreads unable to load redis.so

I recently setup a new Centos 7 system with php 7.2 and Redis. This is working fine. This was my yum install of the php packages.
yum install php72.x86_64 php72-php-cli.x86_64 php72-php-common.x86_64 php72-php-devel.x86_64 php72-php-fpm.x86_64 php72-php-gd.x86_64 php72-php-json.x86_64 php72-php-mbstring.x86_64 php72-php-mysqlnd.x86_64 php72-php-pdo.x86_64 php72-php-pecl-http.x86_64 php72-php-pecl-http-devel.x86_64 php72-php-pecl-igbinary.x86_64 php72-php-pecl-memcached.x86_64 php72-php-pecl-msgpack.x86_64 php72-php-pecl-propro.x86_64 php72-php-pecl-raphf.x86_64 php72-php-xml.x86_64 php72-php-xmlrpc.x86_64 php72-runtime.x86_64 php72-php-pecl-redis.x86_64 php php-devel
Then I installed pthreads as explained in these directions at: https://gist.github.com/petronetto/b31838efc4a854d06ba5d1d9f3b9fec5 but I skipped the yum package install of the php 72 in the instructions.
Now when I check zts-php -i | grep -i thread I get the error, but zts-php otherwise works fine.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/redis.so' (tried: /usr/lib64/php/modules/redis.so (/usr/lib64/php/modules/redis.so: undefined symbol: compiler_globals), /usr/lib64/php-zts/modules//usr/lib64/php/modules/redis.so.so (/usr/lib64/php-zts/modules//usr/lib64/php/modules/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
I read I needed to install php-igbinary which I did, but it didn't solve the issue.
How do I solve the undefined symbol: compiler_globals issue?
This is similar to this questions asked: phprediss extension don't work,unable to load 'redis.so'
Update redis from 4.2 to 4.3 with pecl
# pecl install redis

Does Ubuntu 14.04 support SCTP by default

I am developing an application that will make use of some of the sctp APIs like sctp_bindx, sctp_connectx etc.
My Linux kernel version is 3.13.0-49-generic .
If I try to compile my code , I get the below error
fatal error: netinet/sctp.h: no such file or directory.
If I install lksctp-tools package then my code got compiled.
Can I use the APIs without installing any libsctp library ? Since I read that SCTP is supported by the kenal version > 2.1
All functions require some library. It just happens that glibc is automatically used whenever you use gcc.
SCTP-specific functions are not included in glibc itself, so you need to install and use the sctp library. The fact that kernel supports SCTP is irrelevant here.

libnl-3 includes broken?

I am trying to use libnl 3 (http://www.infradead.org/~tgr/libnl/) under Ubuntu to use netlink in order to get some information from the IPv6 Neighbour Cache.
I am including a bunch of headers for this lib, but gcc already fails for the first one:
#include <libnl3/netlink/netlink.h>
There is no "main header", like libnl.h.
>$ gcc netlink_test.c
In file included from netlink_test.c:11:0:
/usr/include/libnl3/netlink/netlink.h:24:36: fatal error: netlink/netlink-compat.h: No such file or directory
compilation terminated.
The file netlink.h includes "netlink/netlink-compat.h". Unfortunately, there is no "/usr/include/netlink/" folder. There is only "/usr/include/libnl3/netlink/"
Including "netlink/netlink.h" thus gives me:
netlink_test.c:10:29: fatal error: netlink/netlink.h: No such file or directory
compilation terminated.
I have installed the following packages under Ubuntu 12.04:
libnl-3-200
libnl-3-200-dbg
libnl-3-dev
libnl-3-doc
libnl-genl-3-200
libnl-genl-3-200-dev
libnl-route-3-200
libnl-route-3-200-dev
Am I missing here something or is this genuinely broken?
OK, so the package is not broken, I am ;)
A short while ago, they introduced a mechanism to enable users to install different versions of this library.
Now you can configure it using "pkg-config" or just pass the precise directory to the compiler with "-I /usr/include/libnl3/".
And it works.

Problems building libcurl 7.21.2 on Ubuntu 11.10 (Hiphop)

I'm following this Hiphop installation guide:
https://github.com/facebook/hiphop-php/wiki/Building-and-installing-on-ubuntu-10.10
And when I try to make it, I get the following errors:
../lib/.libs/libcurl.so: undefined reference to `SSLv2_client_method'
I've found this Server Fault ticket, but the merged change from the linked Github pull request didn't seem to fix the problem.
https://superuser.com/questions/339932/compiling-curl-with-hiphop-for-php-patch
I'm running Ubuntu 11.10, but I doubt that's the issue.
Thanks for any help you can provide!
EDIT: Adding Hiphop Cmake errors:
Here are errors when I just try to cmake . while ignoring the libcurl problems:
CMake Error at CMake/HPHPFindLibs.cmake:90 (message):
Custom libcurl is required with the HipHop patch
Call Stack (most recent call first):
CMake/HPHPSetup.cmake:46 (include)
src/CMakeLists.txt:18 (include)
Ubuntu 11.10 uses OpenSSL v1.0. OpenSSL v1.0 has (finally!) disabled SSLv2 support entirely.
Curl can build against nosslv2 OpenSSL starting from 7.21.5.
You can port the changes in 7.21.5 that allow such builds back to your custom libcurl. Alternatively, you can build a private version of OpenSSL that includes SSLv2 support, and link your custom libcurl against it.
I had the same problem on 11.10.
#n.m was exactly right on this problem....
I inserted the following lines of code:
#ifdef OPENSSL_NO_SSL2
failf(data, "openSSL was compiled without SSLv2 support");
return CURLE_SSL_CONNECT_ERROR;
#endif
after line 1462
Please find these lines of code here : github.com/bagder/curl/commit/26b487a5d6ed9da5bc8e4a134a88d3125884b852
in curl/lib/ssluse.c
recompiled and built...
Seems to work now!

Resources