Ubuntu 20.04, Apache2, partkeepr stopped working when a new version of PHP installed

304 views
Skip to first unread message

George Schroeder

unread,
Sep 8, 2022, 4:03:03 PM9/8/22
to PartKeepr Users
partkeepr-1.4.0 was working beautifully and a complete inventory entered in great format. Then I installed PHP 8.0 and partkeepr stopped working. I thought it was referenced to PHP 7.0 or PHP 7.1. Why would it try to use 8.0? I used sudo update-alternatives --config php to change the version being used back to 7.0. but that made no difference to partkeepr. Setup fails the prerequisites test. I deleted PHP 8.0 and that just increased the error message. Now, the issue is it can't find a version of PHP even though php --version says Ubuntu is using 7.0., It must be hard coded to use PHP 8.0 somewhere, but I can't find it. I have spent two weeks trying to get things working again and my company needs it to work. I hope somebody has an answer. Thanks in advance.

adlerweb

unread,
Sep 8, 2022, 5:08:28 PM9/8/22
to PartKeepr Users
>  Why would it try to use 8.0?
Partkeepr is (mostly) a web application, as such your server itself provides the interpreter to run PHP-code. If you install PHP8 and your distribution activates it, it will be used. Partkeepr has no influence to this process

>  php --version
This is the CLI version of PHP. Partkeepr is accessed using your webserver, so you need to check over there. You cound create a phpinfo()-File[1] and check via your browser which version of PHP is actually active, however if PartKeepr says it's 8 it most likely is. In this case you have to disable/unconfigure PHP8 and load/configure PHP7.1 over there. For apache2 this should be a2dismod php8.0 && a2enmod php7.1 && systemctl restart apache2 [2].

> my company needs it to work
You might want to spend some time to build a small development/staging system and get proper backups. It usually takes less then two weeks and will save you from similar and many more problems in the future.

George Schroeder

unread,
Sep 8, 2022, 6:51:48 PM9/8/22
to PartKeepr Users
Thank you much for helping. I ran a2dismod php8.0 && a2enmod php7.1 && systemctl restart apache2 which ended with "Could not create /etc/apache2/mods-enabled/php7.1.conf: Permission denied" The phpinfo.php is emty.

George Schroeder

unread,
Sep 8, 2022, 7:24:11 PM9/8/22
to PartKeepr Users
I ran this with sudo.

adlerweb

unread,
Sep 12, 2022, 12:36:13 PM9/12/22
to PartKeepr Users

The message indicates it wasn't run with sufficient permissions. When not running as root you need sudo for every of the commands:

sudo a2dismod php8.0
sudo a2enmod php7.1
sudo systemctl restart apache2

Acceptable Name

unread,
Sep 14, 2022, 9:33:08 PM9/14/22
to PartKeepr Users
You can run partkeepr in a Docker or Podman container and that will have all the old versions of software in it so the Ubuntu OS version will not matter.

George Schroeder

unread,
Sep 15, 2022, 6:14:44 PM9/15/22
to PartKeepr Users
This is solved. I re-installed php7.1 and was able to run the setup screens. I didn't even loose any data, but spent three weeks getting this back up. Sincere thanks to all who helped.

Acceptable Name

unread,
Sep 16, 2022, 8:33:23 AM9/16/22
to George Schroeder, PartKeepr Users
How did you install php7.1 on Ubuntu 20.04? I only see php7.4 in the default repos.

--
You received this message because you are subscribed to a topic in the Google Groups "PartKeepr Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/partkeepr-users/maDT2QocZ7c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to partkeepr-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/partkeepr-users/b1e38a37-ceb2-4443-b7cb-6af4b16de712n%40googlegroups.com.

George Schroeder

unread,
Sep 16, 2022, 11:30:27 AM9/16/22
to PartKeepr Users
To clarify, php 7.1 was already installed but setup complained about missing modules. Hence, I did sudo apt install  php7.1-apcu php7.1-apcu-bc php7.1-curl php7.1-gd php7.1-intl php7.1-ldap php7.1-mysql php7.1-xml php7.1-zip. The errors were resolved and the program came back to life.

