Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

templates/ directory not found but is there #16184

Closed
rodiusd opened this issue Jun 10, 2020 · 15 comments
Closed

templates/ directory not found but is there #16184

rodiusd opened this issue Jun 10, 2020 · 15 comments
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@rodiusd
Copy link

rodiusd commented Jun 10, 2020

Describe the bug

PHP Fatal error:  Uncaught Twig\Error\LoaderError: The "templates/" directory does not exist ("/templates/"). in /www/httpphp/htdocs/phpmyadmin/vendor/twig/twig/src/Loader/FilesystemLoader.php:106
Stack trace:
#0 /www/httpphp/htdocs/phpmyadmin/vendor/twig/twig/src/Loader/FilesystemLoader.php(87): Twig\Loader\FilesystemLoader->addPath('templates/', '__main__')
#1 /www/httpphp/htdocs/phpmyadmin/vendor/twig/twig/src/Loader/FilesystemLoader.php(45): Twig\Loader\FilesystemLoader->setPaths(Array)
#2 /www/httpphp/htdocs/phpmyadmin/libraries/classes/Template.php(65): Twig\Loader\FilesystemLoader->__construct('templates/')
#3 /www/httpphp/htdocs/phpmyadmin/libraries/classes/Theme.php(98): PhpMyAdmin\Template->__construct()
#4 /www/httpphp/htdocs/phpmyadmin/libraries/classes/Theme.php(168): PhpMyAdmin\Theme->__construct()
#5 /www/httpphp/htdocs/phpmyadmin/libraries/classes/ThemeManager.php(305): PhpMyAdmin\Theme::load('./themes/metro')
#6 /www/httpphp/htdocs/phpmyadmin/libraries/classes/ThemeManager.php(89): PhpMyAdmin\ThemeManager->loa in /www/httpphp/htdocs/phpmyadmin/vendor/twig/twig/src/Loader/FilesystemLoader.php on line 106

To Reproduce

Steps to reproduce the behavior:

  1. unzip product in apache docs directory phpmyadmin
  2. run webbrowser to /phpmyadmin/setup/index.php
  3. got "500 internal server error"
  4. errorlog entries are shown above

Expected behavior

running setup

Screenshots

N/A

Server configuration

  • Operating system: i5/OS
  • Web server: apache 2.4
  • Database version: MariaDB
  • PHP version: 7.3.25
  • phpMyAdmin version:
    5.0.2

Client configuration

  • Browser: firefox
  • Operating system: win10

Additional context

user who is running the apache has full authority (777) to htdocs/phpmyadmin directory tree and all doc in it.

@williamdes
Copy link
Member

Could you try to edit

$loader = new FilesystemLoader(self::BASE_PATH);
and set a full path ?

@williamdes williamdes added the question Used when we need feedback from the submitter or when the issue is a question about PMA label Jun 10, 2020
@williamdes williamdes added this to Needs triage in Questions via automation Jun 10, 2020
@williamdes williamdes moved this from Needs triage to Needs a second check to be a bug in Questions Jun 10, 2020
@rodiusd
Copy link
Author

rodiusd commented Jun 10, 2020 via email

@williamdes
Copy link
Member

Can you give me as much information as possible on your setup so I can try to reproduce this issue ?
Something is wrong and I would like to be able to understand it to make a good fix.

@rodiusd
Copy link
Author

rodiusd commented Jun 10, 2020 via email

@williamdes
Copy link
Member

Hi

Thank you for the explanation
I would like you to remove $cfg['ServerDefault'] = 1; to see if the issue is fixed, some users reported that had solved the chdir php error for some reason

William

@rodiusd
Copy link
Author

rodiusd commented Jun 10, 2020 via email

@williamdes
Copy link
Member

Hi,
I have a solution that will work for you until we release a fix.
Edit $this->_CWD = getcwd();in libraries/classes/Response.php by $this->_CWD = '/www/httpphp/htdocs/phpmyadmin/';
That should solve this issue for you :)

@rodiusd
Copy link
Author

rodiusd commented Jun 10, 2020 via email

@williamdes
Copy link
Member

Hi,
When this issue will be closed and when the next release will be available :)

Kind regards,
William

@williamdes williamdes added this to the 5.0.3 milestone Jun 10, 2020
@williamdes williamdes added Bug A problem or regression with an existing feature and removed question Used when we need feedback from the submitter or when the issue is a question about PMA labels Jun 10, 2020
@williamdes williamdes removed this from Needs a second check to be a bug in Questions Jun 10, 2020
@williamdes williamdes added this to Needs triage in issues via automation Jun 10, 2020
@williamdes williamdes moved this from Needs triage to Not reproduced in issues Jun 10, 2020
@ibennetch
Copy link
Member

@rodiusd
Copy link
Author

rodiusd commented Jun 10, 2020 via email

williamdes added a commit to williamdes/phpmyadmintest that referenced this issue Jun 10, 2020
Reverts: phpmyadmin@3b2c2ec
Fixes: phpmyadmin#16184

Since phpmyadmin#6167 I do not see any good reason why to keep such code.

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit to williamdes/phpmyadmintest that referenced this issue Jun 10, 2020
Reverts: phpmyadmin@3b2c2ec
Fixes: phpmyadmin#16184

Since phpmyadmin#6167 I do not see any good reason why to keep such code.

Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Jun 10, 2020
@williamdes williamdes self-assigned this Jun 11, 2020
williamdes added a commit that referenced this issue Jun 11, 2020
Pull-request: #16187
Fix: #16184

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Jun 11, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Member

Hi Danny,

Could you please try to apply ddb66ad and let us know if everything is still okay and working ?

This fix will be part of the 5.0.3 version when it is released.

issues automation moved this from Not reproduced to Closed Jun 11, 2020
@rodiusd
Copy link
Author

rodiusd commented Jun 12, 2020 via email

@williamdes
Copy link
Member

Hi,

I am very happy to know that this solution works for you :)

Have a question in using the ROOT_PATH constant. nl. where is this set?

It is set in quite some places, you can see more about that here: https://github.com/phpmyadmin/phpmyadmin/pull/14806/files
It was added in #14806

Will this not give a problem when we try to use a virtual host in the apache to keep the pma install out of the normal server docs directory from the webserver?

I do not think this will be an issue, I never had issues with this event on strange setups.

William

@rodiusd
Copy link
Author

rodiusd commented Jun 12, 2020 via email

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
issues
  
Closed
Development

No branches or pull requests

3 participants