ini file for php-rrd extension not placed in correct directory for PHP 7 (Ubuntu 16.04)

Asked by George

Hello,

I'm trying to install php-rrd extension on Ubuntu 16.04, after installing PHP.

Package details:
```
apt-cache show php-rrd
Package: php-rrd
Priority: optional
Section: universe/php
Installed-Size: 57
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian PHP PECL Maintainers <email address hidden>
Architecture: amd64
Version: 2.0.0+1.1.3-3
Depends: phpapi-20151012, libc6 (>= 2.14), librrd4 (>= 1.4~rc2)
Filename: pool/universe/p/php-rrd/php-rrd_2.0.0+1.1.3-3_amd64.deb
Size: 14426
MD5sum: 67c3e8ec724d01b2eafd55718124c4e1
SHA1: 683a59918264156868c8c26e6a29f60fe734ac15
SHA256: 2fa5a2e26f35a071f2b17bcda65330a0f43faf4be2c94c4ed160398e098a5935
Description-en: PHP bindings to rrd tool system
 Procedural and simple OO wrapper for rrdtool - data logging and
 graphing system for time series data.
Description-md5: 76fef5c0491b279d51f3955f0b75ffe8
Homepage: http://pecl.php.net/package/rrd
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
```

Some additional packages are required:

```
root@php7:/# sudo apt-get install php-rrd

The following additional packages will be installed:
    fontconfig libcairo2 libdatrie1 libdbi1 libgraphite2-3 libharfbuzz0b
    libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 librrd4
    libthai-data libthai0 libxcb-render0 libxcb-shm0 libxext6 libxrender1
    virtualbox-ovf: The following NEW packages will be installed:
    fontconfig libcairo2 libdatrie1 libdbi1 libgraphite2-3 libharfbuzz0b
    libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 librrd4
    libthai-data libthai0 libxcb-render0 libxcb-shm0 libxext6 libxrender1
    php-rrd
```

after all packages are installed, the ini file exists in a different location than what PHP expects:

```
root@php7:/etc/apt# apt install php-rrd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  php-rrd
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 14.4 kB of archives.
After this operation, 58.4 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 php-rrd amd64 2.0.0+1.1.3-3 [14.4 kB]
Fetched 14.4 kB in 0s (61.2 kB/s)
Selecting previously unselected package php-rrd.
(Reading database ... 105650 files and directories currently installed.)
Preparing to unpack .../php-rrd_2.0.0+1.1.3-3_amd64.deb ...
Unpacking php-rrd (2.0.0+1.1.3-3) ...
Setting up php-rrd (2.0.0+1.1.3-3) ...
WARNING: Module rrd ini file doesn't exist under /etc/php/7.0/mods-available
WARNING: Module rrd ini file doesn't exist under /etc/php/7.0/mods-available

root@php7:/etc/apt# locate rrd.ini
/etc/php/mods-available/rrd.ini
```

If I create the symlink manually:
```
root@php7:/etc/php/7.0/mods-available# ln -s /etc/php/mods-available/rrd.ini ./rrd.ini
root@php7:/etc/php/7.0/mods-available# ll
...
lrwxrwxrwx 1 root root 31 Feb 19 17:23 rrd.ini -> /etc/php/mods-available/rrd.ini
...
```

and try to reinstall it (symlink breaks temproarily)
```
root@php7:/etc/php/7.0/mods-available# apt purge php-rrd && apt install php-rrd
...
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  php-rrd
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 14.4 kB of archives.
After this operation, 58.4 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 php-rrd amd64 2.0.0+1.1.3-3 [14.4 kB]
Fetched 14.4 kB in 0s (60.8 kB/s)
Selecting previously unselected package php-rrd.
(Reading database ... 105650 files and directories currently installed.)
Preparing to unpack .../php-rrd_2.0.0+1.1.3-3_amd64.deb ...
Unpacking php-rrd (2.0.0+1.1.3-3) ...
Setting up php-rrd (2.0.0+1.1.3-3) ...
```
it works without a problem

```
php -i | grep rrd
/etc/php/7.0/cli/conf.d/20-rrd.ini,
rrd
rrd tool module => enabled
rrd tool module version => 2.0.0
rrdtool library version => 1.5.5
```

Additional Information:
```
lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial

$ uname -a
Linux php7 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ cat -n /etc/apt/sources.list
     1 #
     2
     3 # deb cdrom:[Ubuntu-Server 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.3)]/ xenial main restricted
     4
     5 # deb cdrom:[Ubuntu-Server 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.3)]/ xenial main restricted
     6
     7 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     8 # newer versions of the distribution.
     9 deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
    10 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
    11
    12 # # Major bug fix updates produced after the final release of the
    13 # # distribution.
    14 deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
    15 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
    16
    17 # # N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    18 # # team, and may not be under a free licence. Please satisfy yourself as to
    19 # # your rights to use the software. Also, please note that software in
    20 # # universe WILL NOT receive any review or updates from the Ubuntu security
    21 # # team.
    22 deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
    23 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
    24 deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
    25 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
    26
    27 # # N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    28 # # team, and may not be under a free licence. Please satisfy yourself as to
    29 # # your rights to use the software. Also, please note that software in
    30 # # multiverse WILL NOT receive any review or updates from the Ubuntu
    31 # # security team.
    32 deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
    33 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
    34 deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
    35 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
    36
    37 # # N.B. software from this repository may not have been tested as
    38 # # extensively as that contained in the main release, although it includes
    39 # # newer versions of some applications which may provide useful features.
    40 # # Also, please note that software in backports WILL NOT receive any review
    41 # # or updates from the Ubuntu security team.
    42 deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    43 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    44
    45 # # Uncomment the following two lines to add software from Canonical's
    46 # # 'partner' repository.
    47 # # This software is not part of Ubuntu, but is offered by Canonical and the
    48 # # respective vendors as a service to Ubuntu users.
    49 # deb http://archive.canonical.com/ubuntu xenial partner
    50 # deb-src http://archive.canonical.com/ubuntu xenial partner
    51
    52 deb http://security.ubuntu.com/ubuntu xenial-security main restricted
    53 # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
    54 deb http://security.ubuntu.com/ubuntu xenial-security universe
    55 # deb-src http://security.ubuntu.com/ubuntu xenial-security universe
    56 deb http://security.ubuntu.com/ubuntu xenial-security multiverse
```

Credit: https://launchpad.net/~cb.worldfirst helped me troubleshoot this.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

I suggest you report a bug. Cite your fix as a solution

Revision history for this message
George (ggirtsou-wf) said :
#2

Thanks actionparsnip, that solved my question.

Revision history for this message
Luca Zappi (zpplcu) said :
#3

thanks to you George, my php-rrd module is now, finally working fine.

Revision history for this message
Rien Profijt (rprofijt) said :
#4

Hi,

This is still an issue.. was the package fixed?

Setting up php-rrd (2.0.0+1.1.3-3) ...
WARNING: Module rrd ini file doesn't exist under /etc/php/7.0/mods-available
WARNING: Module rrd ini file doesn't exist under /etc/php/7.0/mods-available