You are not logged in.

#1 2019-12-01 11:04:46

kde35
Member
Registered: 2015-04-13
Posts: 48

How to downgrade php to 7.3? [Solved]

Yesterday I did pacman -Syu, which upgraded php to 7.4.  It happens that I run some servers incompatible with php 7.4, for example nextcloud server.  I wonder why
pacman allowed this upgrade without complaining about the dependency, since nextcloud is an official archlinux package.  Anyway, now I need to downgrade php to 7.3,
but if I downgrade

systemctl stop httpd
pacman -U php*7.3.9* 
loading packages...
warning: downgrading package php (7.4.0-2 => 7.3.9-1)
warning: downgrading package php-apache (7.4.0-2 => 7.3.9-1)
warning: downgrading package php-cgi (7.4.0-2 => 7.3.9-1)
warning: downgrading package php-embed (7.4.0-2 => 7.3.9-1)
warning: downgrading package php-fpm (7.4.0-2 => 7.3.9-1)
warning: downgrading package php-gd (7.4.0-2 => 7.3.9-1)
warning: downgrading package php-imap (7.4.0-2 => 7.3.9-1)
warning: downgrading package php-intl (7.4.0-2 => 7.3.9-1)
warning: downgrading package php-pgsql (7.4.0-2 => 7.3.9-1)
warning: downgrading package php-sqlite (7.4.0-2 => 7.3.9-1)
resolving dependencies...
looking for conflicting packages...

Packages (10) php-7.3.9-1  php-apache-7.3.9-1  php-cgi-7.3.9-1  php-embed-7.3.9-1  php-fpm-7.3.9-1
              php-gd-7.3.9-1  php-imap-7.3.9-1  php-intl-7.3.9-1  php-pgsql-7.3.9-1
              php-sqlite-7.3.9-1

Total Installed Size:  71.37 MiB
Net Upgrade Size:      -9.47 MiB

:: Proceed with installation? [Y/n] 

(in the cache directory)
and then systemctl start httpd, apache won't even start.  Apache error log says

[Sun Dec 01 10:16:39.995551 2019] [mpm_prefork:notice] [pid 37848] AH00163: Apache/2.4.41 (Unix) OpenSSL/1.1.1d PHP/7.4.0 mod_fcgid/2.3.9 configured -- resuming normal operations
[Sun Dec 01 10:16:39.995922 2019] [core:notice] [pid 37848] AH00094: Command line: '/usr/bin/httpd -D FOREGROUND'
[Sun Dec 01 11:00:27.252803 2019] [mpm_prefork:notice] [pid 37848] AH00170: caught SIGWINCH, shutting down gracefully

So, how come it says "PHP/7.4.0" after downgrading?   Does anyone have an idea?

Last edited by kde35 (Yesterday 09:22:32)

Offline

#2 2019-12-01 11:20:58

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,957
Website

Re: How to downgrade php to 7.3? [Solved]

See https://bugs.archlinux.org/task/64689 Seems to me that the NextCloud version check is kind of artificial. nextcloud depends on PHP without version constraint so pacman would not know about such dependencies.

Offline

#3 2019-12-01 15:14:30

kde35
Member
Registered: 2015-04-13
Posts: 48

Re: How to downgrade php to 7.3? [Solved]

Thanks,  by deactivating version check as in the thread you quoted, nextcloud works now.  But I would like to revert to php7.3 anyway.  Currently I run php7.4 with libphp.so, php7.2 and 5.6 with fastcgi/php-fpm,  so in case I broke something else (roundcube, phpmyadmin, and matomo seem to be OK), I could probably use php7.2, but I still prefer 7.3, which has better performance.  And, unlike php5.6 or 7.2 that have AUR packages, php7.3 doesn't.  Any way to do this safely?

Offline

#4 2019-12-01 18:45:01

loqs
Member
Registered: 2014-03-06
Posts: 9,235

Re: How to downgrade php to 7.3? [Solved]

PKGBUILD for php73

# Contributor: Pierre Schmitz <pierre@archlinux.de>

pkgbase=php73
_pkgbase=${pkgbase%73}
pkgname=("$pkgbase"
         "$pkgbase-cgi"
         "$pkgbase-apache"
         "$pkgbase-fpm"
         "$pkgbase-embed"
         "$pkgbase-phpdbg"
         "$pkgbase-dblib"
         "$pkgbase-enchant"
         "$pkgbase-gd"
         "$pkgbase-imap"
         "$pkgbase-intl"
         "$pkgbase-sodium"
         "$pkgbase-odbc"
         "$pkgbase-pgsql"
         "$pkgbase-pspell"
         "$pkgbase-snmp"
         "$pkgbase-sqlite"
         "$pkgbase-tidy"
         "$pkgbase-xsl")
pkgver=7.3.12
pkgrel=1
arch=('x86_64')
license=('PHP')
url='https://secure.php.net/'
makedepends=('apache' 'aspell' 'c-client' 'db' 'enchant' 'gd' 'gmp' 'icu' 'libsodium' 'libxslt' 'libzip' 'net-snmp'
             'postgresql-libs' 'sqlite' 'systemd' 'tidy' 'unixodbc' 'curl' 'libtool' 'postfix' 'freetds' 'pcre2' 'libnsl')
checkdepends=('procps-ng')
source=("https://php.net/distributions/$_pkgbase-$pkgver.tar.xz"{,.asc}
        'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch'
        'enchant-2.patch' 'freetype.patch')
sha256sums=('aafe5e9861ad828860c6af8c88cdc1488314785962328eb1783607c1fdd855df'
            'SKIP'
            '62e5ceea3c90a3c6eab1166488f876e766efcfd7d4e973c44060a9e72d51a98a'
            'ebc0af1ef3a6baccb013d0ccb29923895a7b22ff2d032e3bba802dc6328301ce'
            '7ae4870d54340ee5be5a4fbb61bf81d3bfa33fa3b8d59bafcfa17509e2775234'
            '640dba0d960bfeaae9ad38d2826d3f6b5d6c175a4d3e16664eefff29141faad5'
            '07627f57bbc5559a63bfc77e21edd4e2a5d3aa15fed4d9dfe00e877dd31b7c9f'
            '3992491eebaf5b31f6b00095a7276d11682f9a8aaff473bfb25afbdcfa6eba32'
            '07c4648669dc05afc3c1ad5a4739768079c423b817eabf5296ca3d1ea5ffd163')
validpgpkeys=('CBAF69F173A0FEA4B537F470D66C9593118BCCB6'
              'F38252826ACD957EF380D39F2F7956BC5DA04B5D')

prepare() {
	cd $_pkgbase-$pkgver

	patch -p0 -i ${srcdir}/apache.patch
	patch -p0 -i ${srcdir}/php-fpm.patch
	patch -p0 -i ${srcdir}/php.ini.patch
	patch -p1 -i ${srcdir}/enchant-2.patch
	patch -p1 -i ${srcdir}/freetype.patch
	autoconf

	rm tests/output/stream_isatty_*.phpt
}

