Menu

Getting Error After Smarty3 Upgrade with PFA 3.1.

2018-02-05
2018-02-15
  • Janketh Jay

    Janketh Jay - 2018-02-05

    Hello All,

    Firstly, thank you very much for this awesome project! I've been using it for quite some time and recommend it to many, MANY others. So, thanks again!

    On to my "issue"... As the topic suggests, I've recently begun seeing the following error (along with a blank login page):

    PHP Fatal error: Undefined class constant 'SCOPE_BUBBLE_UP' in /usr/local/www/postfixadmin/smarty/libs/sysplugins/smarty_internal_runtime_subtemplate.php on line 114

    I've dug around through forums and mailing lists but haven't found anything regarding this error (so my assumption is that something, somewhere must be misconfigured (was working fine just last week...)). So, I was hoping someone might be able to point me in the right direction to figure this out. Versions of related software are as follows:

    PostfixAdmin 3.1
    Apache 2.4.29
    PHP 5.6.33
    Smarty 3.1.30
    (If there's anything else you need, please let me know).

    Regards,
    Janketh Jay, III

     
  • GingerDog

    GingerDog - 2018-02-05

    That file doesn't exist in the latest version of postfixadmin (git master; not officially released); Can you try running/using 'master' from github ? (that was moving to Smarty 3.1.31). See https://github.com/postfixadmin/postfixadmin/commit/14ec596cbfebc27bb8066e0ce870e68d53e00de9

     
  • Janketh Jay

    Janketh Jay - 2018-02-12

    Thank you for the the reply. I did pull the latest master you've suggested and I've tried to run "setup.php" (which needed some editing to work due to errors with "/" prefixes to variables). The setup/upgrade appears to run fine but it doesn't look like it's upgrading the database. I receive the following error when I visit the login.php page (after visiting setup.php, of course):

    ERROR: The PostfixAdmin database layout is outdated (you have r1836, but r1837 is expected). Please run setup.php to upgrade the database.

     
  • GingerDog

    GingerDog - 2018-02-12

    Hi - can you elabourate on what you mean by '"/" prefixes to variables' ?

    Check your apache error log (e.g. /var/log/apache2/error.log) - it may contain some hints as to what's going on.

     
  • Janketh Jay

    Janketh Jay - 2018-02-15

    Hi GingerDog,

    Thanks again for replying. To elaborate, I'll show you what I've done (after overwriting the old files with the files from master):

    With the new files in place, when I visit the PFA URL, I see:

    ERROR: The PostfixAdmin database layout is outdated (you have r1836, but r1837 is expected). Please run setup.php to upgrade the database. 
    

    When I visit the PFA URL /setup.php, I see a blank page with the below in the Apache logs:

    PHP Notice:  Undefined variable: incpath in /usr/local/www/postfixadmin/setup.php on line 32
    PHP Warning:  require(/templates/header.php): failed to open stream: No such file or directory in /usr/local/www/postfixadmin/setup.php on line 32
    PHP Fatal error:  require(): Failed opening required '/templates/header.php' (include_path='.:/usr/local/share/pear:/usr/local/share/smarty3') in /usr/local/www/postfixadmin/setup.php on line 32
    

    Looking at the setup.php file and the lines it is warning and failing on, there is a leading "/" in the path. I've found if I remove the leading slash (or add a "." (IE: ./templates), it then finds the files in the local/docroot directory. That is when I am able to see what appears to be PFA running the setup and upgrade scripts which produce the following output:

    Postfix Admin Setup Checker
    
    Running software:
    
        PHP version 5.6.33
        Apache
    
    Checking for dependencies:
    
        Magic Quotes: Disabled - OK
        Depends on: presence config.inc.php - OK
        Checking $CONF['configured'] - OK
        Depends on: presence config.local.php - OK
        Depends on: MySQL 3.23, 4.0 - OK
        Depends on: MySQL 4.1 - OK
        Depends on: SQLite - OK
        (change the database_type to 'sqlite' in config.local.php if you want to use SQLite)
        Testing database connection (using mysqli) - OK
        Depends on: session - OK
        Depends on: pcre - OK
        Depends on: multibyte string - OK
        Depends on: IMAP functions - OK
    
    Everything seems fine... attempting to create/update database structure
    
    Database is up to date
    

    However, I still see in the Apache log file:

     PHP Notice:  Undefined variable: incpath in /usr/local/www/postfixadmin/setup.php on line 32
    PHP Notice:  Undefined variable: incpath in /usr/local/www/postfixadmin/setup.php on line 133
    PHP Notice:  Undefined variable: incpath in /usr/local/www/postfixadmin/setup.php on line 330
    

    After seeing the upgrade was success, I then return to the login page and am presented again with:

    ERROR: The PostfixAdmin database layout is outdated (you have r1836, but r1837 is expected). Please run setup.php to upgrade the database. 
    

    So, the database is certainly not being updated which I'm assuming is due to my (obviously) limited knowledge of PHP (or why the files aren't found in the ./ directory correctly?). However, that's as far as I have gotten with the testing of master.

    I hope the above is helpful. If not, let me know if there is anything else I can provide. Otherwise, I can always wait until the official release that supports the new Smarty version to be ported.

    Thanks again!

    Regards,
    Janky Jay, III

     
  • GingerDog

    GingerDog - 2018-02-15

    Hmm ... well, the files from github/master currently have e.g. setup.php living in the public/ directory, so I suspect you need to something like :

    mv /usr/local/www/postfixadmin /usr/local/www/postfixadmin.old
    git clone git@github.com:postfixadmin/postfixadmin.git /usr/local/www/postfixadmin
    cp /usr/local/www/postfixadmin.old/config.local.php /usr/local/www/postfixadmin/
    chmod 777 /usr/local/www/postfixadmin/templates_c

    and then also reconfigure your webserver to serve files out of /usr/local/www/postfixadmin/public and not /usr/local/www/postfixadmin/

    then try setup.php again?

     

Log in to post a comment.