A story that I had a hard time trying to build PHP 7.4 on GCE's CentOS 8

Conclusion

When building PHP 7.4 with the configure options --with-openssl and --with-pgsql, the OS bundle and OpenSSL installed in the source build should not coexist if the major and minor versions are the same. ..

environment

--CentOS Linux release 8.2.2004 (Core) ... using GCP's Compute Engine --OpenSSL 1.1.1c FIPS 28 May 2019 ... OS bundle, installed by default

OpenSSL build

I want to install the latest OpenSSL (1.1.1h at that time), build and install as follows

$ sudo dnf install wget
$ wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz
$ tar zxvf openssl-1.1.1h.tar.gz
$ cd openssl-1.1.1h/
$ sudo dnf install perl gcc
$ ./config -fPIC shared --prefix=/usr/local/openssl --openssldir=/usr/local/ssl
$ make
$ make test
$ sudo make install

In addition, although omitted here, Apache 2.4.46 is also built and installed. The following are the packages installed at that time

$ sudo dnf install bzip2 expat-devel pcre-devel

Build PHP 7.4

Installation of required packages

$ sudo dnf install libxml2-devel sqlite-devel oniguruma-devel libpq-devel

Build

$ wget https://www.php.net/distributions/php-7.4.12.tar.bz2
$ tar xvf php-7.4.12.tar.bz2
$ cd php-7.4.12
$ ./configure \
  --with-config-file-path=/etc/php7 \
  --enable-mbstring \
  --with-apxs2=/usr/local/apache2.4/bin/apxs \
  --with-pgsql \
  --with-zlib-dir \
  --disable-ipv6 \
  --with-openssl \
  OPENSSL_CFLAGS=-I/usr/local/openssl/include \
  OPENSSL_LIBS=-L/usr/local/openssl/lib
$ make

The beginning of hardship ...

First wall

Encountered the following error

/usr/local/src/php-7.4.12/ext/pgsql/pgsql.c: In function ‘zif_pg_last_oid’:
/usr/local/src/php-7.4.12/ext/pgsql/pgsql.c:3143:27: error: assignment to expression with array type
  Z_STRVAL_P(return_value) = (char *) PQoidStatus(pgsql_result);
                           ^