build() {
	# http://site.icu-project.org/download/61#TOC-Migration-Issues
	CPPFLAGS+=' -DU_USING_ICU_NAMESPACE=1'

	local _phpconfig="--srcdir=../$_pkgbase-$pkgver \
		--config-cache \
		--prefix=/usr \
		--sbindir=/usr/bin \
		--sysconfdir=/etc/$pkgbase \
		--localstatedir=/var \
		--libdir=/usr/lib/$pkgbase \
		--datarootdir=/usr/share/$pkgbase \
		--datadir=/usr/share/$pkgbase \
		--program-suffix=${pkgbase#php} \
		--with-layout=GNU \
		--with-config-file-path=/etc/$pkgbase \
		--with-config-file-scan-dir=/etc/$pkgbase/conf.d \
		--disable-rpath \
		--mandir=/usr/share/man \
		--without-pear \
		"

	local _phpextensions="\
		--enable-bcmath=shared \
		--enable-calendar=shared \
		--enable-dba=shared \
		--enable-exif=shared \
		--enable-ftp=shared \
		--enable-intl=shared \
		--enable-mbstring \
		--enable-shmop=shared \
		--enable-soap=shared \
		--enable-sockets=shared \
		--enable-sysvmsg=shared \
		--enable-sysvsem=shared \
		--enable-sysvshm=shared \
		--enable-zip=shared \
		--with-bz2=shared \
		--with-curl=shared \
		--with-db4=/usr \
		--with-enchant=shared,/usr \
		--with-freetype-dir=/usr \
		--with-gd=shared,/usr \
		--with-gdbm \
		--with-gettext=shared \
		--with-gmp=shared \
		--with-iconv=shared \
		--with-imap-ssl \
		--with-imap=shared \
		--with-kerberos=/usr \
		--with-ldap=shared \
		--with-ldap-sasl \
		--with-libzip \
		--with-mhash \
		--with-mysql-sock=/run/mysqld/mysqld.sock \
		--with-mysqli=shared,mysqlnd \
		--with-openssl \
		--with-password-argon2 \
		--with-pcre-regex=/usr \
		--with-pdo-dblib=shared,/usr \
		--with-pdo-mysql=shared,mysqlnd \
		--with-pdo-odbc=shared,unixODBC,/usr \
		--with-pdo-pgsql=shared \
		--with-pdo-sqlite=shared,/usr \
		--with-pgsql=shared \
		--with-pspell=shared \
		--with-readline \
		--with-snmp=shared \
		--with-sodium=shared \
		--with-sqlite3=shared,/usr \
		--with-tidy=shared \
		--with-unixODBC=shared,/usr \
		--with-xmlrpc=shared \
		--with-xsl=shared \
		--with-zlib \
		--enable-pcntl \
		"

	EXTENSION_DIR=/usr/lib/$pkgbase/modules
	export EXTENSION_DIR

	mkdir build
	cd build
	ln -s ../$_pkgbase-$pkgver/configure
	./configure $_phpconfig \
		--enable-cgi \
		--enable-fpm \
		--with-fpm-systemd \
		--with-fpm-acl \
		--with-fpm-user=http \
		--with-fpm-group=http \
		--enable-embed=shared \
		$_phpextensions
	make

	# apache
	# reuse the previous run; this will save us a lot of time
	cp -a "$srcdir"/build "$srcdir"/build-apache
	cd "$srcdir"/build-apache
	./configure $_phpconfig \
		--with-apxs2 \
		$_phpextensions
	make

	# phpdbg
	cp -a "$srcdir"/build "$srcdir"/build-phpdbg
	cd "$srcdir"/build-phpdbg
	./configure $_phpconfig \
		--enable-phpdbg \
		$_phpextensions
	make
}

check() {
	cd $_pkgbase-$pkgver

	# Check if sendmail was configured correctly (FS#47600)
	"$srcdir"/build/sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'

	export REPORT_EXIT_STATUS=1
	export NO_INTERACTION=1
	export SKIP_ONLINE_TESTS=1
	export SKIP_SLOW_TESTS=1

	"$srcdir"/build/sapi/cli/php -n run-tests.php -n -P {tests,Zend}
}

