Hopefully someone has some insight on this one. I attempted to compile PHP 7.4.2 on RHEL with only support for PostgreSQL enabled. I only need the static CGI and SAPI (php-fpm) executables for now. I downloaded and unpacked the source for PostgreSQL 10.11.3. My PHP 7 configure statement is as follows:
./configure --prefix=/home/r*****/usr/local/php7 --enable-static --disable-cli --disable-all --enable-fpm --with-pgsql=/home/r*****/opt/pgsql
The configure goes fine - maybe with a few warnings, but it completes successfully.Then I initiate the build via make. It goes for a while, compiling then attempting to link everything until the point it gets to the pgsql extensions then I get the following errors before it fails and stops:
/bin/sh /home/r*****/usr/src/php7/php-7.4.2/libtool --silent --preserve-dup-deps --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/pgsql/ -I/home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/ -DPHP_ATOM_INC -I/home/r*****/usr/src/php7/php-7.4.2/include -I/home/r*****/usr/src/php7/php-7.4.2/main -I/home/r*****/usr/src/php7/php-7.4.2 -I/home/r*****/usr/src/php7/php-7.4.2/ext/date/lib -I/home/r*****/opt/pgsql/include -I/home/r*****/usr/src/php7/php-7.4.2/TSRM -I/home/r*****/usr/src/php7/php-7.4.2/Zend -g -O2 -fvisibility=hidden -Wall -Wno-strict-aliasing -DZEND_SIGNALS -c /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c -o ext/pgsql/pgsql.lo /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c: In function ‘zif_pg_last_oid’: /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c:3143: error: incompatible types when assigning to type ‘char[1]’ from type ‘char *’ /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c: In function ‘zif_pg_lo_create’: /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c:3231: warning: unused variable ‘wanted_oid’ /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c: In function ‘zif_pg_copy_to’: /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c:4174: error: ‘ret’ undeclared (first use in this function) /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c:4174: error: (Each undeclared identifier is reported only once /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c:4174: error: for each function it appears in.) /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c: In function ‘zif_pg_copy_from’: /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c:4317: warning: implicit declaration of function ‘ZSTR_LVAL’ /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c:4317: warning: passing argument 2 of ‘php_strlcpy’ makes pointer from integer without a cast /home/r*****/usr/src/php7/php-7.4.2/main/php.h:166: note: expected ‘const char *’ but argument is of type ‘int’ /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c: In function ‘php_pgsql_fd_set_option’: /home/r*****/usr/src/php7/php-7.4.2/ext/pgsql/pgsql.c:5401: warning: unused variable ‘pgsql’ make: *** [ext/pgsql/pgsql.lo] Error 1
Whatever the libtool is attempting has issues with the PHP 7.4.2 ext code I am assuming. Is this a GCC issue? Any assistance would be appreciated.
Here is my environment info:
PHP version 7.4.2
Postgresql version 10.11.3
RHEL Linux 4.4.7-23, 2.6.32-754.23.1.el6.x86_64 #1 SMP Tue Sep 17 09:46:55 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux
gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with:
../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model:
posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
BTW - No, I don't have root access or admin. So I cant use Yum, and my attempts at using RPM have been unsuccessful. (Is there a way to install PHP7 locally without root perms?)