B
B
bls456652017-05-13 19:16:18
PHP
bls45665, 2017-05-13 19:16:18

How to resolve "input file specifed" error when using phpmyadmin with php-fpm in a chroot environment?

Good afternoon.

php7fpm + nginx via socket.

the php config is standard, the pool config too, the chroot is configured in the site folder and is designated as - /
the index.php of the site itself is running normally. getcwd() returns - /

current nginx config -

....
root /var/www;
location /pma
        {
                alias /var/www/phpmyadmin; #/usr/share/phpnyadmin тоже использовался#

                location ~ \.php$
                {
                        include fastcgi_params;
                        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                        fastcgi_index index.php;
                        fastcgi_param SCRIPT_FILENAME $request_filename;
                       #так же были использованны - 
                       #fastcgi_param SCRIPT_FILENAME /phpMyAdmin/$1;
                       #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       #fastcgi_param DOCUMENT_ROOT /var/www/phpMyAdmin/;

}

                location ~* \.(js|css|png|jpg|jpeg|gif|ico)$
                {
                        access_log off;
                        log_not_found off;
                        expires 1d;
                }
        }
....


Before that, I forwarded a soft link to /usr/share/phpmyadmin (to chroot/phpmyadmin ), but it didn't work. The output of the regular function scandir( "/phpmyadmin" ) from php was - false.
Then I did the same only using mount --bind. The output of scandir is now standard. Permissions on the chroot/phpmyadmin folder are the same as php-fpm.

i'm at a loss, output " php phpmyadmin/index.php " from chroot/ folder
PHP Warning:  require_once(./libraries/String.class.php): failed to open stream: No such file or directory in /var/www/phpmyadmin/libraries/common.inc.php on line 58
PHP Fatal error:  require_once(): Failed opening required './libraries/String.class.php' (include_path='.:/usr/share/php') in /var/www/phpmyadmin/libraries/common.inc.php on line 58

as I understand it, it launches it, but can no longer connect something else because of the chroot.

nginx log output per request
2017/05/13 18:42:21 [error] 1516#1516: *3 FastCGI sent in stderr: "Unable to open primary script: /var/www/phpmyadmin/index.php (No such file or directory)" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: localhost, request: "GET /pma/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "anyhost"


In general, it may be necessary to somehow configure everything differently when chrooting? without it - everything is ok.
Just do not suggest, please, to create a separate pool without chroot for phpmyadmin.

Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question