PHP

$ make distclean

$ ./configure ..............

$ make

# make install

uname -a SunOS zone3 5.11 11.4.0.15.0 i86pc i386 i86pc

isainfo -bv 64-bit amd64 applications

pkg install gcc

find /usr -name gcc

/usr/gcc

/usr/gcc/7/bin/gcc

/usr/gcc/7/lib/gcc

/usr/bin/gcc

which gcc

/usr/bin/gcc

/bin/gcc --version

gcc (GCC) 7.3.0

Copyright (C) 2017 Free Software Foundation, Inc.

pkg update

pkg install system/header

pkg list | grep make

developer/build/gnu-make 4.2.1-11.4.0.0.1.14.0 i--

developer/build/make 11.4-11.4.0.0.1.4.0 i--

pkg install developer/build/gnu-make

find /usr -name gmake

/usr/bin/gmake

/usr/sfw/bin/gmake

which gmake

/usr/bin/gmake

stopped all services that came up with svcs \*pkg\* and restarted them, and that appears to have cleared whatever was causing the port issue, now pkg search is working as expected https://www.unix.com/solaris/

crle (configure runtime linking environment) - без аргументов покажет стандартные пути поиска по умолчанию

Устанавливаем переменные для оболочки, не забывая, что они "актуальны" только в той в которой установлены.

export CPP="/usr/gcc/7/bin/gcc -E"

export CC="/usr/gcc/7/bin/gcc"

export CFLAGS="-m64 -std=gnu99 -fPIC -D_LARGEFILE_SOURCED_FILE_OFFSET_BITS=64"

export LDFLAGS="-m64 -L/usr/lib -R/usr/lib"

export CXXFLAGS="-m64"

export CPP="/usr/gcc/7/bin/gcc -E";export CC="/usr/gcc/7/bin/gcc";export CFLAGS="-m64 -std=gnu99 -fPIC -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64";export LDFLAGS="-m64 -L/usr/lib -R/usr/lib";export CXXFLAGS="-m64"

https://www.php.net/downloads.php

http://apache-mirror.rbc.ru/pub/apache/httpd/

http://mirror.linux-ia64.org/apache/apr/

wget http://php.net/distributions/php-7.2.3.tar.bz2

wget http://apache-mirror.rbc.ru/pub/apache/httpd/httpd-2.4.39.tar.bz2

wget http://mirror.linux-ia64.org/apache/apr/apr-1.6.5.tar.bz2

wget http://mirror.linux-ia64.org/apache/apr/apr-util-1.6.1.tar.bz2

Распаковать:

tar -xvf apr-1.6.5.tar.bz2

tar -xvf apr-util-1.6.1.tar.bz2

tar -xvf httpd-2.4.39.tar.bz2

tar -xvf php-7.2.3.tar.bz2

Переименовать:

mv apr-1.6.5 apr

mv apr-util-1.6.1 apr-util

mv httpd-2.4.39 apache39

mv php-7.2.3 php

Компилировать:

cd /apr

./configure --prefix=/opt/apr

gmake

gmake install

cd /apr-util

./configure --prefix=/opt/apr-util --with-apr=/opt/apr

gmake

gmake install

Отредактировать скрипт libtool, по пути /opt/apr/build-1, необходимо отредактировать следующую строку: vim /opt/apr/build-1/libtool

https://questions/libtool-error-during-linkage^

удалив $global_symbol_pipe после $convenience и приведя ее к виду;

cd /apache39

./configure --prefix=/opt/apache24 --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-mpm=worker

gmake

gmake install

Собрать PHP: https://www.php.net/manual/ru/configure.about.php

https://www.php.net/manual/ru/install.unix.apache2.php

http://www.php.su/prepare/?apache_php_unix

cd /php

./configure --prefix=/opt/php \

--with-config-file-path=/opt/php/lib \

Устанавливает путь для поиска php.ini, значение по умолчанию PREFIX/lib. если хотим чтобы в /etc пишем: --with-config-file-path=/etc

--with-apxs2=/opt/apache24/bin/apxs \

Собирает динамический модуль для Apache 2.0. FILE - это опциональный путь к инструменту "Apache apxs", который используется для apxs по умолчанию.

--with-config-file-scan-dir=/opt/php \

--without-pgsql \

--with-zlib \

--with-zlib-dir=/usr/include \

Определить местонахождение библиотеки zlib.

--with-iconv-dir=/usr/include \ #источники конфигурации: --with-.......-dir=

--with-pcre-dir=/usr/include \

--with-gettext=/usr/include \

--with-libxml-dir=/usr/include/libxml2/libxml \

--with-curl \

--with-openssl \

--with-openssl-dir=/usr/include \

--with-gd \

--with-freetype-dir=/usr/include \

--with-xpm-dir=/usr/include \

--with-jpeg-dir=/usr/include \

--with-png-dir=/usr/include \

