S
S
Sergey2016-09-23 17:09:03
linux
Sergey, 2016-09-23 17:09:03

How to open phpMyAdmin from your php file?

It costs ubuntu server 16.04, nginx, php 7, mysql and phpMyAdmin.
If you do not use a single entry point, and this is mine

location / {
    #root wiki;
    try_files $uri $uri/ /index.php?$args;
}

phpMyAdmin works fine, /var/log/nginx/error.log doesn't work with it
2016/09/23 15:39:46 [error] 5805#5805: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  
require_once(./libraries/vendor_config.php): failed to open stream: No such file or directory 
in /var/www/html/phpmyadmin/libraries/common.inc.php on line 72
PHP message: PHP Fatal error:  require_once(): Failed opening 
required './libraries/vendor_config.php' (include_path='.:/usr/share/php') in 
/var/www/html/phpmyadmin/libraries/common.inc.php on line 72" while reading 
response header from upstream, client: 178.187.64.1, server: www.domain.com, 
request: "GET /bd HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", 
host: "www.domain.com"

I open like this
require('./phpmyadmin/index.php');

Is it possible to fix it? I just want to make phpmyadmin (login window) accessible via login on the site (so that only the admin can access this page).
There is an answer here How can I open access to phpmyadmin in rewrite? , but I do not know if it is relevant, and not exactly what I want.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem, 2016-09-23
@chelovekmuravei

Adminer.php will not work? A very handy thing.

S
Sergey, 2016-09-25
@chelovekmuravei

You can install phpmyadmin via apt-get, and set a link to it ln -s to the root of the site
or download and upload to the right place, but then you need to specify all the data for this folder in the nginx config, example location ~ / phpmyadmin { index file, settings php, normal setup without a single access point... }, you don't need to do this in the first option, phpmyadmin will open like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question