Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install SPL_Types on PHP 7.1 compiled from source

I am trying to install SPL_Types extension in my PHP 7.1.8 compiled from source.

I have tried with sudo pecl install SPL_Types and compiling the extension from source, but I get the following output:

https://mega.nz/#!WE5WjajQ!QyVxMYWrsUiDF6Gq09psYBpR5Y336v26PusnlBNd8bg

I know it's not cool to post links, but I was not able to put the hole output here.

like image 678
Vinicius Dias Avatar asked Aug 28 '17 02:08

Vinicius Dias


1 Answers

This extension is outdated now and cannot be build with PHP 7.x. Latest version of this lib released at 2012 and supports only PHP 5.4. Native scalar type declarations support makes this extension mostly useless (maybe except for SplEnum).

With PHP 7.x many of internal PHP API was have significantly changed. As you can see in the attached output, source code of the extension uses dozens of outdated APIs (most of errors caused by missing macros, wrong data types, etc).

For the extension to be built with the new version, it must be updated accordingly: Upgrading PHP extensions from PHP5 to NG. If you are not familiar with C you can try to use unofficial fork or polyfill.

like image 183
Timurib Avatar answered Oct 21 '22 23:10

Timurib