--with-gnu-ld \

Предполагать, что компилятор С использует линкер GNU ld [по умолчанию=no].

--with-mhash \

--enable-shared \

Собирать общие библиотеки [по умолчанию=yes].

--with-mysqli=mysqlnd \

--enable-zip \

--enable-ftp \

--enable-mysqlnd \

--enable-opcache \

--disable-cli \

Отключает сборку CLI-версии PHP (опция также вызывает --without-pear). Больше информации можно получить в разделе Использование PHP в командной строке.

--disable-ipv6

gmake

gmake install

./configure

--prefix=/usr/php \

--with-config-file-path=/usr/php/lib \

--with-apxs2=/usr/apache2/2.4/bin/apxs \

--with-config-file-scan-dir=/usr/php \

########### --with-pcre-regex=/usr/include \

...............................................................

make distclean (не забывать чистить при повторной компиляции)

-----------------------------

gmake: *** [Makefile:711: ext/fileinfo/libmagic/apprentice.lo] Error 1

Если будет ошибка при компиляции php_7.2, то скорее всего это банальный недостаток памяти (и использовать gmake не из opencsw.org а из pkg)

prstat -Z

ZONEID NPROC SWAP RSS MEMORY TIME CPU ZONE

0 94 1192268K 296532K 14.14% 0:02:59 0.516% global

1 41 285924K 195052K 9.303% 0:00:54 0.259% zone3

./configure --prefix=/usr/php \

--with-config-file-path=/usr/php/lib \

--with-apxs2=/usr/apache2/2.4/bin/apxs \

--with-config-file-scan-dir=/usr/php \

--without-pgsql \

--with-zlib \

--with-zlib-dir=/usr/include \

--with-iconv-dir=/usr/include \

--with-pcre-dir=/usr/include \

--with-gettext=/usr/include \

--with-libxml-dir=/usr/include/libxml2/libxml \

--with-curl \

--with-openssl \

--with-openssl-dir=/usr/include \

--with-gd \

--with-freetype-dir=/usr/include \

--with-xpm-dir=/usr/include \

--with-jpeg-dir=/usr/include \

--with-png-dir=/usr/include \

--with-gnu-ld \

--with-mhash \

--enable-shared \

--with-mysqli=mysqlnd \

--enable-zip \

--enable-ftp \

--enable-mysqlnd \

--enable-opcache \

--disable-cli \

--disable-ipv6

./configure --prefix=/usr/php \

--with-config-file-path=/etc \

--with-apxs2=/usr/apache2/2.4/bin/apxs \

--with-config-file-scan-dir=/usr/php \

--without-pgsql \

--with-zlib \

--with-zlib-dir=/usr/include \

--with-iconv-dir=/usr/include \

--with-pcre-dir=/usr/include \

--with-gettext=/usr/include \

--with-libxml-dir=/usr/include/libxml2/libxml \

--with-curl \

--with-openssl \

--with-openssl-dir=/usr/include \

--with-gd \

--with-freetype-dir=/usr/include \

--with-xpm-dir=/usr/include \

--with-jpeg-dir=/usr/include \

--with-png-dir=/usr/include \

--with-gnu-ld \

--with-mhash \

--enable-shared \

--with-mysqli=mysqlnd \

--enable-zip \

--enable-ftp \

--enable-mysqlnd \

--enable-opcache \

--disable-cli \

--disable-ipv6

==================

./configure --prefix=/usr/php \

--with-config-file-path=/etc \

--with-apxs2=/usr/apache2/2.4/bin/apxs \

--with-config-file-scan-dir=/usr/php \

--without-pgsql \

--with-zlib \

--with-bz2 \

--with-zlib-dir=/usr/include \

--with-jpeg-dir=/usr/include \

--with-png-dir=/usr/includ \

--with-xpm-dir=/usr/includ \

--with-freetype-dir=/usr/includ \

--with-libxml-dir=/usr/include/libxml2/libxml \

--with-iconv-dir=/usr/include \

--with-pcre-dir=/usr/include \

--with-gettext=/usr/include \

--with-curl \

--with-openssl \

--with-openssl-dir=/usr/include \

--with-gd \

--with-gnu-ld \

--with-freetype-dir=/usr/include \

--with-xpm-dir=/usr/include \

--with-jpeg-dir=/usr/include \

--with-png-dir=/usr/include \

--with-mhash \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--enable-shared \

--enable-zip \

--enable-ftp \

--enable-mysqlnd \

--enable-mbstring \

--enable-intl \

--enable-opcache \

--with-gmp \

--disable-cli \

--disable-ipv6

./configure \

--with-apxs=/usr/local/apache/bin/apxs \

--with-zlib \

--with-bz2 \

--with-openssl \

--with-gd \

--enable-exif \

--with-jpeg-dir=/usr \

--with-freetype-dir \

--with-t1lib \

--enable-gd-native-t