I use my Mac to develop three projects: a Android app, a iPhone app, and a Symfony project.
My Symfony project uses Redis and APCu extensions. This was installed (6 months ago) via PECL using:
sudo pecl install redis
and
sudo pecl install apcu
Yesterday, after update my mac to Mojave, and try to start my PHP's built-in Web Server as usual, I get the following error:
Attempted to load class "Redis" from the global namespace. Did you forget a "use" statement?
I also noticed that php.ini
was removed during the installation, so I used the php.ini-previous
to generate the php.ini
again.
Also re-installed the Command Line Tools (was removed during installation):
xcode-select --install
And finally, I tried to install the redis extenison via PECL, again:
sudo pecl install redis
This time PECL throws an error:
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/temp/pear-build-root1vQ0zO/redis-4.1.1/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/redis -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-root1vQ0zO/redis-4.1.1/include -I/private/tmp/pear/temp/pear-build-root1vQ0zO/redis-4.1.1/main -I/private/tmp/pear/temp/redis -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/redis/redis.c -o redis.lo
mkdir .libs
cc -I. -I/private/tmp/pear/temp/redis -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-root1vQ0zO/redis-4.1.1/include -I/private/tmp/pear/temp/pear-build-root1vQ0zO/redis-4.1.1/main -I/private/tmp/pear/temp/redis -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/redis/redis.c -fno-common -DPIC -o .libs/redis.o
In file included from /private/tmp/pear/temp/redis/redis.c:27:
/private/tmp/pear/temp/redis/common.h:1:10: fatal error: 'php.h' file not found
#include "php.h"
^~~~~~~
1 error generated.
make: *** [redis.lo] Error 1
ERROR: `make' failed
How can solve this issue?
intl
withpecl
– Gaskill