Acceptable Name

unread,
Sep 16, 2022, 12:23:34 PM9/16/22
to PartKeepr Users
Are you really using Ubuntu 20.04 and not 18.04?

You can check by looking at /etc/os-release and other ways.
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

I can't find a PHP 7.1 or 7.2 package in the Ubuntu 20.04 default repo.

For example APCU:

$ apt-cache show php7.1-apcu
N: Unable to locate package php7.1-apcu
N: Couldn't find any package by glob 'php7.1-apcu'
N: Couldn't find any package by regex 'php7.1-apcu'
E: No packages found
$ apt-cache search php7.1-apcu
(no output)

$ apt-cache search apcu | grep php
php-apcu - APC User Cache for PHP
php-apcu-bc - APCu Backwards Compatibility Module

$ apt-cache show php-apcu | grep Provides
Provides: php-user-cache, php7.4-apcu

The php-apcu provides php7.4-apcu not another version.

George Schroeder

unread,
Sep 16, 2022, 12:45:00 PM9/16/22
to PartKeepr Users
Posting more information on my configuration because of user questions that cause me to wonder if I have a stable configuration. I believe this machine started out with Ubuntu 16.04 and was upgraded several times to the current 20.04. When php7.1 was install isn't clear. If this is not a good configuration, please comment. So, for cat /etc/os-release,
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

For apt-cache show php7.1-apcu,
Package: php7.1-apcu
Source: php-apcu
Priority: optional
Section: php
Installed-Size: 177
Maintainer: Debian PHP PECL Maintainers <team+p...@tracker.debian.org>
Architecture: amd64
Version: 5.1.21+4.0.11-8+ubuntu20.04.1+deb.sury.org+1
Replaces: php-apcu (<< 5.1.21+4.0.11-8+ubuntu20.04.1+deb.sury.org+1~)
Suggests: php-gd
Provides: php-apcu
Depends: php7.1-common, phpapi-20160303, libc6 (>= 2.14)
Conflicts: php-xcache, php-yac
Pre-Depends: php-common (>= 2:69~)
Breaks: php-apcu (<< 5.1.21+4.0.11-8+ubuntu20.04.1+deb.sury.org+1~)
Filename: pool/main/p/php-apcu/php7.1-apcu_5.1.21+4.0.11-8+ubuntu20.04.1+deb.sury.org+1_amd64.deb
Size: 45300
MD5sum: a9982fb73b863f42f80f0b1d2798e77f
SHA1: d449f2530cb8c8c84f524e9633c00ce683527cc4
SHA256: 03b9b6a770af917aa63469dfc5236192b307d11fd8431f84820a175d0a79cfe6
Description-en: APC User Cache for PHP
 The APCu is userland caching: APC (Alternative PHP Cache) stripped of
 opcode caching after the deployment of Zend OpCache in PHP 5.5 as the
 primary solution to opcode caching in future versions of PHP.
 .
 The APCu is a fast solution for userland caching (and dumping) of PHP
 variables locally, it is not distributed like MemcacheD, but they can
 be used together for optimal caching.
Description-md5: 0d7462c8f566c71b65f0d4bcf7806445

Thanks in advance.

Thomas Witzke

unread,
Sep 16, 2022, 1:47:56 PM9/16/22
to PartKeepr Users
FYI, It is possible to add older versions of PHP to Debian and Ubuntu using the repository maintained by Ondřej Surý at https://deb.sury.org/ 

You can also manage multiple version of PHP on a server by using:

sudo update-alternatives --config php

This lets you have multiple versions installed and then pick the default version. More information on managing the different version can be found here:


~Tom



You received this message because you are subscribed to the Google Groups "PartKeepr Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to partkeepr-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/partkeepr-users/b5ad8e81-13db-4b64-bc04-1e8dfce34d84n%40googlegroups.com.

Acceptable Name

unread,
Sep 16, 2022, 5:42:06 PM9/16/22
to PartKeepr Users
Thanks for the tip!

Are there packages for symphony2 and composer 1.2.2?
Or do I have to install them from Github?
Reply all
Reply to author
Forward
0 new messages