# Adminer



## balanga (Feb 13, 2020)

Does anyone have any experience with Adminer ?It's a replacement  for phpMyAdmin and I have it working fine on one system, but when I copy the program (a single php file) to another system I get this error:-


> *Fatal error*: Uncaught Error: Call to undefined function session_cache_limiter() in /usr/local/www/apache24/data/adminer/index.php:170 Stack trace: #0 {main} thrown in */usr/local/www/apache24/data/adminer/index.php* on line *170*



The program is fairly unreadable, but here is the first part of line 170 (which means nothing to me) :-


```
lzw_decompress("\0\0\0` \0.^V^F^D\0\n @\0�^B^S^N^HC.^P�^T\"^\\0`E�Q��^A�^_.?�^F^RtvM'.Jd�^Yd\\^B^S^Y.b0\0^H�\"^S.�f�.��s5.���A.^VX^Q^HP^Ba^Q^HJ.0^X.�.^Z8.#R.T�.z`.#.��
```


----------



## julp (Feb 13, 2020)

adminer is used as a phar archive?



> Uncaught Error: Call to undefined function session_cache_limiter



Seems like session extension (package php7X-session) is not installed. What's the output of `php -m` and `pkg info -x php`? Which would be weird as www/php72-session is a dependency of databases/adminer. Have you manually installed adminer (I mean without using packages neither ports)?


----------



## SirDice (Feb 13, 2020)

balanga said:


> but when I copy the program (a single php file) to another system I get this error:-


Why? Why don't you install the package? The port/package has dependencies which prevents this exact issue.


----------



## balanga (Feb 13, 2020)

Installing the pkg sometimes deletes newer php modules which are already installed. Also the installation process seems to install www pkgs in /usr/local/www/ whereas I prefer them to be in *DocumentRoot* - /usr/local/www/apache24/data/. I don't if there is some way to automatically set this.


----------



## SirDice (Feb 14, 2020)

balanga said:


> Installing the pkg sometimes deletes newer php modules which are already installed.


That means _you_ are doing something you shouldn't. You're most likely mixing quarterly packages with the latest ports. And you've been here long enough to know that's a bad idea. 



balanga said:


> Also the installation process seems to install www pkgs in /usr/local/www/


Yes, they're supposed to go there.



balanga said:


> whereas I prefer them to be in *DocumentRoot* - /usr/local/www/apache24/data/.


Don't use that directory, it's the default website from the Apache installation. Don't use the default configuration, create a _new_ default virtual host configuration and set it to what you need.

Create a /usr/local/etc/apache24/Includes/000_default.conf:

```
<VirtualHost _default_:80>

        ServerName default-site.example.com
        DocumentRoot /my/custom/web/default
        DirectoryIndex index.html index.php

        <Directory /my/custom/web/default>
                Require all granted
        </Directory>
</VirtualHost>
```

Then add more sites if you need them:
/usr/local/etc/apache24/Includes/010_mysite.conf

```
<VirtualHost *:80>

        ServerName mysite.example.com
        DocumentRoot /my/custom/web/mysite
        DirectoryIndex index.html index.php

        <Directory /my/custom/web/mysite>
                Require all granted
        </Directory>
</VirtualHost>
```


----------

