Re: [Postfixadmin-devel] Blank domain.tld/setup.php page nothing in logs
Brought to you by:
christian_boltz,
gingerdog
From: Danny H. <dho...@gm...> - 2019-03-28 23:49:27
|
Hello, Not a problem, I fully understand, and i am gratefull you are helping me :) It is a real headscratcher. And i am in for some crazy ideas :) On Wed, 2019-03-27 at 22:52 +0100, Christian Boltz wrote: > Hello, > > sorry for the late reply, but I'm running out of ideas... > > That said, maybe we should switch to the crazy ideas ;-) > > Am Dienstag, 12. März 2019, 00:23:54 CET schrieb Danny Houtworm: > > On Mon, 2019-03-11 at 23:10 +0100, Christian Boltz wrote: > > > This indicates that require_once() can read config.inc.php. > > > > > > To confirm that, please introduce a syntax error in > > > config.inc.php, > > > and > > > then run setup.php on the commandline again. You should see a > > > message > > > about that syntax error. > > > > I added some gibberish to the config.inc.php file and i indeed get > > a > > Syntax errors :) > > > > [houtworm@server ~]$ sudo -u http php > > /usr/share/webapps/postfixAdmin/public/setup.php > > PHP Parse error: syntax error, unexpected 'ik' (T_STRING) in > > /usr/share/webapps/postfixAdmin/config.inc.php on line 17 > > [houtworm@server ~]$ > > OK, so config.inc.php is readable and gets included, and "only" the > check fails for some strange reason. > > Repeat that test with config.local.php to ensure it also gets used. > I repeated it twice, It gives an error at the first following setting, Maybe this is a problem somehow Line 32 and 39 where these 2 lines at that moment. with the non local config file it gave a syntax error for the line i typed the gibberish, This does not match up, maybe something is wrong here. 32 global $CONF; 39 $CONF['configured'] = true; But i think those are alright. Not sure why it gives a syntax error [houtworm@server ~]$ sudo nano /usr/share/webapps/postfixAdmin/config.inc.php [houtworm@server ~]$ sudo -u http php /usr/share/webapps/postfixAdmin/public/setup.php PHP Parse error: syntax error, unexpected 'global' (T_GLOBAL) in /usr/share/webapps/postfixAdmin/config.inc.php on line 32 [houtworm@server ~]$ sudo nano /usr/share/webapps/postfixAdmin/config.inc.php [houtworm@server ~]$ sudo -u http php /usr/share/webapps/postfixAdmin/public/setup.php PHP Parse error: syntax error, unexpected '$CONF' (T_VARIABLE) in /usr/share/webapps/postfixAdmin/config.inc.php on line 39 [houtworm@server ~]$ > > > One idea I have is the way how setup.php checks for > > > config.local.php: > > > $file_config = file_exists(realpath("./../config.inc.php")); > > > > > > $file_local_config = > > > > > > file_exists(realpath("./../config.local.php")); > > > > > > Note the realpath() call, which means resolving all symlinks. > > > Does the path /usr/share/webapps/postfixAdmin/public/ include any > > > symlinked part? > > > > In /postfixAdmin only .htaccess is symlinked > > > > in /public only password-change.php and password-recover.php are > > symlinked > > > > The config files where both symlinked because i copied local from > > inc, > > i removed both and made new files for them to ensure they are not > > symlinked. I did this before but it did not help, Maybe the inc > > file > > needs to be symlinked? > > There's no requirement that config.*.php has to be a symlink (but > having > them as symlink can be useful so that you can have the actual files > in > /etc/postfixadmin/ - that's nice for distro packaging and being FHS > compliant) > > > > If in doubt, add > > > > > > echo "\n\n file_config: $file_config local > > > $file_local_config > > > \n\n" > > > to setup.php (directly under the lines quoted above) and check > > > the > > > result. > > > > I edited it like this > > /usr/share/webapps/postfixAdmin/public/setup.php > > > > 56 $file_config = file_exists(realpath("./../config.inc.php")); > > 57 $file_local_config = > > file_exists(realpath("./../config.local.php")); 58 echo "\n\n > > file_config: $file_config local $file_local_config 59 > \n\n"; > > 60 $error = 0; > > > > terminal output > > > > [houtworm@server ~]$ sudo -u http php > > /usr/share/webapps/postfixAdmin/public/setup.php > ... > > file_config: local > > So both variables are False/empty which means that file_exists() > thinks > the files don't exist. > > Let's try some more debugging code (add it at the same place): > > echo "\n realpath of config files:\n"; > echo realpath("./../config.inc.php"); > echo "\n"; > echo realpath("./../config.local.php"); > > > Then finding that file is the only thing that matters, Very strange > > it > > does not see it. > > Well, the fact that introducing a syntax error triggers an error > means > that the code finds the config files, but the checks in setup.php > don't. > > There might be a crazy "fix": adjust setup.php and change > > $file_config = file_exists(realpath("./../config.inc.php")); > $file_local_config = file_exists(realpath("./../config.local.php")); > > to > > # fake test results > $file_config = True; > $file_local_config = True; > > This will obviously avoid the test failure, but since we know that > the > config files get included successfully, it's worth a try ;-) I think this fixed it :) [houtworm@server ~]$ sudo -u http php /usr/share/webapps/postfixAdmin/public/setup.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="css/default.css" /> <title>Postfix Admin - PHP Notice: Undefined index: HTTP_HOST in /usr/share/webapps/postfixAdmin/templates/header.php on line 22 </title> </head> <body> <div id="login_header"> <img id="login_header_logo" src="images/logo-default.png" /> </div> <div class='setup'> <h2>Postfix Admin Setup Checker</h2> <p>Running software: <ul> realpath of config files: <li>PHP version 7.3.3</li> </ul><p>Checking for dependencies: <ul> <li>Magic Quotes: Disabled - OK</li> <li>Depends on: presence config.inc.php - OK</li> <li>Checking $CONF['configured'] - OK <li>Depends on: presence config.local.php - OK</li> <li>Depends on: MySQL 4.1 - OK </li><li>Depends on: PostgreSQL - OK <br>(change the database_type to 'pgsql' in config.local.php if you want to use PostgreSQL) </li><li>Testing database connection (using mysqli) - OK</li><li>Depends on: session - OK</li> <li>Depends on: pcre - OK</li> <li>Depends on: multibyte string - OK</li> <li>Depends on: IMAP functions - OK</li> </ul><p>Everything seems fine... attempting to create/update database structure</p> <p>Database is up to date: 1840/0 </p> <div class="standout"></div> <div id="edit_form"> <form name="setuppw" method="post" action="setup.php"> <input type="hidden" name="form" value="setuppw" /> <table> <tr> <td colspan="3"><h3>Change setup password</h3></td> </tr> <tr> <td><label for="setup_password">Setup password</label></td> <td><input class="flat" type="password" name="setup_password" value="" /></td> <td></td> </tr> <tr> <td><label for="setup_password2">Setup password (again)</label></td> <td><input class="flat" type="password" name="setup_password2" value="" /></td> <td></td> </tr> <tr> <td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="Generate password hash" /></td> </tr> </table> </form> </div> <b>Since version 2.3 there is no requirement to delete setup.php!</b><br /> <b>Check the config.inc.php file for any other settings that you might need to change!<br /> </div> </body> </html> [houtworm@server ~]$ So that looks great :) But i still get a white page So i guess the PHP error was not the only problem Are there more vital PHP pages that need to be able to get loaded? Maybe it lies in the Nginx config now, Maybe even in the postfix or dovecot settings, i had some updates, Maybe i should try to run the tutorial again just in case? Anyway, we have some progress :) Greets Danny > > > Regards, > > Christian Boltz |