package_php73() {
	pkgdesc='A general-purpose scripting language that is especially suited to web development'
	depends=('libxml2' 'curl' 'libzip' 'pcre2' 'argon2')
	provides=("$_pkgbase=$pkgver")
	backup=("etc/$pkgbase/php.ini")

	cd build
	make -j1 INSTALL_ROOT="$pkgdir" install-{modules,cli,build,headers,programs,pharcmd}
	install -D -m644 "$srcdir"/$_pkgbase-$pkgver/php.ini-production "$pkgdir"/etc/$pkgbase/php.ini
	install -d -m755 "$pkgdir"/etc/$pkgbase/conf.d/

	# remove static modules
	rm -f "$pkgdir"/usr/lib/$pkgbase/modules/*.a
	# remove modules provided by sub packages
	rm -f "$pkgdir"/usr/lib/$pkgbase/modules/{enchant,gd,imap,intl,sodium,odbc,pdo_dblib,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
	# remove empty directory
	rmdir "$pkgdir"/usr/include/php/include

	# Move include directory
	mv "$pkgdir"/usr/include/php "$pkgdir"/usr/include/$pkgbase

	# Fix phar symlink
	rm "$pkgdir"/usr/bin/phar
	ln -sf phar.${pkgbase/php/phar} "$pkgdir"/usr/bin/${pkgbase/php/phar}

	# Rename executables
	mv "$pkgdir"/usr/bin/phar.{phar,${pkgbase/php/phar}}

	# Rename man pages
	mv "$pkgdir"/usr/share/man/man1/{phar,${pkgbase/php/phar}}.1
	mv "$pkgdir"/usr/share/man/man1/phar.{phar,${pkgbase/php/phar}}.1

	 # Fix paths in executables
	sed -i "/^includedir=/c \includedir=/usr/include/${pkgbase}" "$pkgdir"/usr/bin/${pkgbase/php/phpize}
	sed -i "/^include_dir=/c \include_dir=/usr/include/${pkgbase}" "$pkgdir"/usr/bin/${pkgbase/php/php-config}

	# Make phpize use php-config73
	sed -i "/^\[  --with-php-config=/c \[  --with-php-config=PATH  Path to php-config [${pkgbase/php/php-config}]], ${pkgbase/php/php-config}, no)" "$pkgdir"/usr/lib/$pkgbase/build/phpize.m4
}

package_php73-cgi() {
	pkgdesc='CGI and FCGI SAPI for PHP'
	depends=("$pkgbase")

	cd build
	make -j1 INSTALL_ROOT="$pkgdir" install-cgi
}

package_php73-apache() {
	pkgdesc='Apache SAPI for PHP'
	depends=("$pkgbase" 'apache' 'libnsl')
	backup=("etc/httpd/conf/extra/$pkgbase_module.conf")

	install -D -m755 build-apache/libs/libphp7.so "$pkgdir"/usr/lib/httpd/modules/libphp7.so
	install -D -m644 apache.conf "$pkgdir"/etc/httpd/conf/extra/php7_module.conf
}

package_php73-fpm() {
	pkgdesc='FastCGI Process Manager for PHP'
	depends=("$pkgbase" 'systemd')
	backup=("etc/$pkgbase/php-fpm.conf" "etc/$pkgbase/php-fpm.d/www.conf")
	options=('!emptydirs')

	cd build
	make -j1 INSTALL_ROOT="$pkgdir" install-fpm
	install -D -m644 sapi/fpm/php-fpm.service "$pkgdir"/usr/lib/systemd/system/$pkgbase-fpm.service
	install -D -m644 ${srcdir}/php-fpm.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/$pkgbase-fpm.conf
}

package_php73-embed() {
	pkgdesc='Embedded PHP SAPI library'
	depends=("$pkgbase" 'systemd-libs' 'libnsl')
	options=('!emptydirs')

	cd build
	make -j1 INSTALL_ROOT="$pkgdir" PHP_SAPI=embed install-sapi
}

package_php73-phpdbg() {
	pkgdesc='Interactive PHP debugger'
	depends=("$pkgbase")
	options=('!emptydirs')

	cd build-phpdbg
	make -j1 INSTALL_ROOT="$pkgdir" install-phpdbg
}

package_php73-dblib() {
	pkgdesc='dblib module for PHP'
	depends=("$pkgbase" 'freetds')

	install -D -m755 build/modules/pdo_dblib.so "$pkgdir"/usr/lib/php/modules/pdo_dblib.so
}

package_php73-enchant() {
	pkgdesc='enchant module for PHP'
	depends=("$pkgbase" 'enchant')

	install -D -m755 build/modules/enchant.so "$pkgdir"/usr/lib/php/modules/enchant.so
}

package_php73-gd() {
	pkgdesc='gd module for PHP'
	depends=("$pkgbase" 'gd')

	install -D -m755 build/modules/gd.so "$pkgdir"/usr/lib/php/modules/gd.so
}

package_php73-imap() {
	pkgdesc='imap module for PHP'
	depends=("$pkgbase" 'c-client')

	install -D -m755 build/modules/imap.so "$pkgdir"/usr/lib/php/modules/imap.so
}

package_php73-intl() {
	pkgdesc='intl module for PHP'
	depends=("$pkgbase" 'icu')

	install -D -m755 build/modules/intl.so "$pkgdir"/usr/lib/php/modules/intl.so
}

package_php73-sodium() {
	pkgdesc='sodium module for PHP'
	depends=("$pkgbase" 'libsodium')

	install -D -m755 build/modules/sodium.so "$pkgdir"/usr/lib/php/modules/sodium.so
}

package_php73-odbc() {
	pkgdesc='ODBC modules for PHP'
	depends=("$pkgbase" 'unixodbc')

	install -D -m755 build/modules/odbc.so "$pkgdir"/usr/lib/php/modules/odbc.so
	install -D -m755 build/modules/pdo_odbc.so "$pkgdir"/usr/lib/php/modules/pdo_odbc.so
}

package_php73-pgsql() {
	pkgdesc='PostgreSQL modules for PHP'
	depends=("$pkgbase" 'postgresql-libs')

	install -D -m755 build/modules/pgsql.so "$pkgdir"/usr/lib/php/modules/pgsql.so
	install -D -m755 build/modules/pdo_pgsql.so "$pkgdir"/usr/lib/php/modules/pdo_pgsql.so
}

package_php73-pspell() {
	pkgdesc='pspell module for PHP'
	depends=("$pkgbase" 'aspell')

	install -D -m755 build/modules/pspell.so "$pkgdir"/usr/lib/php/modules/pspell.so
}

package_php73-snmp() {
	pkgdesc='snmp module for PHP'
	depends=("$pkgbase" 'net-snmp')

	install -D -m755 build/modules/snmp.so "$pkgdir"/usr/lib/php/modules/snmp.so
}

package_php73-sqlite() {
	pkgdesc='sqlite module for PHP'
	depends=("$pkgbase" 'sqlite')

	install -D -m755 build/modules/sqlite3.so "$pkgdir"/usr/lib/php/modules/sqlite3.so
	install -D -m755 build/modules/pdo_sqlite.so "$pkgdir"/usr/lib/php/modules/pdo_sqlite.so
}

package_php73-tidy() {
	pkgdesc='tidy module for PHP'
	depends=("$pkgbase" 'tidy')

	install -D -m755 build/modules/tidy.so "$pkgdir"/usr/lib/php/modules/tidy.so
}

package_php73-xsl() {
	pkgdesc='xsl module for PHP'
	depends=("$pkgbase" 'libxslt')

	install -D -m755 build/modules/xsl.so "$pkgdir"/usr/lib/php/modules/xsl.so
}

build tested only

Offline

#5 2019-12-03 19:30:56

kde35
Member
Registered: 2015-04-13
Posts: 48

Re: How to downgrade php to 7.3? [Solved]

loqs wrote:

PKGBUILD for php73

build tested only

Thank you, but I get

==> ERROR: apache.patch was not found in the build directory and is not a URL.

Offline

#6 2019-12-04 00:10:25

loqs
Member
Registered: 2014-03-06
Posts: 9,235

Re: How to downgrade php to 7.3? [Solved]

Oops forgot about the patches

git clone git://git.archlinux.org/svntogit/packages.git --single-branch --branch "packages/php"
cd packages/trunk/
git checkout 6335a38f32750cd315ae5caf95137aeab0723d99

then use the PKGBUILD from post #4

Offline

#7 2019-12-07 19:37:15

kde35
Member
Registered: 2015-04-13
Posts: 48

Re: How to downgrade php to 7.3? [Solved]

OK, with patches, packages did compile, but didn't install because of file conflicts with "main" php packages.  (As downgrading using packages in the cache didn't work (c.f. post #1, I would rather think downgrading this wouldn't work either, and would rather avoid removing and reinstalling main packages).  So, I modified PKGBUILD as follows

# Contributor: Pierre Schmitz <pierre@archlinux.de>

pkgbase=php73
_pkgbase=${pkgbase%73}
pkgname=("$pkgbase"
         "$pkgbase-cgi"
         "$pkgbase-apache"
         "$pkgbase-fpm"
         "$pkgbase-embed"
         "$pkgbase-phpdbg"
         "$pkgbase-dblib"
         "$pkgbase-enchant"
         "$pkgbase-gd"
         "$pkgbase-imap"
         "$pkgbase-intl"
         "$pkgbase-sodium"
         "$pkgbase-odbc"
         "$pkgbase-pgsql"
         "$pkgbase-pspell"
         "$pkgbase-snmp"
         "$pkgbase-sqlite"
         "$pkgbase-tidy"
         "$pkgbase-xsl")
pkgver=7.3.12
pkgrel=1
arch=('x86_64')
license=('PHP')
url='https://secure.php.net/'
makedepends=('apache' 'aspell' 'c-client' 'db' 'enchant' 'gd' 'gmp' 'icu' 'libsodium' 'libxslt' 'libzip' 'net-snmp'
             'postgresql-libs' 'sqlite' 'systemd' 'tidy' 'unixodbc' 'curl' 'libtool' 'postfix' 'freetds' 'pcre2' 'libnsl')
checkdepends=('procps-ng')
source=("https://php.net/distributions/$_pkgbase-$pkgver.tar.xz"{,.asc}
        'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch'
        'enchant-2.patch' 'freetype.patch')
sha256sums=('aafe5e9861ad828860c6af8c88cdc1488314785962328eb1783607c1fdd855df'
            'SKIP'
            '62e5ceea3c90a3c6eab1166488f876e766efcfd7d4e973c44060a9e72d51a98a'
            'ebc0af1ef3a6baccb013d0ccb29923895a7b22ff2d032e3bba802dc6328301ce'
            '7ae4870d54340ee5be5a4fbb61bf81d3bfa33fa3b8d59bafcfa17509e2775234'
            '640dba0d960bfeaae9ad38d2826d3f6b5d6c175a4d3e16664eefff29141faad5'
            '07627f57bbc5559a63bfc77e21edd4e2a5d3aa15fed4d9dfe00e877dd31b7c9f'
            '3992491eebaf5b31f6b00095a7276d11682f9a8aaff473bfb25afbdcfa6eba32'
            '07c4648669dc05afc3c1ad5a4739768079c423b817eabf5296ca3d1ea5ffd163')
validpgpkeys=('CBAF69F173A0FEA4B537F470D66C9593118BCCB6'
              'F38252826ACD957EF380D39F2F7956BC5DA04B5D')

prepare() {
	cd $_pkgbase-$pkgver

	patch -p0 -i ${srcdir}/apache.patch
	patch -p0 -i ${srcdir}/php-fpm.patch
	patch -p0 -i ${srcdir}/php.ini.patch
	patch -p1 -i ${srcdir}/enchant-2.patch
	patch -p1 -i ${srcdir}/freetype.patch
	autoconf

	rm tests/output/stream_isatty_*.phpt
}

build() {
	# http://site.icu-project.org/download/61#TOC-Migration-Issues
	CPPFLAGS+=' -DU_USING_ICU_NAMESPACE=1'

	local _phpconfig="--srcdir=../$_pkgbase-$pkgver \
		--config-cache \
		--prefix=/usr \
		--sbindir=/usr/bin \
		--sysconfdir=/etc/$pkgbase \
		--localstatedir=/var \
		--libdir=/usr/lib/$pkgbase \
		--datarootdir=/usr/share/$pkgbase \
		--datadir=/usr/share/$pkgbase \
		--program-suffix=${pkgbase#php} \
		--with-layout=GNU \
		--with-config-file-path=/etc/$pkgbase \
		--with-config-file-scan-dir=/etc/$pkgbase/conf.d \
		--disable-rpath \
		--mandir=/usr/share/man \
		--without-pear \
		"

	local _phpextensions="\
		--enable-bcmath=shared \
		--enable-calendar=shared \
		--enable-dba=shared \
		--enable-exif=shared \
		--enable-ftp=shared \
		--enable-intl=shared \
		--enable-mbstring \
		--enable-shmop=shared \
		--enable-soap=shared \
		--enable-sockets=shared \
		--enable-sysvmsg=shared \
		--enable-sysvsem=shared \
		--enable-sysvshm=shared \
		--enable-zip=shared \
		--with-bz2=shared \
		--with-curl=shared \
		--with-db4=/usr \
		--with-enchant=shared,/usr \
		--with-freetype-dir=/usr \
		--with-gd=shared,/usr \
		--with-gdbm \
		--with-gettext=shared \
		--with-gmp=shared \
		--with-iconv=shared \
		--with-imap-ssl \
		--with-imap=shared \
		--with-kerberos=/usr \
		--with-ldap=shared \
		--with-ldap-sasl \
		--with-libzip \
		--with-mhash \
		--with-mysql-sock=/run/mysqld/mysqld.sock \
		--with-mysqli=shared,mysqlnd \
		--with-openssl \
		--with-password-argon2 \
		--with-pcre-regex=/usr \
		--with-pdo-dblib=shared,/usr \
		--with-pdo-mysql=shared,mysqlnd \
		--with-pdo-odbc=shared,unixODBC,/usr \
		--with-pdo-pgsql=shared \
		--with-pdo-sqlite=shared,/usr \
		--with-pgsql=shared \
		--with-pspell=shared \
		--with-readline \
		--with-snmp=shared \
		--with-sodium=shared \
		--with-sqlite3=shared,/usr \
		--with-tidy=shared \
		--with-unixODBC=shared,/usr \
		--with-xmlrpc=shared \
		--with-xsl=shared \
		--with-zlib \
		--enable-pcntl \
		"

	EXTENSION_DIR=/usr/lib/$pkgbase/modules
	export EXTENSION_DIR

	mkdir build
	cd build
	ln -s ../$_pkgbase-$pkgver/configure
	./configure $_phpconfig \
		--enable-cgi \
		--enable-fpm \
		--with-fpm-systemd \
		--with-fpm-acl \
		--with-fpm-user=http \
		--with-fpm-group=http \
		--enable-embed=shared \
		$_phpextensions
	make

	# apache
	# reuse the previous run; this will save us a lot of time
	cp -a "$srcdir"/build "$srcdir"/build-apache
	cd "$srcdir"/build-apache
	./configure $_phpconfig \
		--with-apxs2 \
		$_phpextensions
	make

	# phpdbg
	cp -a "$srcdir"/build "$srcdir"/build-phpdbg
	cd "$srcdir"/build-phpdbg
	./configure $_phpconfig \
		--enable-phpdbg \
		$_phpextensions
	make
}

check() {
	cd $_pkgbase-$pkgver

	# Check if sendmail was configured correctly (FS#47600)
	"$srcdir"/build/sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'

	export REPORT_EXIT_STATUS=1
	export NO_INTERACTION=1
	export SKIP_ONLINE_TESTS=1
	export SKIP_SLOW_TESTS=1

	"$srcdir"/build/sapi/cli/php -n run-tests.php -n -P {tests,Zend}
}

package_php73() {
	pkgdesc='A general-purpose scripting language that is especially suited to web development'
	depends=('libxml2' 'curl' 'libzip' 'pcre2' 'argon2')
	provides=("$_pkgbase=$pkgver")
	backup=("etc/$pkgbase/php.ini")

	cd build
	make -j1 INSTALL_ROOT="$pkgdir" install-{modules,cli,build,headers,programs,pharcmd}
	install -D -m644 "$srcdir"/$_pkgbase-$pkgver/php.ini-production "$pkgdir"/etc/$pkgbase/php.ini
	install -d -m755 "$pkgdir"/etc/$pkgbase/conf.d/

	# remove static modules
	rm -f "$pkgdir"/usr/lib/$pkgbase/modules/*.a
	# remove modules provided by sub packages
	rm -f "$pkgdir"/usr/lib/$pkgbase/modules/{enchant,gd,imap,intl,sodium,odbc,pdo_dblib,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
	# remove empty directory
	rmdir "$pkgdir"/usr/include/php/include

	# Move include directory
	mv "$pkgdir"/usr/include/php "$pkgdir"/usr/include/$pkgbase

	# Fix phar symlink
	rm "$pkgdir"/usr/bin/phar
	ln -sf phar.${pkgbase/php/phar} "$pkgdir"/usr/bin/${pkgbase/php/phar}

	# Rename executables
	mv "$pkgdir"/usr/bin/phar.{phar,${pkgbase/php/phar}}

	# Rename man pages
	mv "$pkgdir"/usr/share/man/man1/{phar,${pkgbase/php/phar}}.1
	mv "$pkgdir"/usr/share/man/man1/phar.{phar,${pkgbase/php/phar}}.1

	 # Fix paths in executables
	sed -i "/^includedir=/c \includedir=/usr/include/${pkgbase}" "$pkgdir"/usr/bin/${pkgbase/php/phpize}
	sed -i "/^include_dir=/c \include_dir=/usr/include/${pkgbase}" "$pkgdir"/usr/bin/${pkgbase/php/php-config}

	# Make phpize use php-config73
	sed -i "/^\[  --with-php-config=/c \[  --with-php-config=PATH  Path to php-config [${pkgbase/php/php-config}]], ${pkgbase/php/php-config}, no)" "$pkgdir"/usr/lib/$pkgbase/build/phpize.m4
}

package_php73-cgi() {
	pkgdesc='CGI and FCGI SAPI for PHP'
	depends=("$pkgbase")

	cd build
	make -j1 INSTALL_ROOT="$pkgdir" install-cgi
}

package_php73-apache() {
	pkgdesc='Apache SAPI for PHP'
	depends=("$pkgbase" 'apache' 'libnsl')
	backup=("etc/httpd/conf/extra/$pkgbase_module.conf")

	install -D -m755 build-apache/libs/libphp7.so "$pkgdir"/usr/lib/httpd/modules/libphp73.so
	install -D -m644 apache.conf "$pkgdir"/etc/httpd/conf/extra/php73_module.conf
}

package_php73-fpm() {
	pkgdesc='FastCGI Process Manager for PHP'
	depends=("$pkgbase" 'systemd')
	backup=("etc/$pkgbase/php-fpm.conf" "etc/$pkgbase/php-fpm.d/www.conf")
	options=('!emptydirs')

	cd build
	make -j1 INSTALL_ROOT="$pkgdir" install-fpm
	install -D -m644 sapi/fpm/php-fpm.service "$pkgdir"/usr/lib/systemd/system/$pkgbase-fpm.service
	install -D -m644 ${srcdir}/php-fpm.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/$pkgbase-fpm.conf
}

package_php73-embed() {
	pkgdesc='Embedded PHP SAPI library'
	depends=("$pkgbase" 'systemd-libs' 'libnsl')
	options=('!emptydirs')

	cd build
	make -j1 INSTALL_ROOT="$pkgdir" PHP_SAPI=embed install-sapi
mv ${pkgdir}/usr/lib/libphp7.so ${pkgdir}/usr/lib/libphp-73.so
}

package_php73-phpdbg() {
	pkgdesc='Interactive PHP debugger'
	depends=("$pkgbase")
	options=('!emptydirs')

	cd build-phpdbg
	make -j1 INSTALL_ROOT="$pkgdir" install-phpdbg
}

package_php73-dblib() {
	pkgdesc='dblib module for PHP'
	depends=("$pkgbase" 'freetds')

	install -D -m755 build/modules/pdo_dblib.so "$pkgdir"/usr/lib/php73/modules/pdo_dblib.so
}

package_php73-enchant() {
	pkgdesc='enchant module for PHP'
	depends=("$pkgbase" 'enchant')

	install -D -m755 build/modules/enchant.so "$pkgdir"/usr/lib/php73/modules/enchant.so
}

package_php73-gd() {
	pkgdesc='gd module for PHP'
	depends=("$pkgbase" 'gd')

	install -D -m755 build/modules/gd.so "$pkgdir"/usr/lib/php73/modules/gd.so
}

package_php73-imap() {
	pkgdesc='imap module for PHP'
	depends=("$pkgbase" 'c-client')

	install -D -m755 build/modules/imap.so "$pkgdir"/usr/lib/php73/modules/imap.so
}

package_php73-intl() {
	pkgdesc='intl module for PHP'
	depends=("$pkgbase" 'icu')

	install -D -m755 build/modules/intl.so "$pkgdir"/usr/lib/php73/modules/intl.so
}

package_php73-sodium() {
	pkgdesc='sodium module for PHP'
	depends=("$pkgbase" 'libsodium')

	install -D -m755 build/modules/sodium.so "$pkgdir"/usr/lib/php73/modules/sodium.so
}

package_php73-odbc() {
	pkgdesc='ODBC modules for PHP'
	depends=("$pkgbase" 'unixodbc')

	install -D -m755 build/modules/odbc.so "$pkgdir"/usr/lib/php73/modules/odbc.so
	install -D -m755 build/modules/pdo_odbc.so "$pkgdir"/usr/lib/php73/modules/pdo_odbc.so
}

package_php73-pgsql() {
	pkgdesc='PostgreSQL modules for PHP'
	depends=("$pkgbase" 'postgresql-libs')

	install -D -m755 build/modules/pgsql.so "$pkgdir"/usr/lib/php73/modules/pgsql.so
	install -D -m755 build/modules/pdo_pgsql.so "$pkgdir"/usr/lib/php73/modules/pdo_pgsql.so
}

package_php73-pspell() {
	pkgdesc='pspell module for PHP'
	depends=("$pkgbase" 'aspell')

	install -D -m755 build/modules/pspell.so "$pkgdir"/usr/lib/php73/modules/pspell.so
}

package_php73-snmp() {
	pkgdesc='snmp module for PHP'
	depends=("$pkgbase" 'net-snmp')

	install -D -m755 build/modules/snmp.so "$pkgdir"/usr/lib/php73/modules/snmp.so
}

package_php73-sqlite() {
	pkgdesc='sqlite module for PHP'
	depends=("$pkgbase" 'sqlite')

	install -D -m755 build/modules/sqlite3.so "$pkgdir"/usr/lib/php73/modules/sqlite3.so
	install -D -m755 build/modules/pdo_sqlite.so "$pkgdir"/usr/lib/php73/modules/pdo_sqlite.so
}

package_php73-tidy() {
	pkgdesc='tidy module for PHP'
	depends=("$pkgbase" 'tidy')

	install -D -m755 build/modules/tidy.so "$pkgdir"/usr/lib/php73/modules/tidy.so
}

package_php73-xsl() {
	pkgdesc='xsl module for PHP'
	depends=("$pkgbase" 'libxslt')

	install -D -m755 build/modules/xsl.so "$pkgdir"/usr/lib/php73/modules/xsl.so
}

And I tried to run php7.3 as described in arch wiki.  This method actually
works for me to run php 5.6 and 7.2 from AUR, along with the "main" version which I simply run with libphp7.so.  I also editted the service script/created
/etc/systemd/system/php73-fpm.service.d/override.conf

[Service]
Type=notify
PIDFile=
PIDFile=/run/php73-fpm/php-fpm.pid
ExecStart=
ExecStart=/usr/bin/php-fpm73 --nodaemonize --fpm-config /etc/php73/php-fpm.conf

When I started the php73-fpm, somehow I needed to create the directory /run/php73-fpm manually to make fpm start.  phpinfo(), in the vhost tells me that I am running php 7.3.12.  However,
in the same vhost, I get this php error

PHP Deprecated:  Unparenthesized `a ? b : c 
? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e) 

which implies that it is actually php7.4 is running for this vhost as well.  Furthermore, after reboot, the directory /run/php73-fpm disappeared and I had to create it again to start php73-fpm, meaning that something went wrong.  What am I doing wrong here?

P.S. I also edited /etc/php73/php-fpm.conf to have

pid = /run/php73-fpm/php-fpm.pid

instead of

pid = /run/php-fpm/php-fpm.pid

that was there.

Offline

#8 2019-12-07 22:20:06

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 3,493

Re: How to downgrade php to 7.3? [Solved]

Have you tried downgrading to a particular date?  It may prove easier than trying to pin down all of the updated packages....
https://wiki.archlinux.org/index.php/Ar … cific_date


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#9 2019-12-07 22:56:09

loqs
Member
Registered: 2014-03-06
Posts: 9,235

Re: How to downgrade php to 7.3? [Solved]

diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 8d269e2..82a24a5 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -1,25 +1,26 @@
-# Maintainer: Pierre Schmitz <pierre@archlinux.de>
-
-pkgbase=php
-pkgname=('php'
-         'php-cgi'
-         'php-apache'
-         'php-fpm'
-         'php-embed'
-         'php-phpdbg'
-         'php-dblib'
-         'php-enchant'
-         'php-gd'
-         'php-imap'
-         'php-intl'
-         'php-sodium'
-         'php-odbc'
-         'php-pgsql'
-         'php-pspell'
-         'php-snmp'
-         'php-sqlite'
-         'php-tidy'
-         'php-xsl')
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=php73
+_pkgbase=${pkgbase%73}
+pkgname=("$pkgbase"
+         "$pkgbase-cgi"
+         "$pkgbase-apache"
+         "$pkgbase-fpm"
+         "$pkgbase-embed"
+         "$pkgbase-phpdbg"
+         "$pkgbase-dblib"
+         "$pkgbase-enchant"
+         "$pkgbase-gd"
+         "$pkgbase-imap"
+         "$pkgbase-intl"
+         "$pkgbase-sodium"
+         "$pkgbase-odbc"
+         "$pkgbase-pgsql"
+         "$pkgbase-pspell"
+         "$pkgbase-snmp"
+         "$pkgbase-sqlite"
+         "$pkgbase-tidy"
+         "$pkgbase-xsl")
 pkgver=7.3.12
 pkgrel=1
 arch=('x86_64')
@@ -28,7 +29,7 @@ url='https://secure.php.net/'
 makedepends=('apache' 'aspell' 'c-client' 'db' 'enchant' 'gd' 'gmp' 'icu' 'libsodium' 'libxslt' 'libzip' 'net-snmp'
              'postgresql-libs' 'sqlite' 'systemd' 'tidy' 'unixodbc' 'curl' 'libtool' 'postfix' 'freetds' 'pcre2' 'libnsl')
 checkdepends=('procps-ng')
-source=("https://php.net/distributions/${pkgbase}-${pkgver}.tar.xz"{,.asc}
+source=("https://php.net/distributions/$_pkgbase-$pkgver.tar.xz"{,.asc}
         'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch'
         'enchant-2.patch' 'freetype.patch')
 sha256sums=('aafe5e9861ad828860c6af8c88cdc1488314785962328eb1783607c1fdd855df'
@@ -36,15 +37,15 @@ sha256sums=('aafe5e9861ad828860c6af8c88cdc1488314785962328eb1783607c1fdd855df'
             '62e5ceea3c90a3c6eab1166488f876e766efcfd7d4e973c44060a9e72d51a98a'
             'ebc0af1ef3a6baccb013d0ccb29923895a7b22ff2d032e3bba802dc6328301ce'
             '7ae4870d54340ee5be5a4fbb61bf81d3bfa33fa3b8d59bafcfa17509e2775234'
-            '640dba0d960bfeaae9ad38d2826d3f6b5d6c175a4d3e16664eefff29141faad5'
-            '07627f57bbc5559a63bfc77e21edd4e2a5d3aa15fed4d9dfe00e877dd31b7c9f'
+            'c28997b08d3ea257a2435164e35d0340f42cd3306def6a94b6b8c0a2f5644def'
+            'cd3b12c1cd5860f77325ef5405b987eca9cd894cbc99bde6ea4bdbed78ff5d46'
             '3992491eebaf5b31f6b00095a7276d11682f9a8aaff473bfb25afbdcfa6eba32'
             '07c4648669dc05afc3c1ad5a4739768079c423b817eabf5296ca3d1ea5ffd163')
 validpgpkeys=('CBAF69F173A0FEA4B537F470D66C9593118BCCB6'
               'F38252826ACD957EF380D39F2F7956BC5DA04B5D')
 
 prepare() {
-	cd ${srcdir}/${pkgbase}-${pkgver}
+	cd $_pkgbase-$pkgver
 
 	patch -p0 -i ${srcdir}/apache.patch
 	patch -p0 -i ${srcdir}/php-fpm.patch
@@ -60,15 +61,19 @@ build() {
 	# http://site.icu-project.org/download/61#TOC-Migration-Issues
 	CPPFLAGS+=' -DU_USING_ICU_NAMESPACE=1'
 
-	local _phpconfig="--srcdir=../${pkgbase}-${pkgver} \
+	local _phpconfig="--srcdir=../$_pkgbase-$pkgver \
 		--config-cache \
 		--prefix=/usr \
 		--sbindir=/usr/bin \
-		--sysconfdir=/etc/php \
+		--sysconfdir=/etc/$pkgbase \
 		--localstatedir=/var \
+		--libdir=/usr/lib/$pkgbase \
+		--datarootdir=/usr/share/$pkgbase \
+		--datadir=/usr/share/$pkgbase \
+		--program-suffix=${pkgbase#php} \
 		--with-layout=GNU \
-		--with-config-file-path=/etc/php \
-		--with-config-file-scan-dir=/etc/php/conf.d \
+		--with-config-file-path=/etc/$pkgbase \
+		--with-config-file-scan-dir=/etc/$pkgbase/conf.d \
 		--disable-rpath \
 		--mandir=/usr/share/man \
 		--without-pear \
@@ -130,13 +135,13 @@ build() {
 		--enable-pcntl \
 		"
 
-	EXTENSION_DIR=/usr/lib/php/modules
+	EXTENSION_DIR=/usr/lib/$pkgbase/modules
 	export EXTENSION_DIR
 
-	mkdir ${srcdir}/build
-	cd ${srcdir}/build
-	ln -s ../${pkgbase}-${pkgver}/configure
-	./configure ${_phpconfig} \
+	mkdir build
+	cd build
+	ln -s ../$_pkgbase-$pkgver/configure
+	./configure $_phpconfig \
 		--enable-cgi \
 		--enable-fpm \
 		--with-fpm-systemd \
@@ -144,199 +149,219 @@ build() {
 		--with-fpm-user=http \
 		--with-fpm-group=http \
 		--enable-embed=shared \
-		${_phpextensions}
+		$_phpextensions
 	make
 
 	# apache
 	# reuse the previous run; this will save us a lot of time
-	cp -a ${srcdir}/build ${srcdir}/build-apache
-	cd ${srcdir}/build-apache
-	./configure ${_phpconfig} \
+	cp -a "$srcdir"/build "$srcdir"/build-apache
+	cd "$srcdir"/build-apache
+	./configure $_phpconfig \
 		--with-apxs2 \
-		${_phpextensions}
+		$_phpextensions
 	make
 
 	# phpdbg
-	cp -a ${srcdir}/build ${srcdir}/build-phpdbg
-	cd ${srcdir}/build-phpdbg
-	./configure ${_phpconfig} \
+	cp -a "$srcdir"/build "$srcdir"/build-phpdbg
+	cd "$srcdir"/build-phpdbg
+	./configure $_phpconfig \
 		--enable-phpdbg \
-		${_phpextensions}
+		$_phpextensions
 	make
 }
 
 check() {
-	cd ${srcdir}/${pkgbase}-${pkgver}
+	cd $_pkgbase-$pkgver
 
 	# Check if sendmail was configured correctly (FS#47600)
-	${srcdir}/build/sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'
+	"$srcdir"/build/sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'
 
 	export REPORT_EXIT_STATUS=1
 	export NO_INTERACTION=1
 	export SKIP_ONLINE_TESTS=1
 	export SKIP_SLOW_TESTS=1
 
-	${srcdir}/build/sapi/cli/php -n run-tests.php -n -P {tests,Zend}
+	"$srcdir"/build/sapi/cli/php -n run-tests.php -n -P {tests,Zend}
 }
 
-package_php() {
+package_php73() {
 	pkgdesc='A general-purpose scripting language that is especially suited to web development'
 	depends=('libxml2' 'curl' 'libzip' 'pcre2' 'argon2')
-	replaces=('php-ldap')
-	conflicts=('php-ldap')
-	provides=("php-ldap=${pkgver}")
-	backup=('etc/php/php.ini')
+	provides=("$_pkgbase=$pkgver")
+	backup=("etc/$pkgbase/php.ini")
 
-	cd ${srcdir}/build
-	make -j1 INSTALL_ROOT=${pkgdir} install-{modules,cli,build,headers,programs,pharcmd}
-	install -D -m644 ${srcdir}/${pkgbase}-${pkgver}/php.ini-production ${pkgdir}/etc/php/php.ini
-	install -d -m755 ${pkgdir}/etc/php/conf.d/
+	cd build
+	make -j1 INSTALL_ROOT="$pkgdir" install-{modules,cli,build,headers,programs,pharcmd}
+	install -D -m644 "$srcdir"/$_pkgbase-$pkgver/php.ini-production "$pkgdir"/etc/$pkgbase/php.ini
+	install -d -m755 "$pkgdir"/etc/$pkgbase/conf.d/
 
 	# remove static modules
-	rm -f ${pkgdir}/usr/lib/php/modules/*.a
+	rm -f "$pkgdir"/usr/lib/$pkgbase/modules/*.a
 	# remove modules provided by sub packages
-	rm -f ${pkgdir}/usr/lib/php/modules/{enchant,gd,imap,intl,sodium,odbc,pdo_dblib,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
+	rm -f "$pkgdir"/usr/lib/$pkgbase/modules/{enchant,gd,imap,intl,sodium,odbc,pdo_dblib,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
 	# remove empty directory
-	rmdir ${pkgdir}/usr/include/php/include
+	rmdir "$pkgdir"/usr/include/php/include
+
+	# Move include directory
+	mv "$pkgdir"/usr/include/php "$pkgdir"/usr/include/$pkgbase
+
+	# Fix phar symlink
+	rm "$pkgdir"/usr/bin/phar
+	ln -sf phar.${pkgbase/php/phar} "$pkgdir"/usr/bin/${pkgbase/php/phar}
+
+	# Rename executables
+	mv "$pkgdir"/usr/bin/phar.{phar,${pkgbase/php/phar}}
+
+	# Rename man pages
+	mv "$pkgdir"/usr/share/man/man1/{phar,${pkgbase/php/phar}}.1
+	mv "$pkgdir"/usr/share/man/man1/phar.{phar,${pkgbase/php/phar}}.1
+
+	 # Fix paths in executables
+	sed -i "/^includedir=/c \includedir=/usr/include/${pkgbase}" "$pkgdir"/usr/bin/${pkgbase/php/phpize}
+	sed -i "/^include_dir=/c \include_dir=/usr/include/${pkgbase}" "$pkgdir"/usr/bin/${pkgbase/php/php-config}
+
+	# Make phpize use php-config73
+	sed -i "/^\[  --with-php-config=/c \[  --with-php-config=PATH  Path to php-config [${pkgbase/php/php-config}]], ${pkgbase/php/php-config}, no)" "$pkgdir"/usr/lib/$pkgbase/build/phpize.m4
 }
 
-package_php-cgi() {
+package_php73-cgi() {
 	pkgdesc='CGI and FCGI SAPI for PHP'
-	depends=('php')
+	depends=("$pkgbase")
 
-	cd ${srcdir}/build
-	make -j1 INSTALL_ROOT=${pkgdir} install-cgi
+	cd build
+	make -j1 INSTALL_ROOT="$pkgdir" install-cgi
 }
 
-package_php-apache() {
+package_php73-apache() {
 	pkgdesc='Apache SAPI for PHP'
-	depends=('php' 'apache' 'libnsl')
-	backup=('etc/httpd/conf/extra/php7_module.conf')
+	depends=("$pkgbase" 'apache' 'libnsl')
+	backup=("etc/httpd/conf/extra/$pkgbase_module.conf")
 
-	install -D -m755 ${srcdir}/build-apache/libs/libphp7.so ${pkgdir}/usr/lib/httpd/modules/libphp7.so
-	install -D -m644 ${srcdir}/apache.conf ${pkgdir}/etc/httpd/conf/extra/php7_module.conf
+	install -D -m755 build-apache/libs/libphp7.so "$pkgdir"/usr/lib/httpd/modules/lib$pkgbase.so
+	install -D -m644 apache.conf "$pkgdir"/etc/httpd/conf/extra/$pkgbase_module.conf
 }
 
-package_php-fpm() {
+package_php73-fpm() {
 	pkgdesc='FastCGI Process Manager for PHP'
-	depends=('php' 'systemd')
-	backup=('etc/php/php-fpm.conf' 'etc/php/php-fpm.d/www.conf')
+	depends=("$pkgbase" 'systemd')
+	backup=("etc/$pkgbase/php-fpm.conf" "etc/$pkgbase/php-fpm.d/www.conf")
 	options=('!emptydirs')
 
-	cd ${srcdir}/build
-	make -j1 INSTALL_ROOT=${pkgdir} install-fpm
-	install -D -m644 sapi/fpm/php-fpm.service ${pkgdir}/usr/lib/systemd/system/php-fpm.service
-	install -D -m644 ${srcdir}/php-fpm.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/php-fpm.conf
+	cd build
+	make -j1 INSTALL_ROOT="$pkgdir" install-fpm
+	install -D -m644 sapi/fpm/php-fpm.service "$pkgdir"/usr/lib/systemd/system/$pkgbase-fpm.service
+	install -D -m644 ${srcdir}/php-fpm.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/$pkgbase-fpm.conf
 }
 
-package_php-embed() {
+package_php73-embed() {
 	pkgdesc='Embedded PHP SAPI library'
-	depends=('php' 'systemd-libs' 'libnsl')
+	depends=("$pkgbase" 'systemd-libs' 'libnsl')
 	options=('!emptydirs')
 
-	cd ${srcdir}/build
-	make -j1 INSTALL_ROOT=${pkgdir} PHP_SAPI=embed install-sapi
+	cd build
+	make -j1 INSTALL_ROOT="$pkgdir" PHP_SAPI=embed install-sapi
+	mv ${pkgdir}/usr/lib/libphp7.so ${pkgdir}/usr/lib/$pkgbase.so
 }
 
-package_php-phpdbg() {
+package_php73-phpdbg() {
 	pkgdesc='Interactive PHP debugger'
-	depends=('php')
+	depends=("$pkgbase")
 	options=('!emptydirs')
 
-	cd ${srcdir}/build-phpdbg
-	make -j1 INSTALL_ROOT=${pkgdir} install-phpdbg
+	cd build-phpdbg
+	make -j1 INSTALL_ROOT="$pkgdir" install-phpdbg
 }
 
-package_php-dblib() {
+package_php73-dblib() {
 	pkgdesc='dblib module for PHP'
-	depends=('php' 'freetds')
+	depends=("$pkgbase" 'freetds')
 
-	install -D -m755 ${srcdir}/build/modules/pdo_dblib.so ${pkgdir}/usr/lib/php/modules/pdo_dblib.so
+	install -D -m755 build/modules/pdo_dblib.so "$pkgdir"/usr/lib/$pkgbase/modules/pdo_dblib.so
 }
 
-package_php-enchant() {
+package_php73-enchant() {
 	pkgdesc='enchant module for PHP'
-	depends=('php' 'enchant')
+	depends=("$pkgbase" 'enchant')
 
-	install -D -m755 ${srcdir}/build/modules/enchant.so ${pkgdir}/usr/lib/php/modules/enchant.so
+	install -D -m755 build/modules/enchant.so "$pkgdir"/usr/lib/$pkgbase/modules/enchant.so
 }
 
-package_php-gd() {
+package_php73-gd() {
 	pkgdesc='gd module for PHP'
-	depends=('php' 'gd')
+	depends=("$pkgbase" 'gd')
 
-	install -D -m755 ${srcdir}/build/modules/gd.so ${pkgdir}/usr/lib/php/modules/gd.so
+	install -D -m755 build/modules/gd.so "$pkgdir"/usr/lib/$pkgbase/modules/gd.so
 }
 
-package_php-imap() {
+package_php73-imap() {
 	pkgdesc='imap module for PHP'
-	depends=('php' 'c-client')
+	depends=("$pkgbase" 'c-client')
 
-	install -D -m755 ${srcdir}/build/modules/imap.so ${pkgdir}/usr/lib/php/modules/imap.so
+	install -D -m755 build/modules/imap.so "$pkgdir"/usr/lib/$pkgbase/modules/imap.so
 }
 
-package_php-intl() {
+package_php73-intl() {
 	pkgdesc='intl module for PHP'
-	depends=('php' 'icu')
+	depends=("$pkgbase" 'icu')
 
-	install -D -m755 ${srcdir}/build/modules/intl.so ${pkgdir}/usr/lib/php/modules/intl.so
+	install -D -m755 build/modules/intl.so "$pkgdir"/usr/lib/$pkgbase/modules/intl.so
 }
 
-package_php-sodium() {
+package_php73-sodium() {
 	pkgdesc='sodium module for PHP'
-	depends=('php' 'libsodium')
+	depends=("$pkgbase" 'libsodium')
 
-	install -D -m755 ${srcdir}/build/modules/sodium.so ${pkgdir}/usr/lib/php/modules/sodium.so
+	install -D -m755 build/modules/sodium.so "$pkgdir"/usr/lib/$pkgbase/modules/sodium.so
 }
 
-package_php-odbc() {
+package_php73-odbc() {
 	pkgdesc='ODBC modules for PHP'
-	depends=('php' 'unixodbc')
+	depends=("$pkgbase" 'unixodbc')
 
-	install -D -m755 ${srcdir}/build/modules/odbc.so ${pkgdir}/usr/lib/php/modules/odbc.so
-	install -D -m755 ${srcdir}/build/modules/pdo_odbc.so ${pkgdir}/usr/lib/php/modules/pdo_odbc.so
+	install -D -m755 build/modules/odbc.so "$pkgdir"/usr/lib/$pkgbase/modules/odbc.so
+	install -D -m755 build/modules/pdo_odbc.so "$pkgdir"/usr/lib/$pkgbase/modules/pdo_odbc.so
 }
 
-package_php-pgsql() {
+package_php73-pgsql() {
 	pkgdesc='PostgreSQL modules for PHP'
-	depends=('php' 'postgresql-libs')
+	depends=("$pkgbase" 'postgresql-libs')
 
-	install -D -m755 ${srcdir}/build/modules/pgsql.so ${pkgdir}/usr/lib/php/modules/pgsql.so
-	install -D -m755 ${srcdir}/build/modules/pdo_pgsql.so ${pkgdir}/usr/lib/php/modules/pdo_pgsql.so
+	install -D -m755 build/modules/pgsql.so "$pkgdir"/usr/lib/$pkgbase/modules/pgsql.so
+	install -D -m755 build/modules/pdo_pgsql.so "$pkgdir"/usr/lib/$pkgbase/modules/pdo_pgsql.so
 }
 
-package_php-pspell() {
+package_php73-pspell() {
 	pkgdesc='pspell module for PHP'
-	depends=('php' 'aspell')
+	depends=("$pkgbase" 'aspell')
 
-	install -D -m755 ${srcdir}/build/modules/pspell.so ${pkgdir}/usr/lib/php/modules/pspell.so
+	install -D -m755 build/modules/pspell.so "$pkgdir"/usr/lib/$pkgbase/modules/pspell.so
 }
 
-package_php-snmp() {
+package_php73-snmp() {
 	pkgdesc='snmp module for PHP'
-	depends=('php' 'net-snmp')
+	depends=("$pkgbase" 'net-snmp')
 
-	install -D -m755 ${srcdir}/build/modules/snmp.so ${pkgdir}/usr/lib/php/modules/snmp.so
+	install -D -m755 build/modules/snmp.so "$pkgdir"/usr/lib/$pkgbase/modules/snmp.so
 }
 
-package_php-sqlite() {
+package_php73-sqlite() {
 	pkgdesc='sqlite module for PHP'
-	depends=('php' 'sqlite')
+	depends=("$pkgbase" 'sqlite')
 
-	install -D -m755 ${srcdir}/build/modules/sqlite3.so ${pkgdir}/usr/lib/php/modules/sqlite3.so
-	install -D -m755 ${srcdir}/build/modules/pdo_sqlite.so ${pkgdir}/usr/lib/php/modules/pdo_sqlite.so
+	install -D -m755 build/modules/sqlite3.so "$pkgdir"/usr/lib/$pkgbase/modules/sqlite3.so
+	install -D -m755 build/modules/pdo_sqlite.so "$pkgdir"/usr/lib/$pkgbase/modules/pdo_sqlite.so
 }
 
-package_php-tidy() {
+package_php73-tidy() {
 	pkgdesc='tidy module for PHP'
-	depends=('php' 'tidy')
+	depends=("$pkgbase" 'tidy')
 
-	install -D -m755 ${srcdir}/build/modules/tidy.so ${pkgdir}/usr/lib/php/modules/tidy.so
+	install -D -m755 build/modules/tidy.so "$pkgdir"/usr/lib/$pkgbase/modules/tidy.so
 }
 
-package_php-xsl() {
+package_php73-xsl() {
 	pkgdesc='xsl module for PHP'
-	depends=('php' 'libxslt')
+	depends=("$pkgbase" 'libxslt')
 
-	install -D -m755 ${srcdir}/build/modules/xsl.so ${pkgdir}/usr/lib/php/modules/xsl.so
+	install -D -m755 build/modules/xsl.so "$pkgdir"/usr/lib/$pkgbase/modules/xsl.so
 }
diff --git a/trunk/php-fpm.tmpfiles b/trunk/php-fpm.tmpfiles
index 801e74f..dfee161 100644
--- a/trunk/php-fpm.tmpfiles
+++ b/trunk/php-fpm.tmpfiles
@@ -1 +1 @@
-d /run/php-fpm 755 root root
+d /run/php73-fpm 755 root root
diff --git a/trunk/php.ini.patch b/trunk/php.ini.patch
index ce35834..1f843ea 100644
--- a/trunk/php.ini.patch
+++ b/trunk/php.ini.patch
@@ -5,7 +5,7 @@
  ; Directory in which the loadable extensions (modules) reside.
  ; http://php.net/extension-dir
 -;extension_dir = "./"
-+extension_dir = "/usr/lib/php/modules/"
++extension_dir = "/usr/lib/php73/modules/"
  ; On windows:
  ;extension_dir = "ext"
  

The additional changes from your updated are at the end fix the tmpfiles snippet and the extenionss_dir

Offline

#10 Yesterday 09:22:09

kde35
Member
Registered: 2015-04-13
Posts: 48

Re: How to downgrade php to 7.3? [Solved]

Thank you loqs, you saved my life.  So it was extendsion_dir which was calling extension files from "wrong version" php.  By the way, php72 AUR package uses variables _realpkg where you use
_pkgbase, just in case you want to make things coherent.

Thank you Slithery too, as a matter of fact maybe it was what I should have done when I saw the problem, but at the time there was about 20 packages updated among which about 10 were related to php.  And in any case I would have to update to php7.4, meaning that I preferred to run php7.3 along with php7.4 using php-fpm.

Offline

Board footer

Powered by FluxBB