From 53c65d18b140a02b58b50467ce55ed1922a0cf05 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 4 Jun 2021 16:22:06 +0200 Subject: update to 8.1.0-dev --- failed.txt | 18 ++ php-8.0.0-phpinfo.patch | 118 -------- php-8.0.0-systzdata-v19.patch | 657 ----------------------------------------- php-8.0.6-deprecated.patch | 400 ------------------------- php-8.1.0-phpinfo.patch | 44 +++ php-8.1.0-systzdata-v20.patch | 661 ++++++++++++++++++++++++++++++++++++++++++ php.conf | 52 ++++ php.conf2 | 14 + php.spec | 38 +-- 9 files changed, 808 insertions(+), 1194 deletions(-) create mode 100644 failed.txt delete mode 100644 php-8.0.0-phpinfo.patch delete mode 100644 php-8.0.0-systzdata-v19.patch delete mode 100644 php-8.0.6-deprecated.patch create mode 100644 php-8.1.0-phpinfo.patch create mode 100644 php-8.1.0-systzdata-v20.patch create mode 100644 php.conf create mode 100644 php.conf2 diff --git a/failed.txt b/failed.txt new file mode 100644 index 0000000..bb0dbf9 --- /dev/null +++ b/failed.txt @@ -0,0 +1,18 @@ +===== 8.1.0-DEV (2021-06-04) + +$ grep -ar 'Tests failed' /var/lib/mock/*/build.log + +/var/lib/mock/scl81el7x/build.log:Tests failed : 0 +/var/lib/mock/scl81el8x/build.log:Tests failed : 0 +/var/lib/mock/scl81fc33x/build.log:Tests failed : 0 +/var/lib/mock/scl81fc34x/build.log:Tests failed : 0 + + + + +(1) proc_open give erratic test results :( +(2) test issue (fixed upstream) +(3) known issue +(4) related to tzdata +(5) need investigation +(6) // issue diff --git a/php-8.0.0-phpinfo.patch b/php-8.0.0-phpinfo.patch deleted file mode 100644 index 391d996..0000000 --- a/php-8.0.0-phpinfo.patch +++ /dev/null @@ -1,118 +0,0 @@ - -Drop "Configure Command" from phpinfo as it doesn't -provide any useful information. -The available extensions are not related to this command. - -Replace full GCC name by gcc in php -v output - - -Also apply - -From 9bf43c45908433d382f0499d529849172d0d8206 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 28 Dec 2020 08:33:09 +0100 -Subject: [PATCH] rename COMPILER and ARCHITECTURE macro (too generic) - ---- - configure.ac | 4 ++-- - ext/standard/info.c | 8 ++++---- - sapi/cli/php_cli.c | 8 ++++---- - win32/build/confutils.js | 10 +++++----- - 4 files changed, 15 insertions(+), 15 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 9d9c8b155b07..143dc061346b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1289,10 +1289,10 @@ if test -n "${PHP_BUILD_PROVIDER}"; then - AC_DEFINE_UNQUOTED(PHP_BUILD_PROVIDER,"$PHP_BUILD_PROVIDER",[build provider]) - fi - if test -n "${PHP_BUILD_COMPILER}"; then -- AC_DEFINE_UNQUOTED(COMPILER,"$PHP_BUILD_COMPILER",[used compiler for build]) -+ AC_DEFINE_UNQUOTED(PHP_BUILD_COMPILER,"$PHP_BUILD_COMPILER",[used compiler for build]) - fi - if test -n "${PHP_BUILD_ARCH}"; then -- AC_DEFINE_UNQUOTED(ARCHITECTURE,"$PHP_BUILD_ARCH",[build architecture]) -+ AC_DEFINE_UNQUOTED(PHP_BUILD_ARCH,"$PHP_BUILD_ARCH",[build architecture]) - fi - - PHP_SUBST_OLD(PHP_INSTALLED_SAPIS) -diff --git a/ext/standard/info.c b/ext/standard/info.c -index 153cb6cde014..8ceef31d9fe4 100644 ---- a/ext/standard/info.c -+++ b/ext/standard/info.c -@@ -798,11 +798,11 @@ PHPAPI ZEND_COLD void php_print_info(int flag) - #ifdef PHP_BUILD_PROVIDER - php_info_print_table_row(2, "Build Provider", PHP_BUILD_PROVIDER); - #endif --#ifdef COMPILER -- php_info_print_table_row(2, "Compiler", COMPILER); -+#ifdef PHP_BUILD_COMPILER -+ php_info_print_table_row(2, "Compiler", PHP_BUILD_COMPILER); - #endif --#ifdef ARCHITECTURE -- php_info_print_table_row(2, "Architecture", ARCHITECTURE); -+#ifdef PHP_BUILD_ARCH -+ php_info_print_table_row(2, "Architecture", PHP_BUILD_ARCH); - #endif - #ifdef CONFIGURE_COMMAND - php_info_print_table_row(2, "Configure Command", CONFIGURE_COMMAND ); -diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c -index 5092fb0ffd68..9d296acec631 100644 ---- a/sapi/cli/php_cli.c -+++ b/sapi/cli/php_cli.c -@@ -640,12 +640,12 @@ static int do_cli(int argc, char **argv) /* {{{ */ - #else - "NTS " - #endif --#ifdef COMPILER -- COMPILER -+#ifdef PHP_BUILD_COMPILER -+ PHP_BUILD_COMPILER - " " - #endif --#ifdef ARCHITECTURE -- ARCHITECTURE -+#ifdef PHP_BUILD_ARCH -+ PHP_BUILD_ARCH - " " - #endif - #if ZEND_DEBUG - -diff -up ./ext/standard/info.c.phpinfo ./ext/standard/info.c ---- ./ext/standard/info.c.phpinfo 2020-07-21 10:49:31.000000000 +0200 -+++ ./ext/standard/info.c 2020-07-21 11:41:56.295633523 +0200 -@@ -804,9 +804,6 @@ PHPAPI ZEND_COLD void php_print_info(int - #ifdef PHP_BUILD_ARCH - php_info_print_table_row(2, "Architecture", PHP_BUILD_ARCH); - #endif --#ifdef CONFIGURE_COMMAND -- php_info_print_table_row(2, "Configure Command", CONFIGURE_COMMAND ); --#endif - - if (sapi_module.pretty_name) { - php_info_print_table_row(2, "Server API", sapi_module.pretty_name ); -diff -up ./ext/standard/tests/general_functions/phpinfo.phpt.phpinfo ./ext/standard/tests/general_functions/phpinfo.phpt ---- ./ext/standard/tests/general_functions/phpinfo.phpt.phpinfo 2020-07-21 10:49:31.000000000 +0200 -+++ ./ext/standard/tests/general_functions/phpinfo.phpt 2020-07-21 11:41:56.296633522 +0200 -@@ -17,7 +17,6 @@ PHP Version => %s - - System => %s - Build Date => %s%a --Configure Command => %s - Server API => Command Line Interface - Virtual Directory Support => %s - Configuration File (php.ini) Path => %s -diff -up ./sapi/cli/php_cli.c.phpinfo ./sapi/cli/php_cli.c ---- ./sapi/cli/php_cli.c.phpinfo 2020-07-21 11:43:38.812475300 +0200 -+++ ./sapi/cli/php_cli.c 2020-07-21 11:43:45.783464540 +0200 -@@ -641,8 +641,7 @@ static int do_cli(int argc, char **argv) - "NTS " - #endif - #ifdef PHP_BUILD_COMPILER -- PHP_BUILD_COMPILER -- " " -+ "gcc " - #endif - #ifdef PHP_BUILD_ARCH - PHP_BUILD_ARCH diff --git a/php-8.0.0-systzdata-v19.patch b/php-8.0.0-systzdata-v19.patch deleted file mode 100644 index 902d3ce..0000000 --- a/php-8.0.0-systzdata-v19.patch +++ /dev/null @@ -1,657 +0,0 @@ -# License: MIT -# http://opensource.org/licenses/MIT - -Add support for use of the system timezone database, rather -than embedding a copy. Discussed upstream but was not desired. - -History: -r19: adapt for timelib 2020.02 (in 8.0.0beta2) -r18: adapt for autotool change in 7.3.3RC1 -r17: adapt for timelib 2018.01 (in 7.3.2RC1) -r16: adapt for timelib 2017.06 (in 7.2.3RC1) -r15: adapt for timelib 2017.05beta7 (in 7.2.0RC1) -r14: improve check for valid tz file -r13: adapt for upstream changes to use PHP allocator -r12: adapt for upstream changes for new zic -r11: use canonical names to avoid more case sensitivity issues - round lat/long from zone.tab towards zero per builtin db -r10: make timezone case insensitive -r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold) -r8: fix compile error without --with-system-tzdata configured -r7: improve check for valid timezone id to exclude directories -r6: fix fd leak in r5, fix country code/BC flag use in - timezone_identifiers_list() using system db, - fix use of PECL timezonedb to override system db, -r5: reverts addition of "System/Localtime" fake tzname. - updated for 5.3.0, parses zone.tab to pick up mapping between - timezone name, country code and long/lat coords -r4: added "System/Localtime" tzname which uses /etc/localtime -r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert) -r2: add filesystem trawl to set up name alias index -r1: initial revision - -diff -up php-8.0.0beta3/ext/date/config0.m4.systzdata php-8.0.0beta3/ext/date/config0.m4 ---- php-8.0.0beta3/ext/date/config0.m4.systzdata 2020-09-01 19:13:26.000000000 +0200 -+++ php-8.0.0beta3/ext/date/config0.m4 2020-09-02 08:07:51.039979873 +0200 -@@ -4,6 +4,19 @@ AC_CHECK_HEADERS([io.h]) - dnl Check for strtoll, atoll - AC_CHECK_FUNCS(strtoll atoll) - -+PHP_ARG_WITH(system-tzdata, for use of system timezone data, -+[ --with-system-tzdata[=DIR] to specify use of system timezone data], -+no, no) -+ -+if test "$PHP_SYSTEM_TZDATA" != "no"; then -+ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used]) -+ -+ if test "$PHP_SYSTEM_TZDATA" != "yes"; then -+ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA", -+ [Define for location of system timezone data]) -+ fi -+fi -+ - PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1" - timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c - lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c" -diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/date/lib/parse_tz.c ---- php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata 2020-09-01 19:13:26.000000000 +0200 -+++ php-8.0.0beta3/ext/date/lib/parse_tz.c 2020-09-02 08:07:51.039979873 +0200 -@@ -26,8 +26,21 @@ - #include "timelib.h" - #include "timelib_private.h" - -+#ifdef HAVE_SYSTEM_TZDATA -+#include -+#include -+#include -+#include -+#include -+ -+#include "php_scandir.h" -+ -+#else - #define TIMELIB_SUPPORTS_V2DATA - #include "timezonedb.h" -+#endif -+ -+#include - - #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) - # if defined(__LITTLE_ENDIAN__) -@@ -94,6 +107,11 @@ static int read_php_preamble(const unsig - { - uint32_t version; - -+ if (memcmp(*tzf, "TZif", 4) == 0) { -+ *tzf += 20; -+ return 0; -+ } -+ - /* read ID */ - version = (*tzf)[3] - '0'; - *tzf += 4; -@@ -418,7 +436,429 @@ void timelib_dump_tzinfo(timelib_tzinfo - } - } - --static int seek_to_tz_position(const unsigned char **tzf, const char *timezone, const timelib_tzdb *tzdb) -+#ifdef HAVE_SYSTEM_TZDATA -+ -+#ifdef HAVE_SYSTEM_TZDATA_PREFIX -+#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX -+#else -+#define ZONEINFO_PREFIX "/usr/share/zoneinfo" -+#endif -+ -+/* System timezone database pointer. */ -+static const timelib_tzdb *timezonedb_system; -+ -+/* Hash table entry for the cache of the zone.tab mapping table. */ -+struct location_info { -+ char code[2]; -+ double latitude, longitude; -+ char name[64]; -+ char *comment; -+ struct location_info *next; -+}; -+ -+/* Cache of zone.tab. */ -+static struct location_info **system_location_table; -+ -+/* Size of the zone.tab hash table; a random-ish prime big enough to -+ * prevent too many collisions. */ -+#define LOCINFO_HASH_SIZE (1021) -+ -+/* Compute a case insensitive hash of str */ -+static uint32_t tz_hash(const char *str) -+{ -+ const unsigned char *p = (const unsigned char *)str; -+ uint32_t hash = 5381; -+ int c; -+ -+ while ((c = tolower(*p++)) != '\0') { -+ hash = (hash << 5) ^ hash ^ c; -+ } -+ -+ return hash % LOCINFO_HASH_SIZE; -+} -+ -+/* Parse an ISO-6709 date as used in zone.tab. Returns end of the -+ * parsed string on success, or NULL on parse error. On success, -+ * writes the parsed number to *result. */ -+static char *parse_iso6709(char *p, double *result) -+{ -+ double v, sign; -+ char *pend; -+ size_t len; -+ -+ if (*p == '+') -+ sign = 1.0; -+ else if (*p == '-') -+ sign = -1.0; -+ else -+ return NULL; -+ -+ p++; -+ for (pend = p; *pend >= '0' && *pend <= '9'; pend++) -+ ;; -+ -+ /* Annoying encoding used by zone.tab has no decimal point, so use -+ * the length to determine the format: -+ * -+ * 4 = DDMM -+ * 5 = DDDMM -+ * 6 = DDMMSS -+ * 7 = DDDMMSS -+ */ -+ len = pend - p; -+ if (len < 4 || len > 7) { -+ return NULL; -+ } -+ -+ /* p => [D]DD */ -+ v = (p[0] - '0') * 10.0 + (p[1] - '0'); -+ p += 2; -+ if (len == 5 || len == 7) -+ v = v * 10.0 + (*p++ - '0'); -+ /* p => MM[SS] */ -+ v += (10.0 * (p[0] - '0') -+ + p[1] - '0') / 60.0; -+ p += 2; -+ /* p => [SS] */ -+ if (len > 5) { -+ v += (10.0 * (p[0] - '0') -+ + p[1] - '0') / 3600.0; -+ p += 2; -+ } -+ -+ /* Round to five decimal place, not because it's a good idea, -+ * but, because the builtin data uses rounded data, so, match -+ * that. */ -+ *result = trunc(v * sign * 100000.0) / 100000.0; -+ -+ return p; -+} -+ -+/* This function parses the zone.tab file to build up the mapping of -+ * timezone to country code and geographic location, and returns a -+ * hash table. The hash table is indexed by the function: -+ * -+ * tz_hash(timezone-name) -+ */ -+static struct location_info **create_location_table(void) -+{ -+ struct location_info **li, *i; -+ char zone_tab[PATH_MAX]; -+ char line[512]; -+ FILE *fp; -+ -+ strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab); -+ -+ fp = fopen(zone_tab, "r"); -+ if (!fp) { -+ return NULL; -+ } -+ -+ li = calloc(LOCINFO_HASH_SIZE, sizeof *li); -+ -+ while (fgets(line, sizeof line, fp)) { -+ char *p = line, *code, *name, *comment; -+ uint32_t hash; -+ double latitude, longitude; -+ -+ while (isspace(*p)) -+ p++; -+ -+ if (*p == '#' || *p == '\0' || *p == '\n') -+ continue; -+ -+ if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t') -+ continue; -+ -+ /* code => AA */ -+ code = p; -+ p[2] = 0; -+ p += 3; -+ -+ /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */ -+ p = parse_iso6709(p, &latitude); -+ if (!p) { -+ continue; -+ } -+ p = parse_iso6709(p, &longitude); -+ if (!p) { -+ continue; -+ } -+ -+ if (!p || *p != '\t') { -+ continue; -+ } -+ -+ /* name = string */ -+ name = ++p; -+ while (*p != '\t' && *p && *p != '\n') -+ p++; -+ -+ *p++ = '\0'; -+ -+ /* comment = string */ -+ comment = p; -+ while (*p != '\t' && *p && *p != '\n') -+ p++; -+ -+ if (*p == '\n' || *p == '\t') -+ *p = '\0'; -+ -+ hash = tz_hash(name); -+ i = malloc(sizeof *i); -+ memcpy(i->code, code, 2); -+ strncpy(i->name, name, sizeof i->name); -+ i->comment = strdup(comment); -+ i->longitude = longitude; -+ i->latitude = latitude; -+ i->next = li[hash]; -+ li[hash] = i; -+ /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */ -+ } -+ -+ fclose(fp); -+ -+ return li; -+} -+ -+/* Return location info from hash table, using given timezone name. -+ * Returns NULL if the name could not be found. */ -+const struct location_info *find_zone_info(struct location_info **li, -+ const char *name) -+{ -+ uint32_t hash = tz_hash(name); -+ const struct location_info *l; -+ -+ if (!li) { -+ return NULL; -+ } -+ -+ for (l = li[hash]; l; l = l->next) { -+ if (timelib_strcasecmp(l->name, name) == 0) -+ return l; -+ } -+ -+ return NULL; -+} -+ -+/* Filter out some non-tzdata files and the posix/right databases, if -+ * present. */ -+static int index_filter(const struct dirent *ent) -+{ -+ return strcmp(ent->d_name, ".") != 0 -+ && strcmp(ent->d_name, "..") != 0 -+ && strcmp(ent->d_name, "posix") != 0 -+ && strcmp(ent->d_name, "posixrules") != 0 -+ && strcmp(ent->d_name, "right") != 0 -+ && strstr(ent->d_name, ".list") == NULL -+ && strstr(ent->d_name, ".tab") == NULL; -+} -+ -+static int sysdbcmp(const void *first, const void *second) -+{ -+ const timelib_tzdb_index_entry *alpha = first, *beta = second; -+ -+ return timelib_strcasecmp(alpha->id, beta->id); -+} -+ -+ -+/* Create the zone identifier index by trawling the filesystem. */ -+static void create_zone_index(timelib_tzdb *db) -+{ -+ size_t dirstack_size, dirstack_top; -+ size_t index_size, index_next; -+ timelib_tzdb_index_entry *db_index; -+ char **dirstack; -+ -+ /* LIFO stack to hold directory entries to scan; each slot is a -+ * directory name relative to the zoneinfo prefix. */ -+ dirstack_size = 32; -+ dirstack = malloc(dirstack_size * sizeof *dirstack); -+ dirstack_top = 1; -+ dirstack[0] = strdup(""); -+ -+ /* Index array. */ -+ index_size = 64; -+ db_index = malloc(index_size * sizeof *db_index); -+ index_next = 0; -+ -+ do { -+ struct dirent **ents; -+ char name[PATH_MAX], *top; -+ int count; -+ -+ /* Pop the top stack entry, and iterate through its contents. */ -+ top = dirstack[--dirstack_top]; -+ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top); -+ -+ count = php_scandir(name, &ents, index_filter, php_alphasort); -+ -+ while (count > 0) { -+ struct stat st; -+ const char *leaf = ents[count - 1]->d_name; -+ -+ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s", -+ top, leaf); -+ -+ if (strlen(name) && stat(name, &st) == 0) { -+ /* Name, relative to the zoneinfo prefix. */ -+ const char *root = top; -+ -+ if (root[0] == '/') root++; -+ -+ snprintf(name, sizeof name, "%s%s%s", root, -+ *root ? "/": "", leaf); -+ -+ if (S_ISDIR(st.st_mode)) { -+ if (dirstack_top == dirstack_size) { -+ dirstack_size *= 2; -+ dirstack = realloc(dirstack, -+ dirstack_size * sizeof *dirstack); -+ } -+ dirstack[dirstack_top++] = strdup(name); -+ } -+ else { -+ if (index_next == index_size) { -+ index_size *= 2; -+ db_index = realloc(db_index, -+ index_size * sizeof *db_index); -+ } -+ -+ db_index[index_next++].id = strdup(name); -+ } -+ } -+ -+ free(ents[--count]); -+ } -+ -+ if (count != -1) free(ents); -+ free(top); -+ } while (dirstack_top); -+ -+ qsort(db_index, index_next, sizeof *db_index, sysdbcmp); -+ -+ db->index = db_index; -+ db->index_size = index_next; -+ -+ free(dirstack); -+} -+ -+#define FAKE_HEADER "1234\0??\1??" -+#define FAKE_UTC_POS (7 - 4) -+ -+/* Create a fake data segment for database 'sysdb'. */ -+static void fake_data_segment(timelib_tzdb *sysdb, -+ struct location_info **info) -+{ -+ size_t n; -+ char *data, *p; -+ -+ data = malloc(3 * sysdb->index_size + 7); -+ -+ p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1); -+ -+ for (n = 0; n < sysdb->index_size; n++) { -+ const struct location_info *li; -+ timelib_tzdb_index_entry *ent; -+ -+ ent = (timelib_tzdb_index_entry *)&sysdb->index[n]; -+ -+ /* Lookup the timezone name in the hash table. */ -+ if (strcmp(ent->id, "UTC") == 0) { -+ ent->pos = FAKE_UTC_POS; -+ continue; -+ } -+ -+ li = find_zone_info(info, ent->id); -+ if (li) { -+ /* If found, append the BC byte and the -+ * country code; set the position for this -+ * section of timezone data. */ -+ ent->pos = (p - data) - 4; -+ *p++ = '\1'; -+ *p++ = li->code[0]; -+ *p++ = li->code[1]; -+ } -+ else { -+ /* If not found, the timezone data can -+ * point at the header. */ -+ ent->pos = 0; -+ } -+ } -+ -+ sysdb->data = (unsigned char *)data; -+} -+ -+/* Returns true if the passed-in stat structure describes a -+ * probably-valid timezone file. */ -+static int is_valid_tzfile(const struct stat *st, int fd) -+{ -+ if (fd) { -+ char buf[20]; -+ if (read(fd, buf, 20)!=20) { -+ return 0; -+ } -+ lseek(fd, SEEK_SET, 0); -+ if (memcmp(buf, "TZif", 4)) { -+ return 0; -+ } -+ } -+ return S_ISREG(st->st_mode) && st->st_size > 20; -+} -+ -+/* To allow timezone names to be used case-insensitively, find the -+ * canonical name for this timezone, if possible. */ -+static const char *canonical_tzname(const char *timezone) -+{ -+ if (timezonedb_system) { -+ timelib_tzdb_index_entry *ent, lookup; -+ -+ lookup.id = (char *)timezone; -+ -+ ent = bsearch(&lookup, timezonedb_system->index, -+ timezonedb_system->index_size, sizeof lookup, -+ sysdbcmp); -+ if (ent) { -+ return ent->id; -+ } -+ } -+ -+ return timezone; -+} -+ -+/* Return the mmap()ed tzfile if found, else NULL. On success, the -+ * length of the mapped data is placed in *length. */ -+static char *map_tzfile(const char *timezone, size_t *length) -+{ -+ char fname[PATH_MAX]; -+ struct stat st; -+ char *p; -+ int fd; -+ -+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { -+ return NULL; -+ } -+ -+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone)); -+ -+ fd = open(fname, O_RDONLY); -+ if (fd == -1) { -+ return NULL; -+ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st, fd)) { -+ close(fd); -+ return NULL; -+ } -+ -+ *length = st.st_size; -+ p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0); -+ close(fd); -+ -+ return p != MAP_FAILED ? p : NULL; -+} -+ -+#endif -+ -+static int inmem_seek_to_tz_position(const unsigned char **tzf, const char *timezone, const timelib_tzdb *tzdb) - { - int left = 0, right = tzdb->index_size - 1; - -@@ -444,9 +884,48 @@ static int seek_to_tz_position(const uns - return 0; - } - -+static int seek_to_tz_position(const unsigned char **tzf, const char *timezone, -+ char **map, size_t *maplen, -+ const timelib_tzdb *tzdb) -+{ -+#ifdef HAVE_SYSTEM_TZDATA -+ if (tzdb == timezonedb_system) { -+ char *orig; -+ -+ orig = map_tzfile(timezone, maplen); -+ if (orig == NULL) { -+ return 0; -+ } -+ -+ (*tzf) = (unsigned char *)orig; -+ *map = orig; -+ return 1; -+ } -+ else -+#endif -+ { -+ return inmem_seek_to_tz_position(tzf, timezone, tzdb); -+ } -+} -+ - const timelib_tzdb *timelib_builtin_db(void) - { -+#ifdef HAVE_SYSTEM_TZDATA -+ if (timezonedb_system == NULL) { -+ timelib_tzdb *tmp = malloc(sizeof *tmp); -+ -+ tmp->version = "0.system"; -+ tmp->data = NULL; -+ create_zone_index(tmp); -+ system_location_table = create_location_table(); -+ fake_data_segment(tmp, system_location_table); -+ timezonedb_system = tmp; -+ } -+ -+ return timezonedb_system; -+#else - return &timezonedb_builtin; -+#endif - } - - const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count) -@@ -458,7 +937,30 @@ const timelib_tzdb_index_entry *timelib_ - int timelib_timezone_id_is_valid(const char *timezone, const timelib_tzdb *tzdb) - { - const unsigned char *tzf; -- return (seek_to_tz_position(&tzf, timezone, tzdb)); -+ -+#ifdef HAVE_SYSTEM_TZDATA -+ if (tzdb == timezonedb_system) { -+ char fname[PATH_MAX]; -+ struct stat st; -+ -+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { -+ return 0; -+ } -+ -+ if (system_location_table) { -+ if (find_zone_info(system_location_table, timezone) != NULL) { -+ /* found in cache */ -+ return 1; -+ } -+ } -+ -+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone)); -+ -+ return stat(fname, &st) == 0 && is_valid_tzfile(&st, 0); -+ } -+#endif -+ -+ return (inmem_seek_to_tz_position(&tzf, timezone, tzdb)); - } - - static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz) -@@ -500,12 +1002,14 @@ static timelib_tzinfo* timelib_tzinfo_ct - timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code) - { - const unsigned char *tzf; -+ char *memmap = NULL; -+ size_t maplen; - timelib_tzinfo *tmp; - int version; - int transitions_result, types_result; - unsigned int type; /* TIMELIB_TZINFO_PHP or TIMELIB_TZINFO_ZONEINFO */ - -- if (seek_to_tz_position(&tzf, timezone, tzdb)) { -+ if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) { - tmp = timelib_tzinfo_ctor(timezone); - - version = read_preamble(&tzf, tmp, &type); -@@ -540,11 +1044,36 @@ timelib_tzinfo *timelib_parse_tzfile(con - } - skip_posix_string(&tzf, tmp); - -+#ifdef HAVE_SYSTEM_TZDATA -+ if (memmap) { -+ const struct location_info *li; -+ -+ /* TZif-style - grok the location info from the system database, -+ * if possible. */ -+ -+ if ((li = find_zone_info(system_location_table, timezone)) != NULL) { -+ tmp->location.comments = timelib_strdup(li->comment); -+ strncpy(tmp->location.country_code, li->code, 2); -+ tmp->location.longitude = li->longitude; -+ tmp->location.latitude = li->latitude; -+ tmp->bc = 1; -+ } -+ else { -+ set_default_location_and_comments(&tzf, tmp); -+ } -+ -+ /* Now done with the mmap segment - discard it. */ -+ munmap(memmap, maplen); -+ } else { -+#endif - if (type == TIMELIB_TZINFO_PHP) { - read_location(&tzf, tmp); - } else { - set_default_location_and_comments(&tzf, tmp); - } -+#ifdef HAVE_SYSTEM_TZDATA -+ } -+#endif - } else { - *error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE; - tmp = NULL; diff --git a/php-8.0.6-deprecated.patch b/php-8.0.6-deprecated.patch deleted file mode 100644 index 1e6b93b..0000000 --- a/php-8.0.6-deprecated.patch +++ /dev/null @@ -1,400 +0,0 @@ -From 4dc8b3c0efaae25b08c8f59b068f17c97c59d0ae Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Wed, 5 May 2021 15:41:00 +0200 -Subject: [PATCH] get rid of inet_aton and inet_ntoa use inet_ntop iand - inet_pton where available standardize buffer size - ---- - ext/sockets/sockaddr_conv.c | 4 ++++ - ext/sockets/sockets.c | 48 +++++++++++++++++++++++++------------ - ext/standard/dns.c | 16 ++++++++++++- - main/network.c | 20 ++++++++++++++-- - 4 files changed, 70 insertions(+), 18 deletions(-) - -diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c -index 57996612d2d7e..65c8418fb3a6f 100644 ---- a/ext/sockets/sockaddr_conv.c -+++ b/ext/sockets/sockaddr_conv.c -@@ -87,7 +87,11 @@ int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_soc - struct in_addr tmp; - struct hostent *host_entry; - -+#ifdef HAVE_INET_PTON -+ if (inet_pton(AF_INET, string, &tmp)) { -+#else - if (inet_aton(string, &tmp)) { -+#endif - sin->sin_addr.s_addr = tmp.s_addr; - } else { - if (strlen(string) > MAXFQDNLEN || ! (host_entry = php_network_gethostbyname(string))) { -diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c -index 16ad3e8013a4c..85c938d1b97b1 100644 ---- a/ext/sockets/sockets.c -+++ b/ext/sockets/sockets.c -@@ -220,8 +220,10 @@ zend_module_entry sockets_module_entry = { - ZEND_GET_MODULE(sockets) - #endif - -+#ifndef HAVE_INET_NTOP - /* inet_ntop should be used instead of inet_ntoa */ - int inet_ntoa_lock = 0; -+#endif - - static int php_open_listen_sock(php_socket *sock, int port, int backlog) /* {{{ */ - { -@@ -1082,10 +1084,12 @@ PHP_FUNCTION(socket_getsockname) - struct sockaddr_in *sin; - #if HAVE_IPV6 - struct sockaddr_in6 *sin6; -- char addr6[INET6_ADDRSTRLEN+1]; -+#endif -+#ifdef HAVE_INET_NTOP -+ char addrbuf[INET6_ADDRSTRLEN]; - #endif - struct sockaddr_un *s_un; -- char *addr_string; -+ const char *addr_string; - socklen_t salen = sizeof(php_sockaddr_storage); - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Oz|z", &arg1, socket_ce, &addr, &port) == FAILURE) { -@@ -1106,8 +1110,8 @@ PHP_FUNCTION(socket_getsockname) - #if HAVE_IPV6 - case AF_INET6: - sin6 = (struct sockaddr_in6 *) sa; -- inet_ntop(AF_INET6, &sin6->sin6_addr, addr6, INET6_ADDRSTRLEN); -- ZEND_TRY_ASSIGN_REF_STRING(addr, addr6); -+ inet_ntop(AF_INET6, &sin6->sin6_addr, addrbuf, sizeof(addrbuf)); -+ ZEND_TRY_ASSIGN_REF_STRING(addr, addrbuf); - - if (port != NULL) { - ZEND_TRY_ASSIGN_REF_LONG(port, htons(sin6->sin6_port)); -@@ -1117,11 +1121,14 @@ PHP_FUNCTION(socket_getsockname) - #endif - case AF_INET: - sin = (struct sockaddr_in *) sa; -+#ifdef HAVE_INET_NTOP -+ addr_string = inet_ntop(AF_INET, &sin->sin_addr, addrbuf, sizeof(addrbuf)); -+#else - while (inet_ntoa_lock == 1); - inet_ntoa_lock = 1; - addr_string = inet_ntoa(sin->sin_addr); - inet_ntoa_lock = 0; -- -+#endif - ZEND_TRY_ASSIGN_REF_STRING(addr, addr_string); - - if (port != NULL) { -@@ -1154,10 +1161,12 @@ PHP_FUNCTION(socket_getpeername) - struct sockaddr_in *sin; - #if HAVE_IPV6 - struct sockaddr_in6 *sin6; -- char addr6[INET6_ADDRSTRLEN+1]; -+#endif -+#ifdef HAVE_INET_NTOP -+ char addrbuf[INET6_ADDRSTRLEN]; - #endif - struct sockaddr_un *s_un; -- char *addr_string; -+ const char *addr_string; - socklen_t salen = sizeof(php_sockaddr_storage); - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Oz|z", &arg1, socket_ce, &arg2, &arg3) == FAILURE) { -@@ -1178,9 +1187,9 @@ PHP_FUNCTION(socket_getpeername) - #if HAVE_IPV6 - case AF_INET6: - sin6 = (struct sockaddr_in6 *) sa; -- inet_ntop(AF_INET6, &sin6->sin6_addr, addr6, INET6_ADDRSTRLEN); -+ inet_ntop(AF_INET6, &sin6->sin6_addr, addrbuf, sizeof(addrbuf)); - -- ZEND_TRY_ASSIGN_REF_STRING(arg2, addr6); -+ ZEND_TRY_ASSIGN_REF_STRING(arg2, addrbuf); - - if (arg3 != NULL) { - ZEND_TRY_ASSIGN_REF_LONG(arg3, htons(sin6->sin6_port)); -@@ -1191,11 +1200,14 @@ PHP_FUNCTION(socket_getpeername) - #endif - case AF_INET: - sin = (struct sockaddr_in *) sa; -+#ifdef HAVE_INET_NTOP -+ addr_string = inet_ntop(AF_INET, &sin->sin_addr, addrbuf, sizeof(addrbuf)); -+#else - while (inet_ntoa_lock == 1); - inet_ntoa_lock = 1; - addr_string = inet_ntoa(sin->sin_addr); - inet_ntoa_lock = 0; -- -+#endif - ZEND_TRY_ASSIGN_REF_STRING(arg2, addr_string); - - if (arg3 != NULL) { -@@ -1527,12 +1539,14 @@ PHP_FUNCTION(socket_recvfrom) - struct sockaddr_in sin; - #if HAVE_IPV6 - struct sockaddr_in6 sin6; -- char addr6[INET6_ADDRSTRLEN]; -+#endif -+#ifdef HAVE_INET_NTOP -+ char addrbuf[INET6_ADDRSTRLEN]; - #endif - socklen_t slen; - int retval; - zend_long arg3, arg4; -- char *address; -+ const char *address; - zend_string *recv_buf; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ozllz|z", &arg1, socket_ce, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { -@@ -1590,7 +1604,11 @@ PHP_FUNCTION(socket_recvfrom) - ZSTR_LEN(recv_buf) = retval; - ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0'; - -+#ifdef HAVE_INET_NTOP -+ address = inet_ntop(AF_INET, &sin.sin_addr, addrbuf, sizeof(addrbuf)); -+#else - address = inet_ntoa(sin.sin_addr); -+#endif - - ZEND_TRY_ASSIGN_REF_NEW_STR(arg2, recv_buf); - ZEND_TRY_ASSIGN_REF_STRING(arg5, address ? address : "0.0.0.0"); -@@ -1617,11 +1635,11 @@ PHP_FUNCTION(socket_recvfrom) - ZSTR_LEN(recv_buf) = retval; - ZSTR_VAL(recv_buf)[ZSTR_LEN(recv_buf)] = '\0'; - -- memset(addr6, 0, INET6_ADDRSTRLEN); -- inet_ntop(AF_INET6, &sin6.sin6_addr, addr6, INET6_ADDRSTRLEN); -+ memset(addrbuf, 0, INET6_ADDRSTRLEN); -+ inet_ntop(AF_INET6, &sin6.sin6_addr, addrbuf, sizeof(addrbuf)); - - ZEND_TRY_ASSIGN_REF_NEW_STR(arg2, recv_buf); -- ZEND_TRY_ASSIGN_REF_STRING(arg5, addr6[0] ? addr6 : "::"); -+ ZEND_TRY_ASSIGN_REF_STRING(arg5, addrbuf[0] ? addrbuf : "::"); - ZEND_TRY_ASSIGN_REF_LONG(arg6, ntohs(sin6.sin6_port)); - break; - #endif -diff --git a/ext/standard/dns.c b/ext/standard/dns.c -index 41b98424edb60..6efdbbe894b46 100644 ---- a/ext/standard/dns.c -+++ b/ext/standard/dns.c -@@ -228,6 +228,9 @@ PHP_FUNCTION(gethostbynamel) - struct hostent *hp; - struct in_addr in; - int i; -+#ifdef HAVE_INET_NTOP -+ char addr4[INET_ADDRSTRLEN]; -+#endif - - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_PATH(hostname, hostname_len) -@@ -255,7 +258,11 @@ PHP_FUNCTION(gethostbynamel) - } - - in = *h_addr_entry; -+#ifdef HAVE_INET_NTOP -+ add_next_index_string(return_value, inet_ntop(AF_INET, &in, addr4, INET_ADDRSTRLEN)); -+#else - add_next_index_string(return_value, inet_ntoa(in)); -+#endif - } - } - /* }}} */ -@@ -266,7 +273,10 @@ static zend_string *php_gethostbyname(char *name) - struct hostent *hp; - struct in_addr *h_addr_0; /* Don't call this h_addr, it's a macro! */ - struct in_addr in; -- char *address; -+#ifdef HAVE_INET_NTOP -+ char addr4[INET_ADDRSTRLEN]; -+#endif -+ const char *address; - - hp = php_network_gethostbyname(name); - if (!hp) { -@@ -281,7 +291,11 @@ static zend_string *php_gethostbyname(char *name) - - memcpy(&in.s_addr, h_addr_0, sizeof(in.s_addr)); - -+#ifdef HAVE_INET_NTOP -+ address = inet_ntop(AF_INET, &in, addr4, INET_ADDRSTRLEN); -+#else - address = inet_ntoa(in); -+#endif - return zend_string_init(address, strlen(address), 0); - } - /* }}} */ -diff --git a/main/network.c b/main/network.c -index 2c504952b2dd1..7f2f714ec42df 100644 ---- a/main/network.c -+++ b/main/network.c -@@ -236,8 +236,12 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka - } while ((sai = sai->ai_next) != NULL); - - freeaddrinfo(res); -+#else -+#ifdef HAVE_INET_PTON -+ if (!inet_pton(AF_INET, host, &in)) { - #else - if (!inet_aton(host, &in)) { -+#endif - if(strlen(host) > MAXFQDNLEN) { - host_info = NULL; - errno = E2BIG; -@@ -555,7 +559,11 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, zend_lo - goto out; - } - #endif -+#ifdef HAVE_INET_PTON -+ if (inet_pton(AF_INET, tmp, &in4->sin_addr) > 0) { -+#else - if (inet_aton(tmp, &in4->sin_addr) > 0) { -+#endif - in4->sin_port = htons(port); - in4->sin_family = AF_INET; - *sl = sizeof(struct sockaddr_in); -@@ -617,15 +625,19 @@ PHPAPI void php_network_populate_name_from_sockaddr( - } - - if (textaddr) { --#if HAVE_IPV6 && HAVE_INET_NTOP -+#ifdef HAVE_INET_NTOP - char abuf[256]; - #endif -- char *buf = NULL; -+ const char *buf = NULL; - - switch (sa->sa_family) { - case AF_INET: - /* generally not thread safe, but it *is* thread safe under win32 */ -+#ifdef HAVE_INET_NTOP -+ buf = inet_ntop(AF_INET, &((struct sockaddr_in*)sa)->sin_addr, (char *)&abuf, sizeof(abuf)); -+#else - buf = inet_ntoa(((struct sockaddr_in*)sa)->sin_addr); -+#endif - if (buf) { - *textaddr = strpprintf(0, "%s:%d", - buf, ntohs(((struct sockaddr_in*)sa)->sin_port)); -@@ -862,7 +874,11 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short - - in4->sin_family = sa->sa_family; - in4->sin_port = htons(bindport); -+#ifdef HAVE_INET_PTON -+ if (!inet_pton(AF_INET, bindto, &in4->sin_addr)) { -+#else - if (!inet_aton(bindto, &in4->sin_addr)) { -+#endif - php_error_docref(NULL, E_WARNING, "Invalid IP Address: %s", bindto); - goto skip_bind; - } -From e5b6f43ec7813392d83ea586b7902e0396a1f792 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Thu, 6 May 2021 14:21:29 +0200 -Subject: [PATCH] get rid of inet_addr usage - ---- - main/fastcgi.c | 4 ++++ - sapi/litespeed/lsapilib.c | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/main/fastcgi.c b/main/fastcgi.c -index 071f69d3a7f0..c936d42405de 100644 ---- a/main/fastcgi.c -+++ b/main/fastcgi.c -@@ -688,8 +688,12 @@ int fcgi_listen(const char *path, int backlog) - if (!*host || !strncmp(host, "*", sizeof("*")-1)) { - sa.sa_inet.sin_addr.s_addr = htonl(INADDR_ANY); - } else { -+#ifdef HAVE_INET_PTON -+ if (!inet_pton(AF_INET, host, &sa.sa_inet.sin_addr)) { -+#else - sa.sa_inet.sin_addr.s_addr = inet_addr(host); - if (sa.sa_inet.sin_addr.s_addr == INADDR_NONE) { -+#endif - struct hostent *hep; - - if(strlen(host) > MAXFQDNLEN) { -diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c -index a72b5dc1b988..305f3326a682 100644 ---- a/sapi/litespeed/lsapilib.c -+++ b/sapi/litespeed/lsapilib.c -@@ -2672,8 +2672,12 @@ int LSAPI_ParseSockAddr( const char * pBind, struct sockaddr * pAddr ) - ((struct sockaddr_in *)pAddr)->sin_addr.s_addr = htonl( INADDR_LOOPBACK ); - else - { -+#ifdef HAVE_INET_PTON -+ if (!inet_pton(AF_INET, p, &((struct sockaddr_in *)pAddr)->sin_addr)) -+#else - ((struct sockaddr_in *)pAddr)->sin_addr.s_addr = inet_addr( p ); - if ( ((struct sockaddr_in *)pAddr)->sin_addr.s_addr == INADDR_BROADCAST) -+#endif - { - doAddrInfo = 1; - } -From 99d67d121acd4c324738509679d23acaf759d065 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Thu, 6 May 2021 16:35:48 +0200 -Subject: [PATCH] use getnameinfo instead of gethostbyaddr - ---- - ext/standard/dns.c | 34 ++++++++++++++++++++++------------ - 1 file changed, 22 insertions(+), 12 deletions(-) - -diff --git a/ext/standard/dns.c b/ext/standard/dns.c -index edd9a4549f5c..540c777faaba 100644 ---- a/ext/standard/dns.c -+++ b/ext/standard/dns.c -@@ -169,20 +169,30 @@ PHP_FUNCTION(gethostbyaddr) - static zend_string *php_gethostbyaddr(char *ip) - { - #if HAVE_IPV6 && HAVE_INET_PTON -- struct in6_addr addr6; --#endif -- struct in_addr addr; -- struct hostent *hp; -+ struct sockaddr_in sa4; -+ struct sockaddr_in6 sa6; -+ char out[NI_MAXHOST]; - --#if HAVE_IPV6 && HAVE_INET_PTON -- if (inet_pton(AF_INET6, ip, &addr6)) { -- hp = gethostbyaddr((char *) &addr6, sizeof(addr6), AF_INET6); -- } else if (inet_pton(AF_INET, ip, &addr)) { -- hp = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET); -- } else { -- return NULL; -+ if (inet_pton(AF_INET6, ip, &sa6.sin6_addr)) { -+ sa6.sin6_family = AF_INET6; -+ -+ if (getnameinfo((struct sockaddr *)&sa6, sizeof(sa6), out, sizeof(out), NULL, 0, NI_NAMEREQD) < 0) { -+ return zend_string_init(ip, strlen(ip), 0); -+ } -+ return zend_string_init(out, strlen(out), 0); -+ } else if (inet_pton(AF_INET, ip, &sa4.sin_addr)) { -+ sa4.sin_family = AF_INET; -+ -+ if (getnameinfo((struct sockaddr *)&sa4, sizeof(sa4), out, sizeof(out), NULL, 0, NI_NAMEREQD) < 0) { -+ return zend_string_init(ip, strlen(ip), 0); -+ } -+ return zend_string_init(out, strlen(out), 0); - } -+ return NULL; /* not a valid IP */ - #else -+ struct in_addr addr; -+ struct hostent *hp; -+ - addr.s_addr = inet_addr(ip); - - if (addr.s_addr == -1) { -@@ -190,13 +200,13 @@ static zend_string *php_gethostbyaddr(char *ip) - } - - hp = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET); --#endif - - if (!hp || hp->h_name == NULL || hp->h_name[0] == '\0') { - return zend_string_init(ip, strlen(ip), 0); - } - - return zend_string_init(hp->h_name, strlen(hp->h_name), 0); -+#endif - } - /* }}} */ - diff --git a/php-8.1.0-phpinfo.patch b/php-8.1.0-phpinfo.patch new file mode 100644 index 0000000..d19b2f4 --- /dev/null +++ b/php-8.1.0-phpinfo.patch @@ -0,0 +1,44 @@ + +Drop "Configure Command" from phpinfo as it doesn't +provide any useful information. +The available extensions are not related to this command. + +Replace full GCC name by gcc in php -v output + + +diff -up ./ext/standard/info.c.phpinfo ./ext/standard/info.c +--- ./ext/standard/info.c.phpinfo 2020-07-21 10:49:31.000000000 +0200 ++++ ./ext/standard/info.c 2020-07-21 11:41:56.295633523 +0200 +@@ -805,9 +805,6 @@ PHPAPI ZEND_COLD void php_print_info(int + #ifdef PHP_BUILD_ARCH + php_info_print_table_row(2, "Architecture", PHP_BUILD_ARCH); + #endif +-#ifdef CONFIGURE_COMMAND +- php_info_print_table_row(2, "Configure Command", CONFIGURE_COMMAND ); +-#endif + + if (sapi_module.pretty_name) { + php_info_print_table_row(2, "Server API", sapi_module.pretty_name ); +diff -up ./ext/standard/tests/general_functions/phpinfo.phpt.phpinfo ./ext/standard/tests/general_functions/phpinfo.phpt +--- ./ext/standard/tests/general_functions/phpinfo.phpt.phpinfo 2020-07-21 10:49:31.000000000 +0200 ++++ ./ext/standard/tests/general_functions/phpinfo.phpt 2020-07-21 11:41:56.296633522 +0200 +@@ -17,7 +17,6 @@ PHP Version => %s + + System => %s + Build Date => %s%a +-Configure Command => %s + Server API => Command Line Interface + Virtual Directory Support => %s + Configuration File (php.ini) Path => %s +diff -up ./sapi/cli/php_cli.c.phpinfo ./sapi/cli/php_cli.c +--- ./sapi/cli/php_cli.c.phpinfo 2020-07-21 11:43:38.812475300 +0200 ++++ ./sapi/cli/php_cli.c 2020-07-21 11:43:45.783464540 +0200 +@@ -645,7 +645,7 @@ static int do_cli(int argc, char **argv) + "NTS" + #endif + #ifdef PHP_BUILD_COMPILER +- " " PHP_BUILD_COMPILER ++ " gcc" + #endif + #ifdef PHP_BUILD_ARCH + " " PHP_BUILD_ARCH diff --git a/php-8.1.0-systzdata-v20.patch b/php-8.1.0-systzdata-v20.patch new file mode 100644 index 0000000..a2e3827 --- /dev/null +++ b/php-8.1.0-systzdata-v20.patch @@ -0,0 +1,661 @@ +# License: MIT +# http://opensource.org/licenses/MIT + +Add support for use of the system timezone database, rather +than embedding a copy. Discussed upstream but was not desired. + +History: +r20: adapt for timelib 2021.03 (in 8.1.0) +r19: adapt for timelib 2020.02 (in 8.0.0beta2) +r18: adapt for autotool change in 7.3.3RC1 +r17: adapt for timelib 2018.01 (in 7.3.2RC1) +r16: adapt for timelib 2017.06 (in 7.2.3RC1) +r15: adapt for timelib 2017.05beta7 (in 7.2.0RC1) +r14: improve check for valid tz file +r13: adapt for upstream changes to use PHP allocator +r12: adapt for upstream changes for new zic +r11: use canonical names to avoid more case sensitivity issues + round lat/long from zone.tab towards zero per builtin db +r10: make timezone case insensitive +r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold) +r8: fix compile error without --with-system-tzdata configured +r7: improve check for valid timezone id to exclude directories +r6: fix fd leak in r5, fix country code/BC flag use in + timezone_identifiers_list() using system db, + fix use of PECL timezonedb to override system db, +r5: reverts addition of "System/Localtime" fake tzname. + updated for 5.3.0, parses zone.tab to pick up mapping between + timezone name, country code and long/lat coords +r4: added "System/Localtime" tzname which uses /etc/localtime +r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert) +r2: add filesystem trawl to set up name alias index +r1: initial revision + +diff -up php-8.0.0beta3/ext/date/config0.m4.systzdata php-8.0.0beta3/ext/date/config0.m4 +--- php-8.0.0beta3/ext/date/config0.m4.systzdata 2020-09-01 19:13:26.000000000 +0200 ++++ php-8.0.0beta3/ext/date/config0.m4 2020-09-02 08:07:51.039979873 +0200 +@@ -4,6 +4,19 @@ AC_CHECK_HEADERS([io.h]) + dnl Check for strtoll, atoll + AC_CHECK_FUNCS(strtoll atoll) + ++PHP_ARG_WITH(system-tzdata, for use of system timezone data, ++[ --with-system-tzdata[=DIR] to specify use of system timezone data], ++no, no) ++ ++if test "$PHP_SYSTEM_TZDATA" != "no"; then ++ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used]) ++ ++ if test "$PHP_SYSTEM_TZDATA" != "yes"; then ++ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA", ++ [Define for location of system timezone data]) ++ fi ++fi ++ + PHP_DATE_CFLAGS="-Wno-implicit-fallthrough -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1" + timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c + lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c" +diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/date/lib/parse_tz.c +--- php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata 2020-09-01 19:13:26.000000000 +0200 ++++ php-8.0.0beta3/ext/date/lib/parse_tz.c 2020-09-02 08:07:51.039979873 +0200 +@@ -26,9 +26,22 @@ + #include "timelib.h" + #include "timelib_private.h" + ++#ifdef HAVE_SYSTEM_TZDATA ++#include ++#include ++#include ++#include ++#include ++ ++#include "php_scandir.h" ++ ++#else + #define TIMELIB_SUPPORTS_V2DATA + #define TIMELIB_SUPPORT_SLIM_FILE + #include "timezonedb.h" ++#endif ++ ++#include + + #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) + # if defined(__LITTLE_ENDIAN__) +@@ -95,6 +108,11 @@ static int read_php_preamble(const unsig + { + uint32_t version; + ++ if (memcmp(*tzf, "TZif", 4) == 0) { ++ *tzf += 20; ++ return 0; ++ } ++ + /* read ID */ + version = (*tzf)[3] - '0'; + *tzf += 4; +@@ -566,7 +584,429 @@ void timelib_dump_tzinfo(timelib_tzinfo + } + } + +-static int seek_to_tz_position(const unsigned char **tzf, const char *timezone, const timelib_tzdb *tzdb) ++#ifdef HAVE_SYSTEM_TZDATA ++ ++#ifdef HAVE_SYSTEM_TZDATA_PREFIX ++#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX ++#else ++#define ZONEINFO_PREFIX "/usr/share/zoneinfo" ++#endif ++ ++/* System timezone database pointer. */ ++static const timelib_tzdb *timezonedb_system; ++ ++/* Hash table entry for the cache of the zone.tab mapping table. */ ++struct location_info { ++ char code[2]; ++ double latitude, longitude; ++ char name[64]; ++ char *comment; ++ struct location_info *next; ++}; ++ ++/* Cache of zone.tab. */ ++static struct location_info **system_location_table; ++ ++/* Size of the zone.tab hash table; a random-ish prime big enough to ++ * prevent too many collisions. */ ++#define LOCINFO_HASH_SIZE (1021) ++ ++/* Compute a case insensitive hash of str */ ++static uint32_t tz_hash(const char *str) ++{ ++ const unsigned char *p = (const unsigned char *)str; ++ uint32_t hash = 5381; ++ int c; ++ ++ while ((c = tolower(*p++)) != '\0') { ++ hash = (hash << 5) ^ hash ^ c; ++ } ++ ++ return hash % LOCINFO_HASH_SIZE; ++} ++ ++/* Parse an ISO-6709 date as used in zone.tab. Returns end of the ++ * parsed string on success, or NULL on parse error. On success, ++ * writes the parsed number to *result. */ ++static char *parse_iso6709(char *p, double *result) ++{ ++ double v, sign; ++ char *pend; ++ size_t len; ++ ++ if (*p == '+') ++ sign = 1.0; ++ else if (*p == '-') ++ sign = -1.0; ++ else ++ return NULL; ++ ++ p++; ++ for (pend = p; *pend >= '0' && *pend <= '9'; pend++) ++ ;; ++ ++ /* Annoying encoding used by zone.tab has no decimal point, so use ++ * the length to determine the format: ++ * ++ * 4 = DDMM ++ * 5 = DDDMM ++ * 6 = DDMMSS ++ * 7 = DDDMMSS ++ */ ++ len = pend - p; ++ if (len < 4 || len > 7) { ++ return NULL; ++ } ++ ++ /* p => [D]DD */ ++ v = (p[0] - '0') * 10.0 + (p[1] - '0'); ++ p += 2; ++ if (len == 5 || len == 7) ++ v = v * 10.0 + (*p++ - '0'); ++ /* p => MM[SS] */ ++ v += (10.0 * (p[0] - '0') ++ + p[1] - '0') / 60.0; ++ p += 2; ++ /* p => [SS] */ ++ if (len > 5) { ++ v += (10.0 * (p[0] - '0') ++ + p[1] - '0') / 3600.0; ++ p += 2; ++ } ++ ++ /* Round to five decimal place, not because it's a good idea, ++ * but, because the builtin data uses rounded data, so, match ++ * that. */ ++ *result = trunc(v * sign * 100000.0) / 100000.0; ++ ++ return p; ++} ++ ++/* This function parses the zone.tab file to build up the mapping of ++ * timezone to country code and geographic location, and returns a ++ * hash table. The hash table is indexed by the function: ++ * ++ * tz_hash(timezone-name) ++ */ ++static struct location_info **create_location_table(void) ++{ ++ struct location_info **li, *i; ++ char zone_tab[PATH_MAX]; ++ char line[512]; ++ FILE *fp; ++ ++ strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab); ++ ++ fp = fopen(zone_tab, "r"); ++ if (!fp) { ++ return NULL; ++ } ++ ++ li = calloc(LOCINFO_HASH_SIZE, sizeof *li); ++ ++ while (fgets(line, sizeof line, fp)) { ++ char *p = line, *code, *name, *comment; ++ uint32_t hash; ++ double latitude, longitude; ++ ++ while (isspace(*p)) ++ p++; ++ ++ if (*p == '#' || *p == '\0' || *p == '\n') ++ continue; ++ ++ if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t') ++ continue; ++ ++ /* code => AA */ ++ code = p; ++ p[2] = 0; ++ p += 3; ++ ++ /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */ ++ p = parse_iso6709(p, &latitude); ++ if (!p) { ++ continue; ++ } ++ p = parse_iso6709(p, &longitude); ++ if (!p) { ++ continue; ++ } ++ ++ if (!p || *p != '\t') { ++ continue; ++ } ++ ++ /* name = string */ ++ name = ++p; ++ while (*p != '\t' && *p && *p != '\n') ++ p++; ++ ++ *p++ = '\0'; ++ ++ /* comment = string */ ++ comment = p; ++ while (*p != '\t' && *p && *p != '\n') ++ p++; ++ ++ if (*p == '\n' || *p == '\t') ++ *p = '\0'; ++ ++ hash = tz_hash(name); ++ i = malloc(sizeof *i); ++ memcpy(i->code, code, 2); ++ strncpy(i->name, name, sizeof i->name); ++ i->comment = strdup(comment); ++ i->longitude = longitude; ++ i->latitude = latitude; ++ i->next = li[hash]; ++ li[hash] = i; ++ /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */ ++ } ++ ++ fclose(fp); ++ ++ return li; ++} ++ ++/* Return location info from hash table, using given timezone name. ++ * Returns NULL if the name could not be found. */ ++const struct location_info *find_zone_info(struct location_info **li, ++ const char *name) ++{ ++ uint32_t hash = tz_hash(name); ++ const struct location_info *l; ++ ++ if (!li) { ++ return NULL; ++ } ++ ++ for (l = li[hash]; l; l = l->next) { ++ if (timelib_strcasecmp(l->name, name) == 0) ++ return l; ++ } ++ ++ return NULL; ++} ++ ++/* Filter out some non-tzdata files and the posix/right databases, if ++ * present. */ ++static int index_filter(const struct dirent *ent) ++{ ++ return strcmp(ent->d_name, ".") != 0 ++ && strcmp(ent->d_name, "..") != 0 ++ && strcmp(ent->d_name, "posix") != 0 ++ && strcmp(ent->d_name, "posixrules") != 0 ++ && strcmp(ent->d_name, "right") != 0 ++ && strstr(ent->d_name, ".list") == NULL ++ && strstr(ent->d_name, ".tab") == NULL; ++} ++ ++static int sysdbcmp(const void *first, const void *second) ++{ ++ const timelib_tzdb_index_entry *alpha = first, *beta = second; ++ ++ return timelib_strcasecmp(alpha->id, beta->id); ++} ++ ++ ++/* Create the zone identifier index by trawling the filesystem. */ ++static void create_zone_index(timelib_tzdb *db) ++{ ++ size_t dirstack_size, dirstack_top; ++ size_t index_size, index_next; ++ timelib_tzdb_index_entry *db_index; ++ char **dirstack; ++ ++ /* LIFO stack to hold directory entries to scan; each slot is a ++ * directory name relative to the zoneinfo prefix. */ ++ dirstack_size = 32; ++ dirstack = malloc(dirstack_size * sizeof *dirstack); ++ dirstack_top = 1; ++ dirstack[0] = strdup(""); ++ ++ /* Index array. */ ++ index_size = 64; ++ db_index = malloc(index_size * sizeof *db_index); ++ index_next = 0; ++ ++ do { ++ struct dirent **ents; ++ char name[PATH_MAX], *top; ++ int count; ++ ++ /* Pop the top stack entry, and iterate through its contents. */ ++ top = dirstack[--dirstack_top]; ++ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top); ++ ++ count = php_scandir(name, &ents, index_filter, php_alphasort); ++ ++ while (count > 0) { ++ struct stat st; ++ const char *leaf = ents[count - 1]->d_name; ++ ++ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s", ++ top, leaf); ++ ++ if (strlen(name) && stat(name, &st) == 0) { ++ /* Name, relative to the zoneinfo prefix. */ ++ const char *root = top; ++ ++ if (root[0] == '/') root++; ++ ++ snprintf(name, sizeof name, "%s%s%s", root, ++ *root ? "/": "", leaf); ++ ++ if (S_ISDIR(st.st_mode)) { ++ if (dirstack_top == dirstack_size) { ++ dirstack_size *= 2; ++ dirstack = realloc(dirstack, ++ dirstack_size * sizeof *dirstack); ++ } ++ dirstack[dirstack_top++] = strdup(name); ++ } ++ else { ++ if (index_next == index_size) { ++ index_size *= 2; ++ db_index = realloc(db_index, ++ index_size * sizeof *db_index); ++ } ++ ++ db_index[index_next++].id = strdup(name); ++ } ++ } ++ ++ free(ents[--count]); ++ } ++ ++ if (count != -1) free(ents); ++ free(top); ++ } while (dirstack_top); ++ ++ qsort(db_index, index_next, sizeof *db_index, sysdbcmp); ++ ++ db->index = db_index; ++ db->index_size = index_next; ++ ++ free(dirstack); ++} ++ ++#define FAKE_HEADER "1234\0??\1??" ++#define FAKE_UTC_POS (7 - 4) ++ ++/* Create a fake data segment for database 'sysdb'. */ ++static void fake_data_segment(timelib_tzdb *sysdb, ++ struct location_info **info) ++{ ++ size_t n; ++ char *data, *p; ++ ++ data = malloc(3 * sysdb->index_size + 7); ++ ++ p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1); ++ ++ for (n = 0; n < sysdb->index_size; n++) { ++ const struct location_info *li; ++ timelib_tzdb_index_entry *ent; ++ ++ ent = (timelib_tzdb_index_entry *)&sysdb->index[n]; ++ ++ /* Lookup the timezone name in the hash table. */ ++ if (strcmp(ent->id, "UTC") == 0) { ++ ent->pos = FAKE_UTC_POS; ++ continue; ++ } ++ ++ li = find_zone_info(info, ent->id); ++ if (li) { ++ /* If found, append the BC byte and the ++ * country code; set the position for this ++ * section of timezone data. */ ++ ent->pos = (p - data) - 4; ++ *p++ = '\1'; ++ *p++ = li->code[0]; ++ *p++ = li->code[1]; ++ } ++ else { ++ /* If not found, the timezone data can ++ * point at the header. */ ++ ent->pos = 0; ++ } ++ } ++ ++ sysdb->data = (unsigned char *)data; ++} ++ ++/* Returns true if the passed-in stat structure describes a ++ * probably-valid timezone file. */ ++static int is_valid_tzfile(const struct stat *st, int fd) ++{ ++ if (fd) { ++ char buf[20]; ++ if (read(fd, buf, 20)!=20) { ++ return 0; ++ } ++ lseek(fd, SEEK_SET, 0); ++ if (memcmp(buf, "TZif", 4)) { ++ return 0; ++ } ++ } ++ return S_ISREG(st->st_mode) && st->st_size > 20; ++} ++ ++/* To allow timezone names to be used case-insensitively, find the ++ * canonical name for this timezone, if possible. */ ++static const char *canonical_tzname(const char *timezone) ++{ ++ if (timezonedb_system) { ++ timelib_tzdb_index_entry *ent, lookup; ++ ++ lookup.id = (char *)timezone; ++ ++ ent = bsearch(&lookup, timezonedb_system->index, ++ timezonedb_system->index_size, sizeof lookup, ++ sysdbcmp); ++ if (ent) { ++ return ent->id; ++ } ++ } ++ ++ return timezone; ++} ++ ++/* Return the mmap()ed tzfile if found, else NULL. On success, the ++ * length of the mapped data is placed in *length. */ ++static char *map_tzfile(const char *timezone, size_t *length) ++{ ++ char fname[PATH_MAX]; ++ struct stat st; ++ char *p; ++ int fd; ++ ++ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { ++ return NULL; ++ } ++ ++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone)); ++ ++ fd = open(fname, O_RDONLY); ++ if (fd == -1) { ++ return NULL; ++ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st, fd)) { ++ close(fd); ++ return NULL; ++ } ++ ++ *length = st.st_size; ++ p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0); ++ close(fd); ++ ++ return p != MAP_FAILED ? p : NULL; ++} ++ ++#endif ++ ++static int inmem_seek_to_tz_position(const unsigned char **tzf, const char *timezone, const timelib_tzdb *tzdb) + { + int left = 0, right = tzdb->index_size - 1; + +@@ -592,9 +1032,48 @@ static int seek_to_tz_position(const uns + return 0; + } + ++static int seek_to_tz_position(const unsigned char **tzf, const char *timezone, ++ char **map, size_t *maplen, ++ const timelib_tzdb *tzdb) ++{ ++#ifdef HAVE_SYSTEM_TZDATA ++ if (tzdb == timezonedb_system) { ++ char *orig; ++ ++ orig = map_tzfile(timezone, maplen); ++ if (orig == NULL) { ++ return 0; ++ } ++ ++ (*tzf) = (unsigned char *)orig; ++ *map = orig; ++ return 1; ++ } ++ else ++#endif ++ { ++ return inmem_seek_to_tz_position(tzf, timezone, tzdb); ++ } ++} ++ + const timelib_tzdb *timelib_builtin_db(void) + { ++#ifdef HAVE_SYSTEM_TZDATA ++ if (timezonedb_system == NULL) { ++ timelib_tzdb *tmp = malloc(sizeof *tmp); ++ ++ tmp->version = "0.system"; ++ tmp->data = NULL; ++ create_zone_index(tmp); ++ system_location_table = create_location_table(); ++ fake_data_segment(tmp, system_location_table); ++ timezonedb_system = tmp; ++ } ++ ++ return timezonedb_system; ++#else + return &timezonedb_builtin; ++#endif + } + + const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count) +@@ -606,7 +1085,30 @@ const timelib_tzdb_index_entry *timelib_ + int timelib_timezone_id_is_valid(const char *timezone, const timelib_tzdb *tzdb) + { + const unsigned char *tzf; +- return (seek_to_tz_position(&tzf, timezone, tzdb)); ++ ++#ifdef HAVE_SYSTEM_TZDATA ++ if (tzdb == timezonedb_system) { ++ char fname[PATH_MAX]; ++ struct stat st; ++ ++ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) { ++ return 0; ++ } ++ ++ if (system_location_table) { ++ if (find_zone_info(system_location_table, timezone) != NULL) { ++ /* found in cache */ ++ return 1; ++ } ++ } ++ ++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone)); ++ ++ return stat(fname, &st) == 0 && is_valid_tzfile(&st, 0); ++ } ++#endif ++ ++ return (inmem_seek_to_tz_position(&tzf, timezone, tzdb)); + } + + static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz) +@@ -651,6 +1153,8 @@ static timelib_tzinfo* timelib_tzinfo_ct + timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code) + { + const unsigned char *tzf; ++ char *memmap = NULL; ++ size_t maplen; + timelib_tzinfo *tmp; + int version; + int transitions_result, types_result; +@@ -658,7 +1162,7 @@ timelib_tzinfo *timelib_parse_tzfile(con + + *error_code = TIMELIB_ERROR_NO_ERROR; + +- if (seek_to_tz_position(&tzf, timezone, tzdb)) { ++ if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) { + tmp = timelib_tzinfo_ctor(timezone); + + version = read_preamble(&tzf, tmp, &type); +@@ -699,11 +1203,36 @@ timelib_tzinfo *timelib_parse_tzfile(con + return NULL; + } + ++#ifdef HAVE_SYSTEM_TZDATA ++ if (memmap) { ++ const struct location_info *li; ++ ++ /* TZif-style - grok the location info from the system database, ++ * if possible. */ ++ ++ if ((li = find_zone_info(system_location_table, timezone)) != NULL) { ++ tmp->location.comments = timelib_strdup(li->comment); ++ strncpy(tmp->location.country_code, li->code, 2); ++ tmp->location.longitude = li->longitude; ++ tmp->location.latitude = li->latitude; ++ tmp->bc = 1; ++ } ++ else { ++ set_default_location_and_comments(&tzf, tmp); ++ } ++ ++ /* Now done with the mmap segment - discard it. */ ++ munmap(memmap, maplen); ++ } else { ++#endif + if (type == TIMELIB_TZINFO_PHP) { + read_location(&tzf, tmp); + } else { + set_default_location_and_comments(&tzf, tmp); + } ++#ifdef HAVE_SYSTEM_TZDATA ++ } ++#endif + } else { + *error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE; + tmp = NULL; diff --git a/php.conf b/php.conf new file mode 100644 index 0000000..0639c0a --- /dev/null +++ b/php.conf @@ -0,0 +1,52 @@ +# +# The following lines prevent .user.ini files from being viewed by Web clients. +# + + + Require all denied + + + Order allow,deny + Deny from all + Satisfy All + + + +# +# Allow php to handle Multiviews +# +AddType text/html .php + +# +# Add index.php to the list of files that will be served as directory +# indexes. +# +DirectoryIndex index.php + +# mod_php options + + # + # Cause the PHP interpreter to handle files with a .php extension. + # + + SetHandler application/x-httpd-php + + + # + # Uncomment the following lines to allow PHP to pretty-print .phps + # files as PHP source code: + # + # + # SetHandler application/x-httpd-php-source + # + + # + # Apache specific PHP configuration options + # those can be override in each configured vhost + # + php_value session.save_handler "files" + php_value session.save_path "/var/lib/php/session" + php_value soap.wsdl_cache_dir "/var/lib/php/wsdlcache" + + #php_value opcache.file_cache "/var/lib/php/opcache" + diff --git a/php.conf2 b/php.conf2 new file mode 100644 index 0000000..cdd7640 --- /dev/null +++ b/php.conf2 @@ -0,0 +1,14 @@ + +# Redirect to local php-fpm if mod_php (5, 7 or 8) is not available + + + + # Enable http authorization headers + SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1 + + + SetHandler "proxy:fcgi://127.0.0.1:9000" + + + + diff --git a/php.spec b/php.spec index d9a2aa5..14cff68 100644 --- a/php.spec +++ b/php.spec @@ -1,4 +1,4 @@ -# remirepo spec file for php80-php +# remirepo spec file for php81-php # with SCL and backport stuff, adapted from # # Fedora spec file for php @@ -23,8 +23,8 @@ %endif # API/ABI check -%global apiver 20200930 -%global zendver 20200930 +%global apiver 20201009 +%global zendver 20201009 %global pdover 20170320 # Extension version %global oci8ver 3.0.1 @@ -33,7 +33,7 @@ %global _hardened_build 1 # version used for php embedded library soname -%global embed_version 8.0 +%global embed_version 8.1 # Ugly hack. Harcoded values to avoid relocation. %global _httpd_mmn %(cat %{_root_includedir}/httpd/.mmn 2>/dev/null || echo 0) @@ -93,14 +93,14 @@ %global with_httpd2410 0 %endif -%global gh_commit 18f2ef094af2b1ad961408fbaf222b9448df2750 +%global gh_commit 953143d8503cd0e861f02d7262f2304dbb58ec5c %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -#global gh_date 20200615 +%global gh_date 20210604 %global gh_owner php %global gh_project php-src -%global upver 8.0.7 -#global rcver RC1 -#global lower RC1 +%global upver 8.1.0 +#global rcver dev +%global lower DEV Summary: PHP scripting language for creating dynamic web sites Name: %{?scl_prefix}php @@ -145,8 +145,6 @@ Patch1: php-7.4.0-httpd.patch Patch5: php-7.2.0-includedir.patch Patch6: php-8.0.0-embed.patch Patch8: php-7.4.0-libdb.patch -# get rid of deprecated functions from 8.1 -Patch9: php-8.0.6-deprecated.patch # RHEL backports Patch10: php-7.0.7-curl.patch @@ -154,14 +152,14 @@ Patch10: php-7.0.7-curl.patch # Use system nikic/php-parser Patch41: php-8.0.0-parser.patch # use system tzdata -Patch42: php-8.0.0-systzdata-v19.patch +Patch42: php-8.1.0-systzdata-v20.patch # See http://bugs.php.net/53436 Patch43: php-7.4.0-phpize.patch # Use -lldap_r for OpenLDAP Patch45: php-7.4.0-ldap_r.patch # drop "Configure command" from phpinfo output # and only use gcc (instead of full version) -Patch47: php-8.0.0-phpinfo.patch +Patch47: php-8.1.0-phpinfo.patch # RC Patch Patch91: php-7.2.0-oci8conf.patch @@ -188,7 +186,7 @@ BuildRequires: httpd-filesystem %endif BuildRequires: %{?dtsprefix}libstdc++-devel # no pkgconfig to avoid compat-openssl10 -BuildRequires: openssl-devel >= 1.0.1 +BuildRequires: openssl-devel >= 1.0.2 BuildRequires: pkgconfig(sqlite3) >= 3.7.4 BuildRequires: pkgconfig(zlib) >= 1.2.0.4 BuildRequires: smtpdaemon @@ -393,7 +391,7 @@ Requires: libtool # see "php-config --libs" Requires: krb5-devel%{?_isa} Requires: libxml2-devel%{?_isa} -Requires: openssl-devel%{?_isa} >= 1.0.1 +Requires: openssl-devel%{?_isa} >= 1.0.2 %if %{with libpcre} Requires: pcre2-devel%{?_isa} >= 10.30 %endif @@ -431,7 +429,7 @@ License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} BuildRequires: pkgconfig(krb5) BuildRequires: pkgconfig(krb5-gssapi) -BuildRequires: openssl-devel >= 1.0.1 +BuildRequires: openssl-devel >= 1.0.2 BuildRequires: libc-client-devel %description imap @@ -447,7 +445,7 @@ License: PHP Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} BuildRequires: pkgconfig(libsasl2) BuildRequires: openldap-devel -BuildRequires: openssl-devel >= 1.0.1 +BuildRequires: openssl-devel >= 1.0.2 %description ldap The %{?scl_prefix}php-ldap package adds Lightweight Directory Access Protocol (LDAP) @@ -501,7 +499,7 @@ Requires: %{?scl_prefix}php-pdo%{?_isa} = %{version}-%{release} Provides: %{?scl_prefix}php_database Provides: %{?scl_prefix}php-pdo_pgsql, %{?scl_prefix}php-pdo_pgsql%{?_isa} BuildRequires: krb5-devel -BuildRequires: openssl-devel >= 1.0.1 +BuildRequires: openssl-devel >= 1.0.2 BuildRequires: postgresql-devel %description pgsql @@ -915,7 +913,6 @@ in pure PHP. %patch5 -p1 -b .includedir %patch6 -p1 -b .embed %patch8 -p1 -b .libdb -%patch9 -p1 -b .deprecated %if 0%{?rhel} %patch10 -p1 -b .curltls %endif @@ -1807,6 +1804,9 @@ fi %changelog +* Fri Jun 4 2021 Remi Collet - 8.1.0~DEV.20210604-1 +- update to 8.1.0-dev + * Wed Jun 2 2021 Remi Collet - 8.0.7-1 - Update to 8.0.7 - http://www.php.net/releases/8_0_7.php -- cgit