Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown type name 'zend_string'

I am trying to compile APCu cache extension using make && make install.

I get a compilation error regarding not being able to find zend_string or zend_long. Do you guys know what extension I would need for these?

APCu

Thanks :)

like image 716
Kal Avatar asked Dec 14 '15 10:12

Kal


People also ask

Can Zend_string_DUP () force a copy of a string?

While a zend_string_dup () function that performs an actual copy of the string (rather than only a refcount increment) also exists, the behavior is often considered confusing, because it only copies non-immutable strings. If you want to force a copy of a string, you are better off creating a new one using zend_string_init ().

What is Zend_string struct hack?

This means that the zend_string header and the string contents are combined into a single allocation, which is more efficient than using two separate ones. You will find that PHP uses the struct hack in quite a number of places where a fixed-size header is combined with a dynamic amount of data.

Why do we need Zend_string in PHP?

As PHP supports strings that contain null bytes, PHP needs to explicitly store the length of the string. Additionally, PHP needs strings to fit into its general framework of reference-counted structures. This is the purpose of the zend_string type.

How to fix type 'unknown' is not assignable to type error?

The "Type 'unknown' is not assignable to type" error occurs when we try to assign a value with a type of `unknown` to a value of a different type. To solve the error, use a type assertion or a type guard to verify that the two values have compatible types before the assignment. HomeAboutContacts HomeAboutContacts GitHubLinkedinTwitter


2 Answers

Those types only exist in PHP 7/Zend Engine 3. You need the PHP 5 version of the extension.

like image 171
Andrea Avatar answered Oct 19 '22 00:10

Andrea


I try to run:

./configure --with-php-config=/usr/local/php7/bin/php-config

replace

./configure

Success.

like image 33
user7064829 Avatar answered Oct 18 '22 22:10

user7064829