I got a docker image with php 8. I don't have any details about how it was assembled, but I need this image.
So, I ran it and picked into it (a docker image with php 8.1.25).
I need to install an extension here with sudo pecl install ***
(*** any package it doesn't matter here) and I fail on it:
running: make
/bin/bash /tmp/pear/temp/pear-build-rootNiAoW5/EXTENSION-1.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/EXTENSION -I/tmp/pear/temp/pear-build-rootNiAoW5/EXTENSION-1.0.0/include -I/tmp/pear/temp/pear-build-rootNiAoW5/EXTENSION-1.0.0/main -I/tmp/pear/temp/EXTENSION -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 -DHAVE_CONFIG_H -g -O2 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/EXTENSION/EXTENSION.c -o EXTENSION.lo -MMD -MF EXTENSION.dep -MT EXTENSION.lo
mkdir .libs
cc -I. -I/tmp/pear/temp/EXTENSION -I/tmp/pear/temp/pear-build-rootNiAoW5/EXTENSION-1.0.0/include -I/tmp/pear/temp/pear-build-rootNiAoW5/EXTENSION-1.0.0/main -I/tmp/pear/temp/EXTENSION -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 -DHAVE_CONFIG_H -g -O2 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/EXTENSION/EXTENSION.c -MMD -MF EXTENSION.dep -MT EXTENSION.lo -fPIC -DPIC -o .libs/EXTENSION.o
/tmp/pear/temp/EXTENSION/EXTENSION.c:7:10: fatal error: ext/standard/info.h: No such file or directory
7 | #include "ext/standard/info.h"
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:208: EXTENSION.lo] Error 1
ERROR: `make' failed
With the docker-php install command install-php-extensions ***
I have another problem:
tar (child): /usr/src/php.tar.xz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
I found this php version doesn't have standard libraries in there like:
base64.h credits.h dir_arginfo.h fsock.h md5.h php_crypt.h php_fopen_wrappers.h php_math.h php_smart_string.h php_versioning.h url.h
basic_functions_arginfo.h credits_sapi.h dl_arginfo.h head.h pack.h php_crypt_r.h php_http.h php_mt_rand.h php_smart_string_public.h proc_open.h url_scanner_ex.h
basic_functions.h crypt_blowfish.h dl.h hrtime.h pageinfo.h php_dir.h php_image.h php_net.h php_standard.h quot_print.h user_filters_arginfo.h
crc32.h crypt_freesec.h exec.h html.h php_array.h php_dns.h php_incomplete_class.h php_password.h php_string.h scanf.h winver.h
crc32_x86.h css.h file.h html_tables.h php_assert.h php_ext_syslog.h php_lcg.h php_rand.h php_uuencode.h sha1.h
credits_ext.h datetime.h flock_compat.h info.h php_browscap.h php_filestat.h php_mail.h php_random.h php_var.h streamsfuncs.h
I tried to find them directly in source folder and by a command sudo find / -name 'info.h'
too, but system show no sign of it.
And when I copy and paste libs from other php installation in the source folder /usr/local/include/php/ext/standard/
it finally works.
How can I bring libs there without copying 'em or linking a folder? May be is there a way to install it with other tools?
What you are missing is not "standard libraries", it is "code headers" - parts of the source code which aren't required for running the program, but are used when compiling other code that extends it.
The exact solution depends on what system your Docker image is based - Ubuntu, Alpine, etc, there's probably a package called something like "php-dev" which you need to install.