Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

PhpMyAdmin showing error after clean installation #19

Closed
choutman opened this issue Oct 21, 2020 · 2 comments
Closed

PhpMyAdmin showing error after clean installation #19

choutman opened this issue Oct 21, 2020 · 2 comments
Labels

Comments

@choutman
Copy link

Hi,

Today I ran into an error after installing phpmyadmin using this ansible role. The error:

Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.

session_start(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/:/usr/share/php/PhpMyAdmin/:/usr/share/php/Symfony/:/usr/share/php/Twig/:/usr/share/php/Twig-Extensions/:/usr/share/php/ReCaptcha/:/usr/share/php/Psr/Container/:/usr/share/php/Psr/Cache/:/usr/share/php/Psr/Log/:/usr/share/php/Psr/SimpleCache/)

session_start(): Failed to initialize storage module: files (path: )

Used versions:
OS: Ubuntu 20.04
Ansible: 2.10.2

I also used the following roles:
roles:
- geerlingguy.mysql
- geerlingguy.apache
- geerlingguy.php
- geerlingguy.phpmyadmin

I was able to fix the issue with the following tasks:

- name: check phpmyadmin is fixed
      command:
        cmd: "grep -e 'php_admin_value open_basedir .*:/tmp/' /etc/phpmyadmin/apache.conf"
      register: isPhpMyAdminFixed
      ignore_errors: true
    - name: fix phpmyadmin installation
      lineinfile:
        path: "/etc/phpmyadmin/apache.conf"
        state: present
        regexp: 'php_admin_value open_basedir (.*)'
        line: '\tphp_admin_value open_basedir \1:/tmp/'
        backrefs: yes
      when: isPhpMyAdminFixed.failed

It has been a while since I used Ansible, so I don't know if this is the proper way to fix this issue. But at least it fixed my issue.

@stale
Copy link

stale bot commented Jan 19, 2021

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Jan 19, 2021
@stale
Copy link

stale bot commented Feb 19, 2021

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant