aerospike-community / aerospike-client-php

Aerospike client for PHP7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

whether supports Alpine?

woody712 opened this issue · comments

refer title

The basic installation steps do not support Alpine. It may be possible to build the library on Alpine, but the process is more complicated. In general for an OS or distro that isn't explicitly supported.:

Clone the Aerospike C client: https://github.com/aerospike/aerospike-client-c

checkout the version which the current php version depends on. Currently this 4.3.12
git checkout 4.3.12
update submodules
git submodule update --init

build the library:
make

This will create a directory called target
inside of that there will likely be a folder called Linux-x86_64

you need to set the environment variable PREFIX to the path of this directory so something like
export PREFIX=/some/path/aerospike-client-c/target/Linux-x86_64
Now you need to tell the PHP client that you already have the C dependency so it shouldn't download it again.
export DOWNLOAD_C_CLIENT=0

From the PHP client folder, which you can get by cloning this repo:
cd src
./build.sh
make install

The last three steps are further detailed at https://github.com/aerospike/aerospike-client-php#building-manually

Until the export DOWNLOAD_C_CLIENT=0 line it all works.
But i am having a problem when executing the ./build.sh

I have cloned the master branch and i am inside a debian10 machine with the following dockerfile as base

FROM php:7.3
RUN apt-get update && apt-get install -y git build-essential autoconf libssl-dev zlib1g-dev && apt-get autoclean
RUN git clone https://github.com/aerospike/aerospike-client-c /tmp/aerospike-client-c && \
    cd /tmp/aerospike-client-c && \
    git submodule update --init && \
    make

those are some errors. Looks like the library functions are not matching... any idea?

/tmp/aerospike-client-php/src/aerospike.c:23:12: warning: 'le_aerospike' defined but not used [-Wunused-variable]
 static int le_aerospike;
 error: 'AEROSPIKE_ERR_LARGE_ITEM_NOT_FOUND' undeclared here (not in a function); did you mean 'AEROSPIKE_ERR_LUA_FILE_NOT_FOUND'?
   { AEROSPIKE_ERR_LARGE_ITEM_NOT_FOUND      ,   "ERR_LARGE_ITEM_NOT_FOUND"           },
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     AEROSPIKE_ERR_LUA_FILE_NOT_FOUND
cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/aerospike-client-php/src -DPHP_ATOM_INC -I/tmp/aerospike-client-php/src/include -I/tmp/aerospike-client-php/src/main -I/tmp/aerospike-client-php/src -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/tmp/aerospike-client-php/src/../aerospike-client-c/include -I/tmp/aerospike-client-php/src/../aerospike-client-c/include/ck -DHAVE_CONFIG_H -std=gnu99 -g -D__AEROSPIKE_PHP_CLIENT_LOG_LEVEL__=PHP_EXT_AS_LOG_LEVEL_OFF -Wall -c /tmp/aerospike-client-php/src/policy_conversions.c  -fPIC -DPIC -o .libs/policy_conversions.o
/tmp/aerospike-client-php/src/policy_conversions.c:19:85: error: unknown type name 'as_policy_consistency_level'; did you mean 'as_policy_commit_level'?
 static inline void set_consistency_policy_value_from_hash(HashTable* z_policy_hash, as_policy_consistency_level* target);
                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                     as_policy_commit_level