・
・
/usr/local/src/php-7.4.12/ext/pgsql/pgsql.c: In function ‘zif_pg_copy_to’:
/usr/local/src/php-7.4.12/ext/pgsql/pgsql.c:4174:11: error: ‘ret’ undeclared (first use in this function); did you mean ‘recv’?
      if ((ret = PQgetline(pgsql, copybuf, COPYBUFSIZ))) {
           ^~~
           recv
・
・
make: *** [Makefile:1101: ext/pgsql/pgsql.lo] Error 1

I thought there was a problem with the source, but even if I executed the same procedure in the following environment, it did not reproduce.

--CentOS Linux release 7.8.2003 (Core) ... using GCP's Compute Engine --OpenSSL 1.0.2k-fips 26 Jan 2017 ... OS bundle, installed by default

Once interpreted as if it was due to a different version of gcc

While investigating the workaround, I came across the following site

I tried building various versions of GCC on CentOS 8-Qiita

According to this information, the default specification of the language standard differs depending on the version of gcc. Immediately, try rebuilding with -std = gnu89, which was the default specification in gcc 4.8.5

$ ./configure \
  --with-config-file-path=/etc/php7 \
  --enable-mbstring \
  --with-apxs2=/usr/local/apache2.4/bin/apxs \
  --with-pgsql \
  --with-zlib-dir \
  --disable-ipv6 \
  --with-openssl \
  OPENSSL_CFLAGS=-I/usr/local/openssl/include \
  OPENSSL_LIBS=-L/usr/local/openssl/lib \
  CFLAGS="-std=gnu89"
$ make

However, the same error is displayed and cannot be resolved ... I thought about building and installing the same version of gcc as CentOS7, but I felt that it was not a fundamental solution, so I fixed the error and rebuilt it ...

Second wall

Although the error displayed on the first wall no longer appears, I encountered the following error

/usr/bin/ld: ext/openssl/.libs/xp_ssl.o: undefined reference to symbol 'SSL_select_next_proto@@OPENSSL_1_1_0'
//usr/local/openssl/lib/libssl.so.1.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:268: sapi/cli/php] Error 1

?? Below, the command with the error

/bin/sh /usr/local/src/php-7.4.12/libtool --silent --preserve-dup-deps --mode=link cc -export-dynamic -I/usr/include -g -O2 -fvisibility=hidden -Wall -Wno-strict-aliasing -DZEND_SIGNALS   -L/usr/local/openssl/lib -L/usr/lib64  -R /usr/local/openssl/lib -R /usr/lib64 ext/date/php_date.lo ext/date/lib/astro.lo ext/date/lib/dow.lo ext/date/lib/parse_date.lo ext/date/lib/parse_tz.lo ext/date/lib/timelib.lo ext/date/lib/tm2unixtime.lo ext/date/lib/unixtime2tm.lo ext/date/lib/parse_iso_intervals.lo ext/date/lib/interval.lo ext/libxml/libxml.lo ext/openssl/openssl.lo ext/openssl/xp_ssl.lo ext/pcre/pcre2lib/pcre2_auto_possess.lo ext/pcre/pcre2lib/pcre2_chartables.lo ext/pcre/pcre2lib/pcre2_compile.lo ext/pcre/pcre2lib/pcre2_config.lo ext/pcre/pcre2lib/pcre2_context.lo ext/pcre/pcre2lib/pcre2_dfa_match.lo ext/pcre/pcre2lib/pcre2_error.lo ext/pcre/pcre2lib/pcre2_jit_compile.lo ext/pcre/pcre2lib/pcre2_maketables.lo ext/pcre/pcre2lib/pcre2_match.lo ext/pcre/pcre2lib/pcre2_match_data.lo ext/pcre/pcre2lib/pcre2_newline.lo ext/pcre/pcre2lib/pcre2_ord2utf.lo ext/pcre/pcre2lib/pcre2_pattern_info.lo ext/pcre/pcre2lib/pcre2_serialize.lo ext/pcre/pcre2lib/pcre2_string_utils.lo ext/pcre/pcre2lib/pcre2_study.lo ext/pcre/pcre2lib/pcre2_substitute.lo ext/pcre/pcre2lib/pcre2_substring.lo ext/pcre/pcre2lib/pcre2_tables.lo ext/pcre/pcre2lib/pcre2_ucd.lo ext/pcre/pcre2lib/pcre2_valid_utf.lo ext/pcre/pcre2lib/pcre2_xclass.lo ext/pcre/pcre2lib/pcre2_find_bracket.lo ext/pcre/pcre2lib/pcre2_convert.lo ext/pcre/pcre2lib/pcre2_extuni.lo ext/pcre/pcre2lib/pcre2_script_run.lo ext/pcre/php_pcre.lo ext/sqlite3/sqlite3.lo ext/ctype/ctype.lo ext/dom/php_dom.lo ext/dom/attr.lo ext/dom/document.lo ext/dom/domerrorhandler.lo ext/dom/domstringlist.lo ext/dom/domexception.lo ext/dom/namelist.lo ext/dom/processinginstruction.lo ext/dom/cdatasection.lo ext/dom/documentfragment.lo ext/dom/domimplementation.lo ext/dom/element.lo ext/dom/node.lo ext/dom/string_extend.lo ext/dom/characterdata.lo ext/dom/documenttype.lo ext/dom/domimplementationlist.lo ext/dom/entity.lo ext/dom/nodelist.lo ext/dom/text.lo ext/dom/comment.lo ext/dom/domconfiguration.lo ext/dom/domimplementationsource.lo ext/dom/entityreference.lo ext/dom/notation.lo ext/dom/xpath.lo ext/dom/dom_iterators.lo ext/dom/typeinfo.lo ext/dom/domerror.lo ext/dom/domlocator.lo ext/dom/namednodemap.lo ext/dom/userdatahandler.lo ext/fileinfo/fileinfo.lo ext/fileinfo/libmagic/apprentice.lo ext/fileinfo/libmagic/apptype.lo ext/fileinfo/libmagic/ascmagic.lo ext/fileinfo/libmagic/cdf.lo ext/fileinfo/libmagic/cdf_time.lo ext/fileinfo/libmagic/compress.lo ext/fileinfo/libmagic/encoding.lo ext/fileinfo/libmagic/fsmagic.lo ext/fileinfo/libmagic/funcs.lo ext/fileinfo/libmagic/is_json.lo ext/fileinfo/libmagic/is_tar.lo ext/fileinfo/libmagic/magic.lo ext/fileinfo/libmagic/print.lo ext/fileinfo/libmagic/readcdf.lo ext/fileinfo/libmagic/softmagic.lo ext/fileinfo/libmagic/der.lo ext/fileinfo/libmagic/buffer.lo ext/filter/filter.lo ext/filter/sanitizing_filters.lo ext/filter/logical_filters.lo ext/filter/callback_filter.lo ext/hash/hash.lo ext/hash/hash_md.lo ext/hash/hash_sha.lo ext/hash/hash_ripemd.lo ext/hash/hash_haval.lo ext/hash/hash_tiger.lo ext/hash/hash_gost.lo ext/hash/hash_snefru.lo ext/hash/hash_whirlpool.lo ext/hash/hash_adler32.lo ext/hash/hash_crc32.lo ext/hash/hash_fnv.lo ext/hash/hash_joaat.lo ext/hash/sha3/generic64lc/KeccakP-1600-opt64.lo ext/hash/sha3/generic64lc/KeccakHash.lo ext/hash/sha3/generic64lc/KeccakSponge.lo ext/hash/hash_sha3.lo ext/iconv/iconv.lo ext/json/json.lo ext/json/json_encoder.lo ext/json/json_parser.lo ext/json/json_scanner.lo ext/mbstring/mbstring.lo ext/mbstring/php_unicode.lo ext/mbstring/mb_gpc.lo ext/mbstring/php_mbregex.lo ext/mbstring/libmbfl/filters/html_entities.lo ext/mbstring/libmbfl/filters/mbfilter_7bit.lo ext/mbstring/libmbfl/filters/mbfilter_ascii.lo ext/mbstring/libmbfl/filters/mbfilter_base64.lo ext/mbstring/libmbfl/filters/mbfilter_big5.lo ext/mbstring/libmbfl/filters/mbfilter_byte2.lo ext/mbstring/libmbfl/filters/mbfilter_byte4.lo ext/mbstring/libmbfl/filters/mbfilter_cp1251.lo ext/mbstring/libmbfl/filters/mbfilter_cp1252.lo ext/mbstring/libmbfl/filters/mbfilter_cp1254.lo ext/mbstring/libmbfl/filters/mbfilter_cp5022x.lo ext/mbstring/libmbfl/filters/mbfilter_cp51932.lo ext/mbstring/libmbfl/filters/mbfilter_cp850.lo ext/mbstring/libmbfl/filters/mbfilter_cp866.lo ext/mbstring/libmbfl/filters/mbfilter_cp932.lo ext/mbstring/libmbfl/filters/mbfilter_cp936.lo ext/mbstring/libmbfl/filters/mbfilter_gb18030.lo ext/mbstring/libmbfl/filters/mbfilter_euc_cn.lo ext/mbstring/libmbfl/filters/mbfilter_euc_jp.lo ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.lo ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.lo ext/mbstring/libmbfl/filters/mbfilter_euc_kr.lo ext/mbstring/libmbfl/filters/mbfilter_euc_tw.lo ext/mbstring/libmbfl/filters/mbfilter_htmlent.lo ext/mbstring/libmbfl/filters/mbfilter_hz.lo ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.lo ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.lo ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.lo ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.lo ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.lo ext/mbstring/libmbfl/filters/mbfilter_jis.lo ext/mbstring/libmbfl/filters/mbfilter_koi8r.lo ext/mbstring/libmbfl/filters/mbfilter_armscii8.lo ext/mbstring/libmbfl/filters/mbfilter_qprint.lo ext/mbstring/libmbfl/filters/mbfilter_sjis.lo ext/mbstring/libmbfl/filters/mbfilter_sjis_open.lo ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.lo ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.lo ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.lo ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.lo ext/mbstring/libmbfl/filters/mbfilter_ucs2.lo ext/mbstring/libmbfl/filters/mbfilter_ucs4.lo ext/mbstring/libmbfl/filters/mbfilter_uhc.lo ext/mbstring/libmbfl/filters/mbfilter_utf16.lo ext/mbstring/libmbfl/filters/mbfilter_utf32.lo ext/mbstring/libmbfl/filters/mbfilter_utf7.lo ext/mbstring/libmbfl/filters/mbfilter_utf7imap.lo ext/mbstring/libmbfl/filters/mbfilter_utf8.lo ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.lo ext/mbstring/libmbfl/filters/mbfilter_uuencode.lo ext/mbstring/libmbfl/filters/mbfilter_koi8u.lo ext/mbstring/libmbfl/mbfl/mbfilter.lo ext/mbstring/libmbfl/mbfl/mbfilter_8bit.lo ext/mbstring/libmbfl/mbfl/mbfilter_pass.lo ext/mbstring/libmbfl/mbfl/mbfilter_wchar.lo ext/mbstring/libmbfl/mbfl/mbfl_convert.lo ext/mbstring/libmbfl/mbfl/mbfl_encoding.lo ext/mbstring/libmbfl/mbfl/mbfl_filter_output.lo ext/mbstring/libmbfl/mbfl/mbfl_ident.lo ext/mbstring/libmbfl/mbfl/mbfl_language.lo ext/mbstring/libmbfl/mbfl/mbfl_memory_device.lo ext/mbstring/libmbfl/mbfl/mbfl_string.lo ext/mbstring/libmbfl/mbfl/mbfl_allocators.lo ext/mbstring/libmbfl/nls/nls_de.lo ext/mbstring/libmbfl/nls/nls_en.lo ext/mbstring/libmbfl/nls/nls_ja.lo ext/mbstring/libmbfl/nls/nls_kr.lo ext/mbstring/libmbfl/nls/nls_neutral.lo ext/mbstring/libmbfl/nls/nls_ru.lo ext/mbstring/libmbfl/nls/nls_uni.lo ext/mbstring/libmbfl/nls/nls_zh.lo ext/mbstring/libmbfl/nls/nls_hy.lo ext/mbstring/libmbfl/nls/nls_tr.lo ext/mbstring/libmbfl/nls/nls_ua.lo ext/pdo/pdo.lo ext/pdo/pdo_dbh.lo ext/pdo/pdo_stmt.lo ext/pdo/pdo_sql_parser.lo ext/pdo/pdo_sqlstate.lo ext/pdo_sqlite/pdo_sqlite.lo ext/pdo_sqlite/sqlite_driver.lo ext/pdo_sqlite/sqlite_statement.lo ext/pgsql/pgsql.lo ext/phar/util.lo ext/phar/tar.lo ext/phar/zip.lo ext/phar/stream.lo ext/phar/func_interceptors.lo ext/phar/dirstream.lo ext/phar/phar.lo ext/phar/phar_object.lo ext/phar/phar_path_check.lo ext/posix/posix.lo ext/reflection/php_reflection.lo ext/session/mod_user_class.lo ext/session/session.lo ext/session/mod_files.lo ext/session/mod_mm.lo ext/session/mod_user.lo ext/simplexml/simplexml.lo ext/simplexml/sxe.lo ext/spl/php_spl.lo ext/spl/spl_functions.lo ext/spl/spl_engine.lo ext/spl/spl_iterators.lo ext/spl/spl_array.lo ext/spl/spl_directory.lo ext/spl/spl_exceptions.lo ext/spl/spl_observer.lo ext/spl/spl_dllist.lo ext/spl/spl_heap.lo ext/spl/spl_fixedarray.lo ext/standard/crypt_freesec.lo ext/standard/crypt_blowfish.lo ext/standard/crypt_sha512.lo ext/standard/crypt_sha256.lo ext/standard/php_crypt_r.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/mt_rand.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo ext/standard/var.lo ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext/standard/ftok.lo ext/standard/sha1.lo ext/standard/user_filters.lo ext/standard/uuencode.lo ext/standard/filters.lo ext/standard/proc_open.lo ext/standard/streamsfuncs.lo ext/standard/http.lo ext/standard/password.lo ext/standard/random.lo ext/standard/net.lo ext/standard/hrtime.lo ext/tokenizer/tokenizer.lo ext/tokenizer/tokenizer_data.lo ext/xml/xml.lo ext/xml/compat.lo ext/xmlreader/php_xmlreader.lo ext/xmlwriter/php_xmlwriter.lo TSRM/TSRM.lo main/main.lo main/snprintf.lo main/spprintf.lo main/fopen_wrappers.lo main/alloca.lo main/php_scandir.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/explicit_bzero.lo main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/network.lo main/php_open_temporary_file.lo main/output.lo main/getopt.lo main/php_syslog.lo main/streams/streams.lo main/streams/cast.lo main/streams/memory.lo main/streams/filter.lo main/streams/plain_wrapper.lo main/streams/userspace.lo main/streams/transports.lo main/streams/xp_socket.lo main/streams/mmap.lo main/streams/glob_wrapper.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dtrace.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_vm_opcodes.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_builtin_functions.lo Zend/zend_ini.lo Zend/zend_sort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo Zend/zend_gc.lo Zend/zend_closures.lo Zend/zend_weakrefs.lo Zend/zend_float.lo Zend/zend_string.lo Zend/zend_signal.lo Zend/zend_generators.lo Zend/zend_virtual_cwd.lo Zend/zend_ast.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_inheritance.lo Zend/zend_smart_str.lo Zend/zend_cpuinfo.lo Zend/zend_execute.lo main/internal_functions_cli.lo sapi/cli/php_cli.lo sapi/cli/php_http_parser.lo sapi/cli/php_cli_server.lo sapi/cli/ps_title.lo sapi/cli/php_cli_process_title.lo \
-lpq -lrt -lrt -lm -ldl -lxml2 -lsqlite3 -lxml2 -lonig -lsqlite3 -lxml2 -lxml2 -lxml2 -lxml2  -o sapi/cli/php

If you look closely, -lpq -lrt -lrt -lm -ldl -lxml2 -lsqlite3 -lxml2 -lonig -lsqlite3 -lxml2 -lxml2 -lxml2 -lxml2 does not contain -lssl -lcrypto (and why -Is there so much lxml2?) Read the configure help carefully

./configure -h
・
・
Some influential environment variables:
・
・
OPENSSL_LIBS
            linker flags for OPENSSL, overriding pkg-config
・
・

Since it says linker flags for OPENSSL, it is interpreted that pointing to the LIB directory is not enough. Change to OPENSSL_LIBS ="-L / usr / local / openssl / lib -lssl -lcrypto " and rebuild

$ ./configure \
  --with-config-file-path=/etc/php7 \
  --enable-mbstring \
  --with-apxs2=/usr/local/apache2.4/bin/apxs \
  --with-pgsql \
  --with-zlib-dir \
  --disable-ipv6 \
  --with-openssl \
  OPENSSL_CFLAGS=-I/usr/local/openssl/include \
  OPENSSL_LIBS="-L/usr/local/openssl/lib -lssl -lcrypto" \
$ make

Result is...

Third wall

Encounter another error

ext/pgsql/.libs/pgsql.o: In function `zif_pg_copy_from':
/usr/local/src/php-7.4.12/ext/pgsql/pgsql.c:4319: undefined reference to `ZSTR_LVAL'
//usr/lib64/libk5crypto.so.3: undefined reference to `EVP_KDF_derive@OPENSSL_1_1_1b'
//usr/lib64/libk5crypto.so.3: undefined reference to `EVP_KDF_ctrl@OPENSSL_1_1_1b'
//usr/lib64/libk5crypto.so.3: undefined reference to `EVP_KDF_CTX_new_id@OPENSSL_1_1_1b'
//usr/lib64/libk5crypto.so.3: undefined reference to `EVP_KDF_CTX_free@OPENSSL_1_1_1b'
collect2: error: ld returned 1 exit status
make: *** [Makefile:268: sapi/cli/php] Error 1

libk5crypto.so.3 is a library included in Kerberos. I added / usr / local / openssl / lib to the shared library path with LD_LIBRARY_PATH, and built and installed Kerberos, but it didn't work. Adding / usr / local / openssl / lib to /etc/ld.so.conf or uninstalling the bundled OpenSSL should not be a concern for others. At the end of the day, I gave up trying to make the same major and minor versions of OpenSSL coexist with the bundle, and compromised by using the bundle's OpenSSL until OpenSSL 1.2 was released.

Launch a new GCE instance and try again

Pre-installed packages

$ sudo dnf install wget perl gcc bzip2 expat-devel pcre-devel openssl-devel libxml2-devel sqlite-devel oniguruma-devel libpq-devel

Build & install PHP7.4

OpenSSL builds and installs PHP without build and install

$ wget https://www.php.net/distributions/php-7.4.12.tar.bz2
$ tar xvf php-7.4.12.tar.bz2
$ cd php-7.4.12
$ ./configure \
  --with-config-file-path=/etc/php7 \
  --enable-mbstring \
  --with-apxs2=/usr/local/apache2.4/bin/apxs \
  --with-pgsql \
  --with-zlib-dir \
  --disable-ipv6 \
  --with-openssl \
  OPENSSL_CFLAGS=-I/usr/include/openssl \
  OPENSSL_LIBS="-L/usr/lib64 -lssl -lcrypto"
$ make
$ make test
$ sudo make install
$ php -v
HP 7.4.12 (cli) (built: Nov  4 2020 16:41:02) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Finally, PHP 7.4 build & installation is complete

Recommended Posts

A story that I had a hard time trying to build PHP 7.4 on GCE's CentOS 8
The story that docker had a hard time
I had a hard time installing MariaDB 10.5.5 on CentOS 8 of Sakura VPS
I tried to build AdoptOpenjdk 11 on CentOS 7
A story that took time to establish a connection
A story that I was addicted to twice with the automatic startup setting of Tomcat 8 on CentOS 8
Android: I had a hard time displaying the HTML file on the SD card
A story about trying hard to decompile JAR files
[Solution] A memo that I had a hard time because the format of sinatra-validation changed
A story I was addicted to when getting a key that was automatically tried on MyBatis
I tried to make an app that allows you to post and chat by genre ~ Where I had a hard time ~
A story that I realized that I had to study as an engineer in the first place
A story that I struggled to challenge a competition professional with Java
A story of frustration trying to create a penetration environment on Ubuntu 20.04
[Small story] Misleading method name (a story that wasted time due to setScale.
Install PHP7.4 to build CentOS7 Laravel environment
I want to install PHP 7.2 on Ubuntu 20.04.
How to install beta php8.0 on CentOS8
A note that I gave up trying to make a custom annotation for Lombok
I tried to easily put CentOS-7 in a PC that I no longer need
The story that I could not build after installing multiple Java on Windows
I had a hard time doing Java multithreading from scratch, so organize it
Command to install nginx / PHP7 / php-fpm on CentOS7
A story about trying to operate JAVA File
How to build a Pytorch environment on Ubuntu
left4dead2 I made a Docker image for the server and tried running it on GCE # 3 (I had a hard time building the server)
The story that did not disappear when I tried to delete mysql on ubuntu
I got an error when trying to install sbt to build a Scala development environment
A story that did not work when trying to handle events in Notification Center
Memo to build a Servlet environment on AWS EC2
A story about trying to get along with Mockito
Steps to set up a VNC server on CentOS 8.3
[Java] I tried to make a rock-paper-scissors game that beginners can run on the console.
[Docker] Is it good enough to call it a multi-stage build? → The story that became so good
[Terraform] When I try to build an Azure resource on a Windows machine, it will time out, so I solved it with Docker.