Md Toy Blog

error use of undeclared identifier ‘ZEND_ACC_CLONE’; did you mean ‘ZEND_AST_CLONE’ – SOLVED

Tue Dec 04 2018 00:00:00 GMT+0000 (Coordinated Universal Time)

INSTALL SOLR php 7.2 extension on Mac OS X Mojave

So you figured out that brew dropped installing extensions for you. And you want to install php 7.2 solr extension.

You go to because they appear to support it, but then they tell you you should not install it in Mojave.

So you stick to brew’s php7.2. You see that you can run: pear install pecl/solr, but you get an error:

error: use of undeclared identifier ‘ZEND_ACC_CLONE’; did you mean ‘ZEND_AST_CLONE’


You browse around and you see that there is some mysterious commit, that is not packaged yet, so you have no

access to the solution with pear or pecl. But the code is there right :

so how do you do it?

You use Git. “But, I don’t …” shh just relax, think. Exactly, got to the package main page:

read that you can actually install it there. You would want a specific commit 744e32915d5989101267ed2c84a407c582dc6f31 or later.

But let’s get the repository in our machine first and then we’ll see from there how to get the right commit.

Create a normal git blank repo.

mkdir phpsolr

cd phpsolr

git init

git remote add origin

git pull origin master


Now we have all the code in our machine, so let’s see if we find the right commit:

git log –oneline

# /744e329


We found it, and we notice that it is older than HEAD, so we might as well install the package using the latest version, which we

already have in our machine.

vim read it. But if you really want it chewed.

The steps are simple:



make && make install

# We need to activate the extension in php.ini

cd /usr/local/etc/php/7.2

vim php.ini

# add this one line in php.ini:


sudo apachectl restart

Done! Congrats!