代码拉取完成,页面将自动刷新
# API/ABI check
%global apiver 20250925
%global zendver 20250925
%global pdover 20240423
# Extension version
%global fileinfover 1.0.5
%global zipver 1.22.7
# Adds -z now to the linker flags
%global _hardened_build 1
# version used for php embedded library soname
%global embed_version 8.5
%global mysql_sock %(mysql_config --socket 2>/dev/null || echo /var/lib/mysql/mysql.sock)
# Build for LiteSpeed Web Server (LSAPI), you can disable using --without lsws
%bcond_without lsws
# Regression tests take a long time, you can skip them using --without tests
%bcond_without tests
# Use the arch-specific mysql_config binary to avoid mismatch with the
# arch detection heuristic used by bindir/mysql_config.
%global mysql_config %{_libdir}/mysql/mysql_config
%bcond_without libpcre
%bcond_with qdbm
%bcond_without libxcrypt
# Build firebird extensions, you can disable using --without firebird
%bcond_with firebird
# Build ZTS extension or only NTS using --without zts
%bcond_with zts
# Debug build, using --with debug
%bcond_with debug
# build with system tzdata
%bcond_without tzdata
# /usr/sbin/a# build with libiodbc instead of unixODBC
%bcond_with iodbc
# OpenSSL2 with argon2
%bcond_without openssl32
# /usr/sbin/apsx with httpd < 2.4 and defined as /usr/bin/apxs with httpd >= 2.4
%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo 0-0)}}
%{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}}
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
%{!?_httpd_moddir: %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}}
%{!?_httpd_contentdir: %{expand: %%global _httpd_contentdir /var/www}}
%bcond_without dtrace
%bcond_without libgd
%bcond_with zip
%global upver 8.5.1
Summary: PHP scripting language for creating dynamic web sites
Name: php
Version: %{upver}
Release: 1
# All files licensed under PHP version 3.01, except
# Zend is licensed under Zend
# TSRM is licensed under BSD
# main/snprintf.c, main/spprintf.c and main/rfc1867.c are ASL 1.0
# ext/date/lib is MIT
# Zend/zend_sort is NCSA
# Zend/asm is Boost
License: PHP-3.01 AND Zend-2.0 AND BSD-2-Clause AND MIT AND Apache-1.0 AND NCSA AND BSL-1.0
URL: https://www.php.net/
Source0: https://www.php.net/distributions/php-%{upver}%{?rcver}.tar.xz
Source1: php.conf
Source2: php.ini
Source3: macros.php
Source4: php-fpm.conf
Source5: php-fpm-www.conf
Source6: php-fpm.service
Source7: php-fpm.logrotate
Source9: php.modconf
Source12: php-fpm.wants
Source13: nginx-fpm.conf
Source14: nginx-php.conf
# Configuration files for some extensions
Source50: 10-opcache.ini
Source51: opcache-default.blacklist
Source53: 20-ffi.ini
# Sources for composer-generators
# https://git.remirepo.net/cgit/rpms/composer-generators.git
Source1001: composer.prov
Source1002: composer.attr
# Source for downstream rpm dependencies
Source2001: phpapi.attr
# Build fixes
Patch1: php-8.4.0-httpd.patch
Patch5: php-8.5.0-includedir.patch
Patch6: php-8.5.0-embed.patch
Patch8: php-8.4.0-libdb.patch
Patch9: 0001-add-sw_64-support.patch
# Functional changes
# Use system nikic/php-parser
Patch41: php-8.5.0-parser.patch
# use system tzdata
Patch42: php-8.5.0-systzdata-v24.patch
# See http://bugs.php.net/53436
# + display PHP version backported from 8.4
Patch43: php-8.4.0-phpize.patch
# Use -lldap_r for OpenLDAP
Patch45: php-8.5.0-ldap_r.patch
# Ignore unsupported "threads" option on password_hash
Patch46: php-8.0.7-argon2.patch
# drop "Configure command" from phpinfo output
# and only use gcc (instead of full version)
Patch47: php-8.4.0-phpinfo.patch
# RC Patch
# Upstream fixes (100+)
# Security fixes (200+)
# Fixes for tests (300+)
# Factory is droped from system tzdata
Patch300: php-7.4.0-datetests.patch
# WIP
BuildRequires: bzip2-devel
BuildRequires: pkgconfig(libcurl) >= 7.61.0
BuildRequires: httpd-devel >= 2.0.46
BuildRequires: pam-devel
# to ensure we are using httpd with filesystem feature (see #1081453)
BuildRequires: httpd-filesystem
# to ensure we are using nginx with filesystem feature (see #1142298)
BuildRequires: nginx-filesystem
BuildRequires: libstdc++-devel
%if %{with openssl32}
BuildRequires: pkgconfig(openssl) >= 3.2
%else
# no pkgconfig to avoid compat-openssl10/compat-openssl11
BuildRequires: openssl-devel >= 1.0.2
%endif
BuildRequires: pkgconfig(sqlite3) >= 3.7.4
BuildRequires: pkgconfig(zlib) >= 1.2.11
BuildRequires: smtpdaemon
BuildRequires: pkgconfig(libedit)
%if %{with libpcre}
BuildRequires: pkgconfig(libpcre2-8) >= 10.30
%else
Provides: bundled(pcre2) = 10.40
%endif
BuildRequires: pkgconfig(capstone) >= 3.0
%if %{with libxcrypt}
BuildRequires: pkgconfig(libxcrypt)
%endif
BuildRequires: bzip2
BuildRequires: perl
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: make
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: libtool-ltdl-devel
%if %{with dtrace}
BuildRequires: systemtap-sdt-devel
%endif
Provides: bundled(liburiparser) = 0.9.10
# used for tests
BuildRequires: /usr/bin/ps
%if %{with tzdata}
BuildRequires: tzdata
%endif
%if %{with zts}
Obsoletes: php-zts < 5.3.7
Provides: php-zts = %{version}-%{release}
Provides: php-zts%{?_isa} = %{version}-%{release}
%endif
Requires: httpd-mmn = %{_httpd_mmn}
Provides: mod_php = %{version}-%{release}
Requires: php-common%{?_isa} = %{version}-%{release}
# To ensure correct /var/lib/php/session ownership:
Requires(pre): httpd-filesystem
# php engine for Apache httpd webserver
Provides: php(httpd)
# For backwards-compatibility, require php-cli for the time being:
Recommends: php-cli%{?_isa} = %{version}-%{release}
# httpd have threaded MPM by default
Recommends: php-fpm%{?_isa} = %{version}-%{release}
# as "php" is now mostly a meta-package, commonly used extensions
Recommends: php-mbstring%{?_isa} = %{version}-%{release}
Recommends: php-pdo%{?_isa} = %{version}-%{release}
Recommends: php-sodium%{?_isa} = %{version}-%{release}
Recommends: php-xml%{?_isa} = %{version}-%{release}
%description
PHP is an HTML-embedded scripting language. PHP attempts to make it
easy for developers to write dynamically generated web pages. PHP also
offers built-in database integration for several commercial and
non-commercial database management systems, so writing a
database-enabled webpage with PHP is fairly simple. The most common
use of PHP coding is probably as a replacement for CGI scripts.
The php package contains the module (often referred to as mod_php)
which adds support for the PHP language to Apache HTTP Server.
%package cli
Summary: Command-line interface for PHP
# sapi/cli/ps_title.c is PostgreSQL
License: PHP-3.01 AND Zend-2.0 AND BSD-2-Clause AND MIT AND Apache-1.0 AND NCSA AND PostgreSQL
Requires: php-common%{?_isa} = %{version}-%{release}
Provides: php-cgi = %{version}-%{release}, php-cgi%{?_isa} = %{version}-%{release}
Provides: php-pcntl, php-pcntl%{?_isa}
Provides: php-readline, php-readline%{?_isa}
%description cli
The php-cli package contains the command-line interface
executing PHP scripts, /usr/bin/php, and the CGI interface.
%package dbg
Summary: The interactive PHP debugger
Requires: php-common%{?_isa} = %{version}-%{release}
%description dbg
The php-dbg package contains the interactive PHP debugger.
%package fpm
Summary: PHP FastCGI Process Manager
BuildRequires: libacl-devel
BuildRequires: pkgconfig(libsystemd) >= 209
BuildRequires: pkgconfig(libselinux)
Requires: php-common%{?_isa} = %{version}-%{release}
%{?systemd_requires}
# This is actually needed for the %%triggerun script but Requires(triggerun)
# is not valid. We can use %%post because this particular %%triggerun script
# should fire just after this package is installed.
Requires(post): systemd-sysv
# To ensure correct /var/lib/php/session ownership:
Requires(pre): httpd-filesystem
# For php.conf in /etc/httpd/conf.d
# and version 2.4.10 for proxy support in SetHandler
Requires: httpd-filesystem >= 2.4.10
# php engine for Apache httpd webserver
Provides: php(httpd)
# for /etc/nginx ownership
# Temporarily not mandatory to allow nginx for nginx repo
Recommends: nginx-filesystem
%description fpm
PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI
implementation with some additional features useful for sites of
any size, especially busier sites.
%if %{with lsws}
%package litespeed
Summary: LiteSpeed Web Server PHP support
Requires: php-common%{?_isa} = %{version}-%{release}
%description litespeed
The php-litespeed package provides the %{_bindir}/lsphp command
used by the LiteSpeed Web Server (LSAPI enabled PHP).
%endif
%package common
Summary: Common files for PHP
# All files licensed under PHP version 3.01, except
# fileinfo is licensed under PHP version 3.0
# regex, libmagic are licensed under BSD
License: PHP-3.01 AND BSD-2-Clause
%if %{with tzdata}
Requires: tzdata
%endif
%if %{with libpcre}
Requires: pcre2%{?_isa} >= %{installed_version_of pcre2}
%endif
# ABI/API check - Arch specific
Provides: php(api) = %{apiver}-%{__isa_bits}
Provides: php(zend-abi) = %{zendver}-%{__isa_bits}
Provides: php(language) = %{version}, php(language)%{?_isa} = %{version}
# Provides for all builtin/shared modules:
Provides: php-bz2, php-bz2%{?_isa}
Provides: php-calendar, php-calendar%{?_isa}
Provides: php-core = %{version}, php-core%{?_isa} = %{version}
Provides: php-ctype, php-ctype%{?_isa}
Provides: php-curl, php-curl%{?_isa}
Provides: php-date, php-date%{?_isa}
Provides: bundled(timelib)
Provides: php-exif, php-exif%{?_isa}
Provides: php-fileinfo, php-fileinfo%{?_isa}
Provides: bundled(libmagic) = 5.43
Provides: php-filter, php-filter%{?_isa}
Provides: php-ftp, php-ftp%{?_isa}
Provides: php-gettext, php-gettext%{?_isa}
Provides: php-hash, php-hash%{?_isa}
Provides: php-lexbor, php-lexbor%{?_isa}
Provides: php-iconv, php-iconv%{?_isa}
Obsoletes: php-json < 8
Obsoletes: php-pecl-json < 8
Obsoletes: php-pecl-jsonc < 8
Provides: php-json = %{upver}, php-json%{?_isa} = %{upver}
Provides: php-libxml, php-libxml%{?_isa}
Obsoletes: php-opcache < 8.5.0
Provides: php-opcache = %{upver}, php-opcache%{?_isa} = %{upver}
Provides: php-openssl, php-openssl%{?_isa}
Provides: php-phar, php-phar%{?_isa}
Provides: php-pcre, php-pcre%{?_isa}
Provides: php-random, php-random%{?_isa}
Provides: php-reflection, php-reflection%{?_isa}
Provides: php-session, php-session%{?_isa}
Provides: php-sockets, php-sockets%{?_isa}
Provides: php-spl, php-spl%{?_isa}
Provides: php-standard = %{version}, php-standard%{?_isa} = %{version}
Provides: php-tokenizer, php-tokenizer%{?_isa}
Provides: php-uri, php-uri%{?_isa}
Provides: php-zlib, php-zlib%{?_isa}
Obsoletes: php-pecl-phar < 1.2.4
Obsoletes: php-pecl-Fileinfo < 1.0.5
Provides: php-pecl-Fileinfo = %{fileinfover}, php-pecl-Fileinfo%{?_isa} = %{fileinfover}
Provides: php-pecl(Fileinfo) = %{fileinfover}, php-pecl(Fileinfo)%{?_isa} = %{fileinfover}
Obsoletes: php-mhash < 5.3.0
Requires: (libxml2%{?_isa} >= %{installed_version_of libxml2} if libxml2)
Requires: (openssl-libs%{?_isa} >= %{installed_version_of openssl-libs} if openssl-libs)
%description common
The php-common package contains files used by both the php
package and the php-cli package.
%package devel
Summary: Files needed for building PHP extensions
Requires: php-cli%{?_isa} = %{version}-%{release}
# always needed to build extension
Requires: autoconf
Requires: automake
Requires: make
Requires: gcc
Requires: gcc-c++
Requires: libtool
# see "php-config --libs"
Requires: krb5-devel%{?_isa}
Requires: libxml2-devel%{?_isa}
Requires: openssl-devel%{?_isa} >= 1.0.2
%if %{with libpcre}
Requires: pcre2-devel%{?_isa}
%endif
Requires: zlib-devel%{?_isa}
Obsoletes: php-pecl-json-devel < %{version}
Obsoletes: php-pecl-jsonc-devel < %{version}
%if %{with zts}
Provides: php-zts-devel = %{version}-%{release}
Provides: php-zts-devel%{?_isa} = %{version}-%{release}
%endif
Recommends: php-nikic-php-parser5 >= 5.0.0
%description devel
The php-devel package contains the files needed for building PHP
extensions. If you need to compile your own PHP extensions, you will
need to install this package.
%package ldap
Summary: A module for PHP applications that use LDAP
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}
BuildRequires: pkgconfig(libsasl2)
BuildRequires: openldap-devel
BuildRequires: openssl-devel >= 1.0.2
%description ldap
The php-ldap adds Lightweight Directory Access Protocol (LDAP)
support to PHP. LDAP is a set of protocols for accessing directory
services over the Internet. PHP is an HTML-embedded scripting
language.
%package pdo
Summary: A database access abstraction module for PHP applications
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}
# ABI/API check - Arch specific
Provides: php-pdo-abi = %{pdover}-%{__isa_bits}
Provides: php(pdo-abi) = %{pdover}-%{__isa_bits}
Provides: php-sqlite3, php-sqlite3%{?_isa}
Provides: php-pdo_sqlite, php-pdo_sqlite%{?_isa}
%description pdo
The php-pdo package contains a dynamic shared object that will add
a database access abstraction layer to PHP. This module provides
a common interface for accessing MySQL, PostgreSQL or other
databases.
%package mysqlnd
Summary: A module for PHP applications that use MySQL databases
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-pdo%{?_isa} = %{version}-%{release}
Provides: php_database
Provides: php-mysqli = %{version}-%{release}
Provides: php-mysqli%{?_isa} = %{version}-%{release}
Provides: php-pdo_mysql, php-pdo_mysql%{?_isa}
Obsoletes: php-mysql < %{version}-%{release}
%description mysqlnd
The php-mysqlnd package contains a dynamic shared object that will add
MySQL database support to PHP. MySQL is an object-relational database
management system. PHP is an HTML-embeddable scripting language. If
you need MySQL support for PHP applications, you will need to install
this package and the php package.
This package use the MySQL Native Driver
%package pgsql
Summary: A PostgreSQL database module for PHP
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-pdo%{?_isa} = %{version}-%{release}
Provides: php_database
Provides: php-pdo_pgsql, php-pdo_pgsql%{?_isa}
BuildRequires: krb5-devel
BuildRequires: openssl-devel >= 1.0.2
BuildRequires: libpq-devel
%description pgsql
The php-pgsql package add PostgreSQL database support to PHP.
PostgreSQL is an object-relational database management
system that supports almost all SQL constructs. PHP is an
HTML-embedded scripting language. If you need back-end support for
PostgreSQL, you should install this package in addition to the main
php package.
%package process
Summary: Modules for PHP script using system process interfaces
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}
Provides: php-posix, php-posix%{?_isa}
Provides: php-shmop, php-shmop%{?_isa}
Provides: php-sysvsem, php-sysvsem%{?_isa}
Provides: php-sysvshm, php-sysvshm%{?_isa}
Provides: php-sysvmsg, php-sysvmsg%{?_isa}
%description process
The php-process package contains dynamic shared objects which add
support to PHP using system interfaces for inter-process
communication.
%package odbc
Summary: A module for PHP applications that use ODBC databases
# All files licensed under PHP version 3.01, except
# pdo_odbc is licensed under PHP version 3.0
License: PHP-3.01
Requires: php-pdo%{?_isa} = %{version}-%{release}
Provides: php_database
Provides: php-pdo_odbc, php-pdo_odbc%{?_isa}
%if %{with iodbc}
BuildRequires: pkgconfig(libiodbc)
%else
BuildRequires: pkgconfig(odbc)
%endif
%description odbc
The php-odbc package contains a dynamic shared object that will add
database support through ODBC to PHP. ODBC is an open specification
which provides a consistent API for developers to use for accessing
data sources (which are often, but not always, databases). PHP is an
HTML-embeddable scripting language. If you need ODBC support for PHP
applications, you will need to install this package and the php
package.
%if %{with iodbc}
Package build using libiodbc (instead of unixODBC).
%endif
%package soap
Summary: A module for PHP applications that use the SOAP protocol
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}
BuildRequires: pkgconfig(libxml-2.0)
%description soap
The php-soap package contains a dynamic shared object that will add
support to PHP for using the SOAP web services protocol.
%if %{with firebird}
%package pdo-firebird
Summary: PDO driver for Interbase/Firebird databases
# All files licensed under PHP version 3.01
License: PHP-3.01
BuildRequires: firebird-devel
Requires: php-pdo%{?_isa} = %{version}-%{release}
Provides: php_database
Provides: php-pdo_firebird, php-pdo_firebird%{?_isa}
%description pdo-firebird
The php-pdo-firebird package contains the PDO driver for
Interbase/Firebird databases.
%endif
%package snmp
Summary: A module for PHP applications that query SNMP-managed devices
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}, net-snmp
BuildRequires: net-snmp-devel
%description snmp
The php-snmp package contains a dynamic shared object that will add
support for querying SNMP devices to PHP. PHP is an HTML-embeddable
scripting language. If you need SNMP support for PHP applications, you
will need to install this package and the php package.
%package xml
Summary: A module for PHP applications which use XML
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}
Provides: php-dom, php-dom%{?_isa}
Provides: php-domxml, php-domxml%{?_isa}
Provides: php-simplexml, php-simplexml%{?_isa}
Provides: php-xmlreader, php-xmlreader%{?_isa}
Provides: php-xmlwriter, php-xmlwriter%{?_isa}
Provides: php-xsl, php-xsl%{?_isa}
BuildRequires: pkgconfig(libxslt) >= 1.1
BuildRequires: pkgconfig(libexslt)
BuildRequires: pkgconfig(libxml-2.0) >= 2.9.4
%description xml
The php-xml package contains dynamic shared objects which add support
to PHP for manipulating XML documents using the DOM tree,
and performing XSL transformations on XML documents.
%package mbstring
Summary: A module for PHP applications which need multi-byte string handling
# All files licensed under PHP version 3.01, except
# libmbfl is licensed under LGPLv2
# onigurama is licensed under BSD
# ucgendat is licensed under OpenLDAP
License: PHP-3.01 AND LGPL-2.1-only AND OLDAP-2.8
BuildRequires: oniguruma-devel
Provides: bundled(libmbfl) = 1.3.2
Requires: php-common%{?_isa} = %{version}-%{release}
%description mbstring
The php-mbstring package contains a dynamic shared object that will add
support for multi-byte string handling to PHP.
%package gd
Summary: A module for PHP applications for using the gd graphics library
# All files licensed under PHP version 3.01
%if %{with libgd}
License: PHP-3.01
%else
# bundled libgd is licensed under MIT
License: PHP-3.01 and MIT
%endif
Requires: php-common%{?_isa} = %{version}-%{release}
%if %{with libgd}
BuildRequires: pkgconfig(gdlib) >= 2.3.3
%else
# Required to build the bundled GD library
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(xpm)
BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(libavif)
Provides: bundled(gd) = 2.0.35
%endif
%description gd
The php-gd package contains a dynamic shared object that will add
support for using the gd graphics library to PHP.
%package bcmath
Summary: A module for PHP applications for using the bcmath library
# All files licensed under PHP version 3.01, except
# libbcmath is licensed under LGPLv2+
License: PHP-3.01 AND LGPL-2.1-or-later
Requires: php-common%{?_isa} = %{version}-%{release}
Provides: bundled(libbcmath)
%description bcmath
The php-bcmath package contains a dynamic shared object that will add
support for using the bcmath library to PHP.
%package gmp
Summary: A module for PHP applications for using the GNU MP library
# All files licensed under PHP version 3.01
License: PHP-3.01
BuildRequires: gmp-devel >= 4.2
Requires: php-common%{?_isa} = %{version}-%{release}
%description gmp
These functions allow you to work with arbitrary-length integers
using the GNU MP library.
%package dba
Summary: A database abstraction layer module for PHP applications
# All files licensed under PHP version 3.01
License: PHP-3.01
BuildRequires: libdb-devel
BuildRequires: tokyocabinet-devel
BuildRequires: lmdb-devel
%if %{with qdbm}
BuildRequires: qdbm-devel
%endif
Requires: php-common%{?_isa} = %{version}-%{release}
%description dba
The php-dba package contains a dynamic shared object that will add
support for using the DBA database abstraction layer to PHP.
%package tidy
Summary: Standard PHP module provides tidy library support
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}
BuildRequires: libtidy-devel
%description tidy
The php-tidy package contains a dynamic shared object that will add
support for using the tidy library to PHP.
%package pdo-dblib
Summary: PDO driver for Microsoft SQL Server and Sybase databases
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-pdo%{?_isa} = %{version}-%{release}
BuildRequires: freetds-devel >= 0.91
Provides: php-pdo_dblib, php-pdo_dblib%{?_isa}
Obsoletes: php-mssql < %{version}-%{release}
%description pdo-dblib
The php-pdo-dblib package contains a dynamic shared object
that implements the PHP Data Objects (PDO) interface to enable access from
PHP to Microsoft SQL Server and Sybase databases through the FreeTDS library.
%package embedded
Summary: PHP library for embedding in applications
Requires: php-common%{?_isa} = %{version}-%{release}
# doing a real -devel package for just the .so symlink is a bit overkill
Provides: php-embedded-devel = %{version}-%{release}
Provides: php-embedded-devel%{?_isa} = %{version}-%{release}
%description embedded
The php-embedded package contains a library which can be embedded
into applications to provide PHP scripting language support.
%package intl
Summary: Internationalization extension for PHP applications
# All files licensed under PHP version 3.01
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}
BuildRequires: pkgconfig(icu-i18n) >= 74
BuildRequires: pkgconfig(icu-io) >= 74
BuildRequires: pkgconfig(icu-uc) >= 74
%description intl
The php-intl package contains a dynamic shared object that will add
support for using the ICU library to PHP.
%package enchant
Summary: Enchant spelling extension for PHP applications
# All files licensed under PHP version 3.0
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}
BuildRequires: pkgconfig(enchant-2)
%description enchant
The php-enchant package contains a dynamic shared object that will add
support for using the enchant library to PHP.
%if %{with zip}
%package zip
Summary: ZIP archive management extension for PHP
# All files licensed under PHP version 3.0.1
License: PHP-3.01
Requires: php-common%{?_isa} = %{version}-%{release}
Obsoletes: php-pecl-zip < %{zipver}
Provides: php-pecl(zip) = %{zipver}
Provides: php-pecl(zip)%{?_isa} = %{zipver}
Provides: php-pecl-zip = %{zipver}
Provides: php-pecl-zip%{?_isa} = %{zipver}
BuildRequires: pkgconfig(libzip) >= 0.11
%description zip
The php-zip package provides an extension that will add
support for ZIP archive management to PHP.
%endif
%package sodium
Summary: Wrapper for the Sodium cryptographic library
# All files licensed under PHP version 3.0.1
License: PHP-3.01
# Minimal is 1.0.8, 1.0.14 is needed for argon2 password
BuildRequires: pkgconfig(libsodium) >= 1.0.14
Requires: php-common%{?_isa} = %{version}-%{release}
Obsoletes: php-pecl-libsodium2 < 3
Provides: php-pecl(libsodium) = %{version}
Provides: php-pecl(libsodium)%{?_isa} = %{version}
%description sodium
The php-sodium package provides a simple,
low-level PHP extension for the libsodium cryptographic library.
%package ffi
Summary: Foreign Function Interface
# All files licensed under PHP version 3.0.1
License: PHP-3.01
BuildRequires: pkgconfig(libffi)
Requires: php-common%{?_isa} = %{version}-%{release}
%description ffi
FFI is one of the features that made Python and LuaJIT very useful for fast
prototyping. It allows calling C functions and using C data types from pure
scripting language and therefore develop “system code” more productively.
For PHP, FFI opens a way to write PHP extensions and bindings to C libraries
in pure PHP.
%package -n composer-generators
Summary: Tools for composer enabled applications packager
Buildarch: noarch
License: GPL-2.0-or-later
Requires: php-cli
%description -n composer-generators
This package provides RPM generators which are used for
getting provides from composer enabled applications.
* find main project name and provide it
* find bundled libraries and provide them
%package_help
%prep
: Building %{name}-%{version}-%{release}
%if %{with lsws}
: With Litespeed SAPI
%endif
%if %{with firebird}
: With pdo_firebird extension
%endif
%if %{with zip}
: With Zip extension
%endif
%if %{with tests}
: Run Test suite
%endif
%if %{with libgd}
: Use System libgd
%else
: Use Bundled libgd
%endif
%if %{with libpcre}
: Use System libpcre
%else
: Use Bundled libpcre
%endif
%if %{with zts}
: Enable ZTS build
%endif
%if %{with debug}
: Enable Debug build
%endif
%if %{with dtrace}
: Enable Dtrace build
%endif
%autosetup -p1 -n php-%{upver}
# WIP patch
# Prevent %%doc confusion over LICENSE files
cp Zend/LICENSE ZEND_LICENSE
cp Zend/asm/LICENSE BOOST_LICENSE
cp TSRM/LICENSE TSRM_LICENSE
cp sapi/fpm/LICENSE fpm_LICENSE
cp ext/mbstring/libmbfl/LICENSE libmbfl_LICENSE
cp ext/fileinfo/libmagic/LICENSE libmagic_LICENSE
cp ext/bcmath/libbcmath/LICENSE libbcmath_LICENSE
cp ext/date/lib/LICENSE.rst timelib_LICENSE
# Multiple builds for multiple SAPIs
# mod_php (apache2handler) and libphp (embed) can not be built from same tree
mkdir \
build-cgi \
build-apache \
%if %{with zts}
build-ztscli \
%endif
build-fpm
# ----- Manage known as failed test -------
# affected by systzdata patch
%if %{with tzdata}
rm ext/date/tests/timezone_location_get.phpt
rm ext/date/tests/bug80963.phpt
%endif
# too fast builder
rm ext/date/tests/bug73837.phpt
# Should be skipped but fails sometime
rm ext/standard/tests/file/file_get_contents_error001.phpt
# fails sometime
rm ext/sockets/tests/mcast_ipv?_recv.phpt
# slow and erratic result
rm sapi/cli/tests/upload_2G.phpt
# Failing when build with PHP installed
rm ext/opcache/tests/zzz_basic_logging.phpt
# avoid issue when 2 builds run simultaneously (keep 64321 for the SCL)
%ifarch x86_64
sed -e 's/64321/64322/' -i ext/openssl/tests/*.phpt
%else
sed -e 's/64321/64323/' -i ext/openssl/tests/*.phpt
%endif
# Safety check for API version change.
pver=$(sed -n '/#define PHP_VERSION /{s/.* "//;s/".*$//;p}' main/php_version.h)
if test "x${pver}" != "x%{upver}%{?rcver}"; then
: Error: Upstream PHP version is now ${pver}, expecting %{upver}%{?rcver}.
: Update the version/rcver macros and rebuild.
exit 1
fi
vapi=$(sed -n '/#define PHP_API_VERSION/{s/.* //;p}' main/php.h)
if test "x${vapi}" != "x%{apiver}"; then
: Error: Upstream API version is now ${vapi}, expecting %{apiver}.
: Update the apiver macro and rebuild.
exit 1
fi
vzend=$(sed -n '/#define ZEND_MODULE_API_NO/{s/^[^0-9]*//;p;}' Zend/zend_modules.h)
if test "x${vzend}" != "x%{zendver}"; then
: Error: Upstream Zend ABI version is now ${vzend}, expecting %{zendver}.
: Update the zendver macro and rebuild.
exit 1
fi
# Safety check for PDO ABI version change
vpdo=$(sed -n '/#define PDO_DRIVER_API/{s/.*[ ]//;p}' ext/pdo/php_pdo_driver.h)
if test "x${vpdo}" != "x%{pdover}"; then
: Error: Upstream PDO ABI version is now ${vpdo}, expecting %{pdover}.
: Update the pdover macro and rebuild.
exit 1
fi
# Check for some extension version
ver=$(sed -n '/#define PHP_ZIP_VERSION /{s/.* "//;s/".*$//;p}' ext/zip/php_zip.h)
if test "$ver" != "%{zipver}"; then
: Error: Upstream ZIP version is now ${ver}, expecting %{zipver}.
: Update the %{zipver} macro and rebuild.
exit 1
fi
# https://bugs.php.net/63362 - Not needed but installed headers.
# Drop some Windows specific headers to avoid installation,
# before build to ensure they are really not needed.
rm -f TSRM/tsrm_win32.h \
TSRM/tsrm_config.w32.h \
Zend/zend_config.w32.h \
ext/mysqlnd/config-win.h \
ext/standard/winver.h \
main/win32_internal_function_disabled.h \
main/win95nt.h
# Fix some bogus permissions
find . -name \*.[ch] -exec chmod 644 {} \;
chmod 644 README.*
# Some extensions have their own configuration file
cp %{S:50} %{S:51} %{S:53} .
# Regenerated bison files
# to force, rm Zend/zend_{language,ini}_parser.[ch]
if [ ! -f Zend/zend_language_parser.c ]; then
scripts/dev/genfiles
fi
%build
# This package fails to build with LTO due to undefined symbols. LTO
# was disabled in OpenSuSE as well, but with no real explanation why
# beyond the undefined symbols. It really shold be investigated further.
# Disable LTO
%define _lto_cflags %{nil}
# Set build date from https://reproducible-builds.org/specs/source-date-epoch/
export SOURCE_DATE_EPOCH=$(date +%s -r NEWS)
export PHP_UNAME=$(uname)
export PHP_BUILD_SYSTEM=$(cat /etc/system-release | sed -e 's/ Beta//')
%if 0%{?vendor:1}
export PHP_BUILD_PROVIDER="%{vendor}"
%endif
export PHP_BUILD_COMPILER="$(gcc --version | head -n1)"
export PHP_BUILD_ARCH="%{_arch}"
# Force use of system libtool:
libtoolize --force --copy
cat $(aclocal --print-ac-dir)/{libtool,ltoptions,ltsugar,ltversion,lt~obsolete}.m4 >build/libtool.m4
# Regenerate configure scripts (patches change config.m4's)
touch configure.ac
./buildconf --force
%if %{with debug}
LDFLAGS="-fsanitize=address"
export LDFLAGS
CFLAGS=$(echo $RPM_OPT_FLAGS -fno-strict-aliasing -Wno-pointer-sign -fsanitize=address -ggdb | sed 's/-mstackrealign//')
%else
CFLAGS=$(echo $RPM_OPT_FLAGS -fno-strict-aliasing -Wno-pointer-sign | sed 's/-mstackrealign//')
%endif
export CFLAGS
# Install extension modules in %{_libdir}/php/modules.
EXTENSION_DIR=%{_libdir}/php/modules; export EXTENSION_DIR
# Set PEAR_INSTALLDIR to ensure that the hard-coded include_path
# includes the PEAR directory even though pear is packaged
# separately.
PEAR_INSTALLDIR=%{_datadir}/pear; export PEAR_INSTALLDIR
# Shell function to configure and build a PHP tree.
build() {
# Old/recent bison version seems to produce a broken parser;
# upstream uses GNU Bison 2.3. Workaround:
# Only provided in official tarball (not in snapshot)
if [ -f ../Zend/zend_language_parser.c ]; then
mkdir Zend && cp ../Zend/zend_{language,ini}_{parser,scanner}.[ch] Zend
fi
# Always static:
# date, filter, libxml, reflection, spl: not supported
# hash: for PHAR_SIG_SHA256 and PHAR_SIG_SHA512
# session: dep on hash, used by soap
# sockets: heavily used by FPM test suite
# pcre: used by filter, zip
# pcntl, readline: only used by CLI sapi
# openssl: for PHAR_SIG_OPENSSL
# zlib: used by image
ln -sf ../configure
%configure \
--enable-rtld-now \
--cache-file=../config.cache \
--with-libdir=%{_lib} \
--with-config-file-path=%{_sysconfdir} \
--with-config-file-scan-dir=%{_sysconfdir}/php.d \
--disable-debug \
--with-pic \
--disable-rpath \
--without-pear \
--without-gdbm \
--enable-opcache-file \
--with-openssl \
%if %{with openssl32}
--with-openssl-argon2 \
%endif
--with-system-ciphers \
%if %{with libpcre}
--with-external-pcre \
%endif
%if %{with libxcrypt}
--with-external-libcrypt \
%endif
--with-zlib \
--with-layout=GNU \
--with-libxml \
%if %{with tzdata}
--with-system-tzdata \
%endif
--without-password-argon2 \
%if %{with dtrace}
--enable-dtrace \
%endif
%if %{with debug}
--enable-debug \
%endif
--enable-sockets \
$*
if test $? != 0; then
tail -500 config.log
: configure failed
exit 1
fi
%make_build
}
# Build cli and cgi SAPI, and most shared extensions
pushd build-cgi
build --enable-pcntl \
--with-capstone \
--enable-phpdbg --enable-phpdbg-readline \
--enable-mbstring=shared \
--enable-mbregex \
--enable-gd=shared \
%if %{with libgd}
--with-external-gd \
%else
--with-webp \
--with-jpeg \
--with-xpm \
--with-freetype \
%endif
--with-gmp=shared \
--enable-calendar=shared \
--enable-bcmath=shared \
--with-bz2=shared \
--enable-ctype=shared \
--enable-dba=shared --with-db4=%{_prefix} \
--with-tcadb=%{_prefix} \
--with-lmdb=%{_prefix} \
%if %{with qdbm}
--with-qdbm=%{_prefix} \
%endif
--enable-exif=shared \
--enable-ftp=shared \
--with-gettext=shared \
--with-iconv=shared \
--enable-tokenizer=shared \
--with-ldap=shared --with-ldap-sasl \
--enable-mysqlnd=shared \
--with-mysqli=shared,mysqlnd \
--with-mysql-sock=%{mysql_sock} \
%if %{with firebird}
--with-pdo-firebird=shared \
%endif
--enable-dom=shared \
--with-pgsql=shared \
--enable-simplexml=shared \
--enable-xml=shared \
--with-snmp=shared,%{_prefix} \
--enable-soap=shared \
--with-xsl=shared,%{_prefix} \
--enable-xmlreader=shared --enable-xmlwriter=shared \
--with-curl=shared \
--enable-pdo=shared \
%if %{with iodbc}
--with-iodbc=shared \
--with-pdo-odbc=shared,iodbc \
%else
--with-unixODBC=shared \
--with-pdo-odbc=shared,unixODBC \
%endif
--with-pdo-mysql=shared,mysqlnd \
--with-pdo-pgsql=shared,%{_prefix} \
--with-pdo-sqlite=shared \
--with-pdo-dblib=shared,%{_prefix} \
--with-sqlite3=shared \
%if %{with zip}
--with-zip=shared \
%endif
--enable-pcntl \
--without-readline \
--with-libedit \
--enable-phar=shared \
--with-tidy=shared,%{_prefix} \
--enable-sysvmsg=shared --enable-sysvshm=shared --enable-sysvsem=shared \
--enable-shmop=shared \
--enable-posix=shared \
--enable-fileinfo=shared \
--with-ffi=shared \
--with-sodium=shared \
--enable-intl=shared \
--with-enchant=shared
popd
without_shared="--disable-gd \
--disable-dom --disable-dba --without-unixODBC \
--without-mysqli \
--disable-pdo \
--disable-phpdbg \
--without-ffi \
--disable-xmlreader --disable-xmlwriter \
--without-sodium \
--without-sqlite3 --disable-phar --disable-fileinfo \
--without-curl --disable-posix --disable-xml \
--disable-simplexml --disable-exif --without-gettext \
--without-iconv --disable-ftp --without-bz2 --disable-ctype \
--disable-shmop --disable-tokenizer \
--disable-sysvmsg --disable-sysvshm --disable-sysvsem"
# Build Apache module
# use separate build to avoid libedit, libncurses...
pushd build-apache
build --with-apxs2=%{_httpd_apxs} \
%if %{with lsws}
--enable-litespeed \
%endif
${without_shared}
popd
# Build php-fpm and embed
pushd build-fpm
build --enable-fpm \
--with-fpm-systemd \
--with-fpm-selinux \
--with-fpm-acl \
--enable-embed \
${without_shared}
popd
%if %{with zts}
# Build a special thread-safe (mainly for modules)
pushd build-ztscli
EXTENSION_DIR=%{_libdir}/php-zts/modules
build --includedir=%{_includedir}/php-zts \
--libdir=%{_libdir}/php-zts \
--enable-zts \
--program-prefix=zts- \
--disable-cgi \
--with-config-file-scan-dir=%{_sysconfdir}/php-zts.d \
--with-capstone \
--enable-mbstring=shared \
--enable-mbregex \
--enable-gd=shared \
%if %{with libgd}
--with-external-gd \
%else
--with-webp \
--with-jpeg \
--with-xpm \
--with-freetype \
%endif
--with-gmp=shared \
--enable-calendar=shared \
--enable-bcmath=shared \
--with-bz2=shared \
--enable-ctype=shared \
--enable-dba=shared --with-db4=%{_prefix} \
--with-tcadb=%{_prefix} \
--with-lmdb=%{_prefix} \
%if %{with qdbm}
--with-qdbm=%{_prefix} \
%endif
--with-gettext=shared \
--with-iconv=shared \
--enable-tokenizer=shared \
--enable-exif=shared \
--enable-ftp=shared \
--with-ldap=shared --with-ldap-sasl \
--enable-mysqlnd=shared \
--with-mysqli=shared,mysqlnd \
--with-mysql-sock=%{mysql_sock} \
--enable-mysqlnd-threading \
%if %{with firebird}
--with-pdo-firebird=shared \
%endif
--enable-dom=shared \
--with-pgsql=shared \
--enable-simplexml=shared \
--enable-xml=shared \
--with-snmp=shared,%{_prefix} \
--enable-soap=shared \
--with-xsl=shared,%{_prefix} \
--enable-xmlreader=shared --enable-xmlwriter=shared \
--with-curl=shared \
--enable-pdo=shared \
%if %{with iodbc}
--with-iodbc=shared \
--with-pdo-odbc=shared,iodbc \
%else
--with-unixODBC=shared \
--with-pdo-odbc=shared,unixODBC \
%endif
--with-pdo-mysql=shared,mysqlnd \
--with-pdo-pgsql=shared,%{_prefix} \
--with-pdo-sqlite=shared \
--with-pdo-dblib=shared,%{_prefix} \
--with-sqlite3=shared \
%if %{with zip}
--with-zip=shared \
%endif
--without-readline \
--with-libedit \
--enable-phar=shared \
--with-tidy=shared,%{_prefix} \
--enable-sysvmsg=shared --enable-sysvshm=shared --enable-sysvsem=shared \
--enable-shmop=shared \
--enable-posix=shared \
--enable-fileinfo=shared \
--with-ffi=shared \
--with-sodium=shared \
--enable-intl=shared \
--with-enchant=shared
popd
### NOTE!!! EXTENSION_DIR was changed for the -zts build, so it must remain
### the last SAPI to be built.
%endif
%check
: Ensure proper NTS/ZTS build
$RPM_BUILD_ROOT%{_bindir}/php -n -v | grep NTS
%if %{with zts}
$RPM_BUILD_ROOT%{_bindir}/zts-php -n -v | grep ZTS
%endif
%if %{with tests}
cd build-fpm
# Run tests, using the CLI SAPI
export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
export SKIP_ONLINE_TESTS=1
export SKIP_IO_CAPTURE_TESTS=1
unset TZ LANG LC_ALL
if ! make test TESTS=%{?_smp_mflags}; then
set +x
for f in $(find .. -name \*.diff -type f -print); do
if ! grep -q XFAIL "${f/.diff/.phpt}"
then
echo "TEST FAILURE: $f --"
head -n 100 "$f"
echo -e "\n-- $f result ends."
fi
done
set -x
#exit 1
fi
unset NO_INTERACTION REPORT_EXIT_STATUS MALLOC_CHECK_
%endif
%install
%if %{with zts}
# Install the extensions for the ZTS version
make -C build-ztscli install \
INSTALL_ROOT=$RPM_BUILD_ROOT
%endif
# Install the version for embedded script language in applications + php_embed.h
make -C build-fpm install-sapi install-headers \
INSTALL_ROOT=$RPM_BUILD_ROOT
# Install the php-fpm binary
make -C build-fpm install-fpm \
INSTALL_ROOT=$RPM_BUILD_ROOT
# Install everything from the CGI SAPI build
make -C build-cgi install \
INSTALL_ROOT=$RPM_BUILD_ROOT
# Use php-config from embed SAPI to reduce used libs
install -m 755 build-fpm/scripts/php-config $RPM_BUILD_ROOT%{_bindir}/php-config
# Install the default configuration file
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/
install -m 644 %{S:2} $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
# For third-party packaging:
install -m 755 -d $RPM_BUILD_ROOT%{_datadir}/php/preload
# install the DSO
install -m 755 -d $RPM_BUILD_ROOT%{_httpd_moddir}
install -m 755 build-apache/libs/libphp.so $RPM_BUILD_ROOT%{_httpd_moddir}/libphp.so
# Apache config fragment
# Dual config file with httpd >= 2.4
install -D -m 644 %{S:9} $RPM_BUILD_ROOT%{_httpd_modconfdir}/20-php.conf
install -D -m 644 %{S:1} $RPM_BUILD_ROOT%{_httpd_confdir}/php.conf
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/php.d
%if %{with zts}
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/php-zts.d
%endif
install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/php
install -m 700 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/php/session
install -m 700 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/php/wsdlcache
install -m 700 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/php/opcache
install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/php/peclxml
install -m 755 -d $RPM_BUILD_ROOT%{_docdir}/pecl
install -m 755 -d $RPM_BUILD_ROOT%{_datadir}/tests/pecl
%if %{with lsws}
install -m 755 build-apache/sapi/litespeed/lsphp $RPM_BUILD_ROOT%{_bindir}/lsphp
%endif
# PHP-FPM stuff
# Log
install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/log/php-fpm
# Config
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.d
install -m 644 %{S:4} $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.conf
install -m 644 %{S:5} $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.d/www.conf
mv $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.conf.default .
mv $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.d/www.conf.default .
# LogRotate
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -m 644 %{S:7} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/php-fpm
install -m 755 -d $RPM_BUILD_ROOT/run/php-fpm
# install systemd unit files and scripts for handling server startup
# this folder requires systemd >= 204
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/systemd/system/php-fpm.service.d
install -Dm 644 %{S:6} $RPM_BUILD_ROOT%{_unitdir}/php-fpm.service
install -Dm 644 %{S:12} $RPM_BUILD_ROOT%{_unitdir}/httpd.service.d/php-fpm.conf
install -Dm 644 %{S:12} $RPM_BUILD_ROOT%{_unitdir}/nginx.service.d/php-fpm.conf
# Nginx configuration
install -D -m 644 %{S:13} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d/php-fpm.conf
install -D -m 644 %{S:14} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/default.d/php.conf
TESTCMD="$RPM_BUILD_ROOT%{_bindir}/php --no-php-ini"
# Ensure all provided extensions are really there
for mod in core date filter hash json lexbor libxml openssl pcntl pcre random readline reflection session sockets spl standard uri zlib
do
$TESTCMD --modules | grep -i "$mod\$"
done
TESTCMD="$TESTCMD --define extension_dir=$RPM_BUILD_ROOT%{_libdir}/php/modules"
# Generate files lists and stub .ini files for each subpackage
for mod in pgsql odbc ldap snmp \
mysqlnd mysqli \
mbstring gd dom xsl soap bcmath dba \
simplexml bz2 calendar ctype exif ftp gettext gmp iconv \
tokenizer \
pdo \
%if %{with zip}
zip \
%endif
sqlite3 \
enchant phar fileinfo intl \
ffi \
tidy curl \
sodium \
posix shmop sysvshm sysvsem sysvmsg xml \
pdo_mysql pdo_pgsql pdo_odbc pdo_sqlite pdo_dblib \
%if %{with firebird}
pdo_firebird \
%endif
xmlreader xmlwriter
do
case $mod in
pdo_*|mysqli|xmlreader)
# Extensions with dependencies on 20-*
TESTCMD="$TESTCMD --define extension=$mod"
ini=30-${mod}.ini;;
*)
# Extensions with no dependency
TESTCMD="$TESTCMD --define extension=$mod"
ini=20-${mod}.ini;;
esac
$TESTCMD --modules | grep -i "$mod\$"
# some extensions have their own config file
if [ -f ${ini} ]; then
cp -p ${ini} $RPM_BUILD_ROOT%{_sysconfdir}/php.d/${ini}
%if %{with zts}
cp -p ${ini} $RPM_BUILD_ROOT%{_sysconfdir}/php-zts.d/${ini}
%endif
else
cat > $RPM_BUILD_ROOT%{_sysconfdir}/php.d/${ini} <<EOF
; Enable ${mod} extension module
extension=${mod}
EOF
%if %{with zts}
cat > $RPM_BUILD_ROOT%{_sysconfdir}/php-zts.d/${ini} <<EOF
; Enable ${mod} extension module
extension=${mod}
EOF
%endif
fi
cat > files.${mod} <<EOF
%{_libdir}/php/modules/${mod}.so
%config(noreplace) %{_sysconfdir}/php.d/${ini}
%if %{with zts}
%{_libdir}/php-zts/modules/${mod}.so
%config(noreplace) %{_sysconfdir}/php-zts.d/${ini}
%endif
EOF
done
# The dom, xsl and xml* modules are all packaged in php-xml
cat files.dom files.xsl files.xml{reader,writer} \
files.simplexml >> files.xml
# mysqlnd
cat files.mysqli \
files.pdo_mysql \
>> files.mysqlnd
# Split out the PDO modules
cat files.pdo_pgsql >> files.pgsql
cat files.pdo_odbc >> files.odbc
# sysv* and posix in packaged in php-process
cat files.shmop files.sysv* files.posix > files.process
# Package sqlite3 and pdo_sqlite with pdo; isolating the sqlite dependency
# isn't useful at this time since rpm itself requires sqlite.
cat files.pdo_sqlite >> files.pdo
cat files.sqlite3 >> files.pdo
# Package curl, phar and fileinfo in -common.
cat files.curl files.phar files.fileinfo \
files.exif files.gettext files.iconv files.calendar \
files.ftp files.bz2 files.ctype \
files.tokenizer > files.common
install -m644 %{S:50} $RPM_BUILD_ROOT%{_sysconfdir}/php.d/10-opcache.ini
# The default Zend OPcache blacklist file
install -m 644 %{S:51} $RPM_BUILD_ROOT%{_sysconfdir}/php.d/opcache-default.blacklist
%if %{with zts}
install -m 644 %{S:51} $RPM_BUILD_ROOT%{_sysconfdir}/php-zts.d/opcache-default.blacklist
sed -e '/blacklist_filename/s/php.d/php-zts.d/' \
-i $RPM_BUILD_ROOT%{_sysconfdir}/php-zts.d/10-opcache.ini
%endif
# Install the macros file:
sed -e "s/@PHP_APIVER@/%{apiver}-%{__isa_bits}/" \
-e "s/@PHP_ZENDVER@/%{zendver}-%{__isa_bits}/" \
-e "s/@PHP_PDOVER@/%{pdover}-%{__isa_bits}/" \
-e "s/@PHP_VERSION@/%{upver}/" \
%if %{without zts}
-e "/zts/d" \
%endif
< %{S:3} > macros.php
install -m 644 -D macros.php \
$RPM_BUILD_ROOT%{_rpmmacrodir}/macros.php
install -m 644 -D %{S:2001} \
$RPM_BUILD_ROOT%{_fileattrsdir}/phpapi.attr
# Remove unpackaged files
rm -rf $RPM_BUILD_ROOT%{_libdir}/php/modules/*.a \
$RPM_BUILD_ROOT%{_libdir}/php-zts/modules/*.a \
$RPM_BUILD_ROOT%{_bindir}/{phptar} \
$RPM_BUILD_ROOT%{_datadir}/pear \
$RPM_BUILD_ROOT%{_bindir}/zts-phar* \
$RPM_BUILD_ROOT%{_mandir}/man1/zts-phar* \
$RPM_BUILD_ROOT%{_libdir}/libphp.a \
$RPM_BUILD_ROOT%{_libdir}/libphp.la
# Remove irrelevant docs
rm -f README.{Zeus,QNX,CVS-RULES}
# install composer-generator
install -Dpm 755 %{S:1001} %{buildroot}%{_rpmconfigdir}/composer.prov
install -Dpm 644 %{S:1002} %{buildroot}%{_fileattrsdir}/composer.attr
%post fpm
%systemd_post php-fpm.service
%preun fpm
%systemd_preun php-fpm.service
# Raised by new pool installation or new extension installation
%transfiletriggerin fpm -- %{_sysconfdir}/php-fpm.d %{_sysconfdir}/php.d
systemctl try-restart php-fpm.service >/dev/null 2>&1 || :
%files
%{_httpd_moddir}/libphp.so
%attr(0770,root,apache) %dir %{_localstatedir}/lib/php/session
%attr(0770,root,apache) %dir %{_localstatedir}/lib/php/wsdlcache
%attr(0770,root,apache) %dir %{_localstatedir}/lib/php/opcache
%config(noreplace) %{_httpd_confdir}/php.conf
%config(noreplace) %{_httpd_modconfdir}/20-php.conf
%files common -f files.common
%license LICENSE TSRM_LICENSE ZEND_LICENSE BOOST_LICENSE
%license libmagic_LICENSE
%license timelib_LICENSE
%doc php.ini-*
%config(noreplace) %{_sysconfdir}/php.ini
%config(noreplace) %{_sysconfdir}/php.d/10-opcache.ini
%config(noreplace) %{_sysconfdir}/php.d/opcache-default.blacklist
%dir %{_sysconfdir}/php.d
%dir %{_libdir}/php
%dir %{_libdir}/php/modules
%if %{with zts}
%config(noreplace) %{_sysconfdir}/php-zts.d/opcache-default.blacklist
%dir %{_sysconfdir}/php-zts.d
%dir %{_libdir}/php-zts
%dir %{_libdir}/php-zts/modules
%endif
%dir %{_localstatedir}/lib/php
%dir %{_localstatedir}/lib/php/peclxml
%dir %{_docdir}/pecl
%dir %{_datadir}/tests
%dir %{_datadir}/tests/pecl
%dir %{_datadir}/php
%files cli
%{_bindir}/php
%{_bindir}/php-cgi
%{_bindir}/phar.phar
%{_bindir}/phar
# provides phpize here (not in -devel) for pecl command
%{_bindir}/phpize
%if %{with zts}
%{_bindir}/zts-php
%endif
%files dbg
%{_bindir}/phpdbg
%if %{with zts}
%{_bindir}/zts-phpdbg
%endif
%doc sapi/phpdbg/CREDITS
%files fpm
%doc php-fpm.conf.default www.conf.default
%license fpm_LICENSE
%attr(0770,root,apache) %dir %{_localstatedir}/lib/php/session
%attr(0770,root,apache) %dir %{_localstatedir}/lib/php/wsdlcache
%attr(0770,root,apache) %dir %{_localstatedir}/lib/php/opcache
%config(noreplace) %{_httpd_confdir}/php.conf
%config(noreplace) %{_sysconfdir}/php-fpm.conf
%config(noreplace) %{_sysconfdir}/php-fpm.d/www.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/php-fpm
%config(noreplace) %{_sysconfdir}/nginx/conf.d/php-fpm.conf
%config(noreplace) %{_sysconfdir}/nginx/default.d/php.conf
%{_unitdir}/php-fpm.service
%{_unitdir}/httpd.service.d/php-fpm.conf
%{_unitdir}/nginx.service.d/php-fpm.conf
%dir %{_sysconfdir}/systemd/system/php-fpm.service.d
%dir %ghost /run/php-fpm
%{_sbindir}/php-fpm
%dir %{_sysconfdir}/php-fpm.d
# log owned by apache for log
%attr(770,apache,root) %dir %{_localstatedir}/log/php-fpm
%dir %{_datadir}/php/fpm
%{_datadir}/php/fpm/status.html
%if %{with lsws}
%files litespeed
%{_bindir}/lsphp
%endif
%files devel
%{_bindir}/php-config
%{_includedir}/php
%{_libdir}/php/build
%if %{with zts}
%{_bindir}/zts-php-config
%{_includedir}/php-zts
%{_bindir}/zts-phpize
%{_libdir}/php-zts/build
%endif
%{_rpmmacrodir}/macros.php
%{_fileattrsdir}/phpapi.attr
%files embedded
%{_libdir}/libphp.so
%{_libdir}/libphp-%{embed_version}.so
%files pgsql -f files.pgsql
%files odbc -f files.odbc
%files ldap -f files.ldap
%files snmp -f files.snmp
%files xml -f files.xml
%files mbstring -f files.mbstring
%license libmbfl_LICENSE
%files gd -f files.gd
%files soap -f files.soap
%files bcmath -f files.bcmath
%license libbcmath_LICENSE
%files gmp -f files.gmp
%files dba -f files.dba
%files pdo -f files.pdo
%files tidy -f files.tidy
%files pdo-dblib -f files.pdo_dblib
%files intl -f files.intl
%files process -f files.process
%if %{with firebird}
%files pdo-firebird -f files.pdo_firebird
%endif
%files enchant -f files.enchant
%files mysqlnd -f files.mysqlnd
%if %{with zip}
%files zip -f files.zip
%endif
%files sodium -f files.sodium
%files ffi -f files.ffi
%dir %{_datadir}/php/preload
%files help
%doc EXTENSIONS NEWS UPGRADING* *.md docs
%doc php-fpm.conf.default www.conf.default php.ini-*
%{_mandir}/man?/*
%files -n composer-generators
%{_rpmconfigdir}/composer.prov
%{_fileattrsdir}/composer.attr
%changelog
* Wed Dec 17 2025 Funda Wang <fundawang@yeah.net> - 8.5.1-1
- update to 8.5.1
* Sun Nov 30 2025 Funda Wang <fundawang@yeah.net> - 8.5.0-3
- add phpapi.attr for generating php(api) dependency automatically
* Sat Nov 22 2025 Funda Wang <fundawang@yeah.net> - 8.5.0-2
- Fix GH-20528 regression breaks mysql connexion using an IPv6 address enclosed
in square brackets (upstream patch)
* Tue Nov 18 2025 Funda Wang <fundawang@yeah.net> - 8.5.0-1
- update to 8.5.0
* Wed Oct 22 2025 Funda Wang <fundawang@yeah.net> - 8.4.14-1
- New version 8.4.14
* Thu Sep 25 2025 Funda Wang <fundawang@yeah.net> - 8.4.13-1
- New version 8.4.13
* Thu Aug 28 2025 Funda Wang <fundawang@yeah.net> - 8.4.12-1
- New version 8.4.12
* Wed Jul 30 2025 Funda Wang <fundawang@yeah.net> - 8.4.11-1
- New version 8.4.11
* Wed Jul 02 2025 Funda Wang <fundawang@yeah.net> - 8.4.10-1
- New version 8.4.10
* Sat Jun 07 2025 Funda Wang <fundawang@yeah.net> - 8.4.8-1
- New version 8.4.8
- use same build tree for fpm and embed
* Thu May 08 2025 Funda Wang <fundawang@yeah.net> - 8.4.7-1
- New version 8.4.7
* Wed Apr 09 2025 Funda Wang <fundawang@yeah.net> - 8.4.6-1
- New version 8.4.6
* Sat Mar 22 2025 Funda Wang <fundawang@yeah.net> - 8.4.5-3
- hardcode libxml2 version as what was used for building
* Tue Mar 18 2025 Funda Wang <fundawang@yeah.net> - 8.4.5-2
- add composer-generators from remi
* Sun Mar 16 2025 Funda Wang <fundawang@yeah.net> - 8.4.5-1
- New version 8.4.5
- Resync with remi codebase
- build sockets extension statically
- support litespeed webserver
- support freetds database server
* Wed Mar 12 2025 Funda Wang <fundawang@yeah.net> - 8.3.19-1
- New version 8.3.19
* Tue Feb 25 2025 zhangshaoning <zhangshaoning@uniontech.com> - 8.3.17-2
- Add sw_64 support
* Wed Feb 12 2025 Funda Wang <fundawang@yeah.net> - 8.3.17-1
- New version 8.3.17
* Wed Jan 15 2025 Funda Wang <fundawang@yeah.net> - 8.3.16-1
- New version 8.3.16
* Wed Dec 18 2024 Funda Wang <fundawang@yeah.net> - 8.3.15-1
- New version 8.3.15
* Wed Nov 20 2024 Funda Wang <fundawang@yeah.net> - 8.3.14-1
- New version 8.3.14
* Wed Oct 23 2024 Funda Wang <fundawang@yeah.net> - 8.3.13-1
- New version 8.3.13
* Wed Sep 25 2024 Funda Wang <fundawang@yeah.net> - 8.3.12-1
- New version 8.3.12
* Mon Sep 02 2024 Funda Wang <fundawang@yeah.net> - 8.3.11-1
- New version 8.3.11
* Wed Jul 31 2024 Funda Wang <fundawang@yeah.net> - 8.3.10-1
- New version 8.3.10
* Wed Jun 12 2024 Funda Wang <fundawang@yeah.net> - 8.3.8-2
- Fix GH-14480 Method visibility issue introduced in version 8.3.8
- Update licenses declaration
* Fri Jun 07 2024 Funda Wang <fundawang@yeah.net> - 8.3.8-1
- New version 8.3.8
* Fri Apr 12 2024 Funda Wang <fundawang@yeah.net> - 8.3.6-1
- New version 8.3.6
* Sat Mar 2 2024 shafeipaozi <sunbo.oerv@isrc.iscas.ac.cn> - 8.3.3-1
- New version 8.3.3
* Sat Oct 28 2023 Funda Wang <fundawang@yeah.net> - 8.2.12-1
- New version 8.2.12
* Fri Sep 29 2023 Funda Wang <fundawang@yeah.net> - 8.2.11-1
- New version 8.2.11
* Sun Sep 3 2023 Funda Wang <fundawang@yeah.net> - 8.2.10-1
- New version 8.2.10
* Fri Aug 18 2023 Funda Wang <fundawang@yeah.net> - 8.2.9-2
- Refresh tarball with upstream
* Tue Aug 1 2023 Funda Wang <fundawang@yeah.net> - 8.2.9-1
- update to 8.2.9
* Fri Jun 16 2023 Dillon Chen <dillon.chen@gmail.com> - 8.2.8-1
- update to 8.2.8
* Fri Jun 16 2023 Dillon Chen <dillon.chen@gmail.com> - 8.2.7-1
- update to 8.2.7
* Mon May 8 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 8.2.3-2
- disable pcre-jit for loongarch64
* Tue Feb 21 2023 Dillon Chen <dillon.chen@gmail.com> - 8.2.3-1
- CVE-2023-0567,CVE-2023-0568,CVE-2023-0662
- update to 8.2.3
* Mon Jan 16 2023 Dillon Chen <dillon.chen@gmail.com> - 8.2.1-1
- update to 8.2.1
* Tue Dec 27 2022 huyab<1229981468@qq.com> - 8.2.0-1
- update version to 8.2.0-1
* Thu Nov 24 2022 Funda Wang <fundawang@yeah.net> - 8.1.13-1
- New version 8.1.13
* Sat Oct 29 2022 Funda Wang <fundawang@yeah.net> - 8.1.12-1
- New version 8.1.12
* Thu Sep 29 2022 dillon chen <dillon.chen@gmail.com> - 8.1.11-1
- update to 8.1.11
- CVE-2022-31628, CVE-2022-31629
* Sat Sep 17 2022 Funda Wang <fundawang@yeah.net> - 8.1.10-1
- New version 8.1.10
- Sync systzdata with remi's php repo
- enable libsodium sub package
- cleanup unused build switches
* Tue Jul 12 2022 Hugel <gengqihu1@h-partners.com> - 8.1.1-5
- Fix CVE-2022-31627
* Sat Jun 18 2022 Hugel <gengqihu1@h-partners.com> - 8.1.1-4
- Fix CVE-2022-31625 CVE-2022-31626
* Wed Mar 9 2022 panxiaohe <panxh.life@foxmail.com> - 8.1.1-3
- Fix CVE-2021-21708
* Wed Feb 23 2022 panxiaohe <panxh.life@foxmail.com> - 8.1.1-2
- use lmdb instead of Berkeley DB for package dba
- update %%configure for riscv
* Thu Dec 30 2021 panxiaohe <panxiaohe@huawei.com> - 8.1.1-1
- Update to 8.1.1
* Sat Dec 18 2021 yixiangzhike <yixiangzhike007@163.com> - 8.0.0-8
- Fix bugs found by oss-fuzz
* Thu Dec 2 2021 fuanan <fuanan3@huawei.com> - 8.0.0-7
- Fix CVE-2021-21707
* Thu Nov 4 2021 panxiaohe <panxiaohe@huawei.com> - 8.0.0-6
- Fix CVE-2021-21703
* Sat Oct 16 2021 wangjie <wangjie375@huawei.com> - 8.0.0-5
- fix CVE-2021-21704
* Wed Sep 29 2021 fuanan <fuanan3@huawei.com> - 8.0.0-4
- refix CVE-2020-7071 and fix CVE-2021-21705
* Tue Jun 1 2021 guoxiaoqi <guoxiaoqi2@huawei.com> - 8.0.0-3
- Fix CVE-2021-21702
* Fri Jan 29 2021 panxiaohe <panxiaohe@huawei.com> - 8.0.0-2
- Fix CVE-2020-7071
* Thu Dec 31 2020 panxiaohe <panxiaohe@huawei.com> - 8.0.0-1
- Update to 8.0.0
* Mon Sep 21 2020 shaoqiang kang <kangshaoqiang1@huawei.com> - 7.2.10-6
- Fix CVE-2020-7068
* Tue Jul 21 2020 wangyue <wangyue92@huawei.com> - 7.2.10-5
- Type:cves
- ID:CVE-2019-11048
- SUG:restart
- DESC:fix CVE-2019-11048
* Fri Apr 24 2020 openEuler Buildteam <buildteam@openeuler.org> - 7.2.10-4
- Type:cves
- ID:CVE-2020-7064 CVE-2020-7066
- SUG:restart
- DESC:fix CVE-2020-7064 CVE-2020-7066
* Mon Mar 16 2020 shijian <shijian16@huawei.com> - 7.2.10-3
- Type:cves
- ID:CVE-2018-19518 CVE-2019-6977
- SUG:restart
- DESC:fix CVE-2018-19518 CVE-2019-6977
* Thu Mar 12 2020 openEuler Buildteam <buildteam@openeuler.org> - 7.2.10-2
- Add CVE patches
- Fix CVE-2019-9021 CVE-2019-9022 CVE-2019-9023 CVE-2019-9024
CVE-2019-9637 CVE-2019-9638 CVE-2019-9639 CVE-2019-9640
CVE-2018-20783 CVE-2019-9641 CVE-2019-11034 CVE-2019-11035
CVE-2019-11036 CVE-2019-11041 CVE-2019-11042 CVE-2019-11043
CVE-2018-19935 CVE-2019-11045 CVE-2019-11046 CVE-2019-11050
CVE-2019-11047
* Fri Feb 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 7.2.10-1
- Package init
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。