PHP

PHP 7.2 compile on Debian Stretch

Libraries:

apt -y install \
    libcurl4-openssl-dev \
    libgd-dev \
    libsodium-dev \
    libxml2-dev \
    libpcre3-dev \
    libssl-dev \
    libsqlite3-dev \
    libzip-dev \
    libbz2-dev \
    libedit-dev \
    libxmlrpc-epi-dev \
    libxmlrpc-core-c3-dev \
    libxslt1-dev \
    libwebp-dev \
    libreadline-dev

Configure:

./configure \
    --prefix=/usr/local/php-7.2 \
    --build=x86_64-linux-gnu \
    --host=x86_64-linux-gnu \
    --config-cache --cache-file=$(pwd -P)/config.cache \
    --with-libdir=lib/x86_64-linux-gnu \
    --enable-cli \
    --enable-fpm \
    --with-config-file-path=\${prefix}/etc \
    --with-config-file-scan-dir=\${prefix}/etc/conf.d \
    --with-fpm-user=www-data \
    --with-fpm-group=www-data \
    --disable-debug \
    --with-pic \
    --with-layout=GNU \
    --with-pear \
    --enable-filter \
    --with-openssl=yes \
    --with-pcre-regex=/usr \
    --enable-hash \
    --with-mhash=/usr \
    --enable-libxml \
    --enable-session \
    --with-sodium \
    --with-zlib=/usr \
    --with-zlib-dir=/usr \
    \
    --enable-opcache \
    --enable-opcache-file \
    --enable-huge-code-pages \
    \
    --enable-mysqlnd \
    --enable-mysqlnd-compression-support \
    --with-zlib-dir=/usr \
    --with-mysqli=mysqlnd \
    --with-pdo-mysql=mysqlnd \
    \
    --with-sqlite3=/usr \
    --with-pdo-sqlite=/usr \
    \
    --enable-json \
    \
    --enable-intl \
    \
    --with-curl=/usr \
    \
    --with-bz2=/usr \
    \
    --with-gd=/usr \
    --with-jpeg-dir=/usr \
    --with-xpm-dir=/usr/X11R6 \
    --with-png-dir=/usr \
    --with-freetype-dir=/usr \
    --with-webp-dir=/usr \
    \
    --enable-mbstring \
    --enable-mbregex \
    --enable-mbregex-backtrack \
    \
    --with-libedit=/usr \
    \
    --enable-wddx \
    --enable-xml \
    --with-xsl=/usr \
    \
    --with-xmlrpc=/usr \
    --with-libxml-dir=/usr \
    \
    --enable-zip \
    --with-zlib-dir=/usr \
    --with-libzip=/usr \
    \
    --enable-calendar \
    --enable-ctype \
    --enable-exif \
    --enable-fileinfo \
    --enable-ftp \
    --with-openssl-dir=/usr \
    --with-gettext=/usr \
    --with-iconv \
    --enable-pdo \
    --enable-phar \
    --enable-pcntl \
    --enable-posix \
    --enable-shmop \
    --enable-sockets \
    --enable-sysvmsg \
    --enable-sysvsem \
    --enable-sysvshm \
    --enable-tokenizer

Make

 

xmlrpc error 1:

/usr/src/php-7.2.12/ext/xmlrpc/xmlrpc-epi-php.c:187:2: error: unknown type name 'XMLRPC_SERVER'
  XMLRPC_SERVER server_ptr;
  ^~~~~~~~~~~~~
/usr/src/php-7.2.12/ext/xmlrpc/xmlrpc-epi-php.c:195:2: error: unknown type name 'STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS'
  STRUCT_XMLRPC_REQUEST_OUTPUT_OPTIONS xmlrpc_out;
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

...
Makefile:1933: recipe for target 'ext/xmlrpc/xmlrpc-epi-php.lo' failed

Open Makefile, add

-I/usr/include/xmlrpc-epi

to the line(1933) where the error occured.

 

xmlrpc error 2:

ext/xmlrpc/.libs/xmlrpc-epi-php.o: In function `destroy_server_data':
/usr/src/php-7.2.12/ext/xmlrpc/xmlrpc-epi-php.c:268: undefined reference to `XMLRPC_ServerDestroy'
ext/xmlrpc/.libs/xmlrpc-epi-php.o: In function `zm_info_xmlrpc':

...

collect2: error: ld returned 1 exit status
Makefile:296: recipe for target 'sapi/cli/php' failed
make: *** [sapi/cli/php] Error 1

 

find

EXTRA_LIBS =

in Makefile, add to the end of the line

-lxmlrpc-epi

 

readline error:

sapi/phpdbg/.libs/phpdbg_cmd.o: In function `phpdbg_read_input':
/usr/src/php-7.2.12/sapi/phpdbg/phpdbg_cmd.c:765: undefined reference to `readline'
/usr/src/php-7.2.12/sapi/phpdbg/phpdbg_cmd.c:773: undefined reference to `add_history'
collect2: error: ld returned 1 exit status
Makefile:374: recipe for target 'sapi/phpdbg/phpdbg' failed
make: *** [sapi/phpdbg/phpdbg] Error 1
make: *** Waiting for unfinished jobs....

Open Makefile, searc

PHPDBG_EXTRA_LIBS =

add “-lreadline”:

PHPDBG_EXTRA_LIBS = -lreadline

102 Posts

自信、努力、活出精彩;以前未所见的颜色,绘大千世界!
View all posts