PHP: pthreads not loading on PHP 8.1 - php

I'm trying to add pthreads extension on PHP 8.1 TS and it doesn't seem to work, It's sayin that it is not installed while in fact it is.
PHP -v
PHP 8.1.10 (cli) (built: Aug 30 2022 18:05:49) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.10, Copyright (c) Zend Technologies
with Xdebug v3.1.5, Copyright (c) 2002-2022, by Derick Rethans
Here are the steps I used to install it ->
Get the latest release from here -> https://windows.php.net/downloads/pecl/releases/pthreads/
Extract php_pthreads.dll to /php/ext
Add extension=pthreads to php.ini
Extract pthreadVC2 in to /php
And when I try to install Laravel Horizon this is what I get ->
Root composer.json requires PHP extension ext-pthreads * but it is missing from your system. Install or enable PHP's pthreads extension.

pthreads is not available for PHP 8.1
PHP extensions need to be compiled against the correct version of PHP, because they interact directly with code that is only guaranteed stable within one annual release (e.g. 7.0.1 and 7.0.2 are guaranteed compatible, but 7.0.0 and 7.1.0 are not). They also generally require significant source code changes between major releases, i.e. an extension written for PHP 7.0 is reasonably likely to be compilable against PHP 7.4, but not against PHP 8.0.
If you look at the downloads for an earlier version of pthreads, you'll see that the version of PHP is included in the filename - pthreads 2.0.10 has builds available for 5.3, 5.4, 5.5, and 5.6. The last release listed, 3.1.6, only has two files available, both built for PHP 7.0.
Looking on Github, version 3.1.6 was tagged in Feb 2016, 10 months before PHP 7.1. There is a version 3.2.0 on Github, which mentions support for PHP 7.2, but this does not appear on the PECL page for the extension, which features a prominent banner:
This package is not maintained anymore and has been superseded.
Specifically, it was discontinued by the author in favour of a new extension called "parallel". Unfortunately, that extension has not yet had a release which supports PHP 8.x either.

you can use phpinfo(); method that will display all php extension you have install and make sure that you installed it in right php.ini file maybe that will fix your problem and you can also restart your localhost

Related

Symfony only detects lowest php version

I installed Wamp64, comes with 3 versions of php 5.6, 7.0 and 7.1
When I try to create a new symphony project I receive this error:
Could not find package symfony/skeleton with stability stable in a version > installable using your PHP version 5.6.31.
Obviously I need to activate php7 which I did, I restarted wamp services(apache ...etc) and I still get the same error. Please see attached image
Your PHP path probably points to the bad PHP version.
Try to type
php -v
If the version is not good you can change it by changing your path by typing, environment variable in your Windows search bar.
After that edit the value of the var Path and add the PHP bin folder
For me :
C:\PHP\bin\
And that's all
(Try to learn docker or install your development environment manually and use PHP built-in server to run your project, wamp is good when you start but you don't know how all work and this is bad :( )
i have same issue :
php --version
PHP 7.3.9 (cli) (built: Feb 17 2020 12:46:14) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies
But symfony always output :
Could not find package symfony/website-skeleton with stability stable in a
version installable using your PHP version 5.6.30.

MongoDB DLL on Windows XAMPP

I am runnning MSVC11 x86 and have added the corresponding drivers to ext and added it in the php.ini file.
I have attached screenshots of the errors and have followed what they have asked but they're not making a lot of sense, if anyone has any ideas please let me know.
The most likely case is that the driver DLL you're using is not compatible with your PHP runtime. A similar question on the subject is here.
Each Windows driver release includes various DLLs for each permutation of PHP. For instance, the 1.5.7 release includes the following just for PHP 5.5:
VC9
VC9, NTS (not thread-safe)
VC9, x86_64
VC9, NTS, x86_64
VC11
VC11, NTS (not thread-safe)
VC11, x86_64
VC11, NTS, x86_64
I assume you're correctly using a VC11 DLL, but based on the error message I assume you're using an NTS or x64_64 DDL when you should not be.
The PECL downloads do not specify whether builds are for VC9 or VC11. I believe builds for PHP 5.5+ are VC11, and all prior versions are VC9. That said, the zip releases published in the S3 bucket (referenced in the documentation) do include builds for both VC runtimes for all supported PHP versions.
On a related note of DLL dependencies, you may encounter an error similar to "php_mongo.dll is not a valid Win32 application." If so, that may be due to libsasl.dll missing from your path. This is mentioned in the Windows documentation for the driver and you'll find additional discussion of the issue in PHP-1159.

How to install latest Xdebug 2.2.4 on Zend Server CE 6.3.0 with PHP 5.5.7 on Windows 7

I'm having problem installing XDebug on my Zend Server running on Windows 7.
Theoretically, based on http://files.zend.com/help/Zend-Server/content/zend_server_php_5.5_extensions.htm it looks like Zend Server 6.3 should come with XDebug extension loaded, but it's not in my case.
So I moved to manual installation and using the XDebug tailer installation instructions I get following results
Xdebug installed: no
Windows: yes - Compiler: MS VC9 - Architecture: x86
Zend Server: yes - Install path: C:\Program Files (x86)\Zend\ZendServer
PHP Version: 5.5.7
Thread Safe Build: no
My first question was, which version I should download since there's no XDebug version for PHP 5.5 and VC9, there's only VC11 version. I ended up trying both VC11 for PHP 5.5 and VC9 for PHP 5.4.
Then I followed instructrion from the XDebug page - doesn't work,
then more instructions from http://forums.zend.com/viewtopic.php?f=8&t=553
Nothing worked, no XDebug info showing on phpinfo page, or Zend Server PHP configuration page.
Can anyone suggest how can I proceed?
PHP 5.5 is generally build only with VC11, see on windows.php.net
So the automatic download from http://pecl.php.net or xdebug site is also build only with VC11.
You have multiple choices:
build xdebug yourself with VC9, instructions here: https://wiki.php.net/internals/windows/stepbystepbuild
treat Zend that they finally build PHP5.5 with VC11, like everybody else already do
downgrade ZendServer to PHP 5.4
//UPDATE: VC9 build are now available
http://xdebug.org/download.php

is there a mongo php extension for visual studio 2010

do they make mongodb php extension for visual studio 2010 (on a win7 32bt operating system) and php version 5.2?
i've seen sites that have the dll for download. (sites listed at the end of this text).
but, looking a the different dlls, i only see them for vc9 and vc11. does that mean that isn't mongo/php extension for my version of visual studio?
any info would be greatly appreciated. thank you.
https://github.com/mongodb/mongo-php-driver/downloads
https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
If you're going to download and use a precompiled PHP extension for MongoDB, the important details to match up are: your version of PHP, what compiler was used, and whether it is 32-bit or 64-bit.
You can get this information from the phpinfo() details or by running php -i from a commmand line.
Look for a "PHP Extension Build" line similar to:
PHP Extension Build => API20100525,TS,VC9
You should then download the latest MongoDB driver DLL zip and find the appropriate DLL to install (matching PHP version, TS vs NTS, and VC version).
For example, with the above output from my 64-bit PHP 5.4 install I would use the php_mongo-1.4.x-5.4-vc9-x86_64.dll.
If your PHP extensions require something other than VC9 or VC11 (which is what the current versions are built with) you can try older driver versions, or ideally update your PHP to a newer version.

Install compile version of php in Ubuntu

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!

Categories