Internal Server Error immediately after install

I should preface this by saying that I am definitely not a web programmer, and that everything I know was learned in the last two days while trying to troubleshoot setting up a UNA server on an AWS EC2 instance.

I made it through the entire web server setup and UNA installation process, needing to alter or fix occasional pieces but on the whole not have any significant difficulties. However, immediately after removing the install folder from the html (my web-server directory) directory, I was met with a 500 Internal Server Error message (or more accurately, a blank webpage). I created a dummy index.php file and was able to view it's contents through my browser. After some trial and error I found that the line which seems to be causing an issue is:

$oTemplate = BxDolTemplate::getInstance();

in the page.php file. I checked to confirm, and the BxDolTemplate.php file is in the ./inc/classes/ folder. I made sure to follow all the procedures in the installation file (although I was never prompted to create cron jobs), and I ensure the system met the requirements.

Here are my system specs: Server version: Apache/2.4.25 (Amazon), mysql  Ver 14.14 Distrib 5.5.56, for Linux (x86_64) using readline 5.1, PHP 5.4.45 (cli), Kernel: Linux 4.9.20-11.31.amzn1.x86_64

Below are my (edited to provide checks) versions of the index.php and page.php scripts. I have not edited any other files within the UNA directory, aside from removing the install folder. I would greatly appreciate whatever help/advice anyone can give.

 

Index.php:

<?php
echo "hello world";
/**
 * Copyright (c) UNA, Inc - https://una.io
 * MIT License - https://opensource.org/licenses/MIT
 *
 * @defgroup    UnaCore UNA Core
 * @{
 */
if (!file_exists("./inc/header.inc.php")) {
    // this is dynamic page - send headers to not cache this page
    $now = gmdate('D, d M Y H:i:s') . ' GMT';
    header("Expires: $now");
    header("Last-Modified: $now");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    echo "It seems to be script is <b>not</b> installed.<br />\n";
    if ( file_exists( "install/index.php" ) ) {
        echo "Please, wait. Redirecting you to installation form...<br />\n";
        echo "<script language=\"javascript\">location.href = 'install/index.php';</script>\n";
    }
    exit;
}
echo "got this far";
require_once('./inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . "profiles.inc.php");
echo "and here";
if (!isLogged() && getParam('sys_site_splash_enabled')) {
    require_once("./splash.php");
    exit;
}
echo "we're almost done!";
$_GET['i'] = 'home';
echo "just one more!";
require_once("./page.php");
echo "we made it all the way!";
/** @} */

 

page.php:

<?php
/**
 * Copyright (c) UNA, Inc - https://una.io
 * MIT License - https://opensource.org/licenses/MIT
 *
 * @defgroup    UnaCore UNA Core
 * @{
 */
require_once('./inc/header.inc.php');
echo "made it one step forward";
echo "inside the page";
require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
echo "step two";
bx_import('BxDolLanguages');
echo "step three ";
check_logged();
echo "step four 4 ";
$oTemplate = BxDolTemplate::getInstance();
echo "step five V ";
/*
$oPage = BxDolPage::getObjectInstanceByURI();
if ($oPage) {
    $oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
    $oTemplate->setPageContent ('page_main_code', $oPage->getCode());
    $oTemplate->getPageCode();
} else {
    $oTemplate->displayPageNotFound();
}
*/
/** @} */

  • 1283
  • More
Replies (12)
    • After doing a little more searching around, including viewing the PHP errors, I found the following information:

      Fatal error: Can't use function return value in write context in /var/www/html/inc/classes/BxDolTemplate.php on line 364

      This is the line:

      $bEmbedly = !empty(getParam('sys_embedly_api_key')) && !empty(getParam('sys_embedly_api_pattern'));

      • I managed to figure out a solution. It turns out that when using PHP5.4, the empty() function can only take variables, whereas in PHP5.5 this line would have worked.

        As a note, if anyone else encounters this issue and doesn't want to update their PHP version, a simple fix is to rewrite it as such:

        $korinscustom1 = getParam('sys_embedly_api_key');
        $korinscustom2 = getParam('sys_embedly_api_patter');
        $bEmbedly = !empty($korinscustom1) && !empty($korinscustom2);

        It also might be worth updating the installation documentation to state that PHP5.5 must be used. I tried it initially with PHP5.6, but there were modules missing which I could not find a way to install myself.

        • my php is 7.4.8, and too, immediately after removing install folder it fails with 500 error , in error log i see that: 

          PHP message: PHP Notice:  Undefined index: sCurrentLanguage in /var/www/html/una/inc/classes/BxDolLanguages.php on line 195PHP message: PHP Fatal error:  Uncaught Less_Exception_Compiler: error evaluating function `rgba` color functions take numbers as parameters index: 4102 in /var/www/html/una/plugins/lessphp/Less.php:4799

          Stack trace:

          #0 /var/www/html/una/plugins/lessphp/Less.php(5694): Less_Tree_Call->compile()

          #1 /var/www/html/una/plugins/lessphp/Less.php(7917): Less_Tree_Expression->compile()

          #2 /var/www/html/una/plugins/lessphp/Less.php(6727): Less_Tree_Value->compile()

          #3 /var/www/html/una/plugins/lessphp/Less.php(6861): Less_Tree_Rule->compile()

          #4 /var/www/html/una/plugins/lessphp/Less.php(198): Less_Tree_Ruleset->compile()

          #5 /var/www/html/una/plugins/lessphp/Cache.php(170): Less_Parser->getCss()

          #6 /var/www/html/una/plugins/lessphp/Cache.php(106): Less_Cache::Cache()

          #7 /var/www/html/una/inc/classes/BxDolTemplate.php(2022): Less_Cache::Get()

          #8 /var/www/html/una/inc/classes/BxDolTemplate.php(2133): BxDolTemplate->_lessCss()

          #9 /var/www/html/una/inc/classes/BxDolTemplate.php(1362): BxDolTemplate->includeFil" while reading response header from upstream, client: ::1, server: _, request: "GET /una/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:"

          • Hello marinalan !

            Seems no any language has been installed. Please PM me with the URL of your site and Control Panel access details.

            • it is yet on localhost, on my personal computer.... I somehow managed with xdebug and visual studio to attempt to debug and get exception from line in inc/classes/BxDolTemplate.php, 2572

              that variable $aParts is not initialized

              if(!$sResult && @is_file(BX_DIRECTORY_PATH_ROOT . $aParts[0] . DIRECTORY_SEPARATOR . $aParts[1])) {

              •  was reaching localhsot / una / index.php   so it connects to database, loads classes - that works so far

                • Well, it needs to print the $sName parameter in this method to see what's wrong with it.

                  • I managed to install after second attempt on local (127.0.0.1) virtual host like http : //una  $sName as i was seeing in debugger yesterday ( do not already remember exact value) was something like html_tags.html, it did not contained '|' characters, that all was starting from view like 'home'.. Now I am on page like studio -> launcher my computer is Linux Ubuntu 18.04 server, so I have ff mpeg in /usr/bin/ffmpeg

                    I have new issue now: When i was doing Designer ->Cover or Designer -> Logo uploading image, it shows error for page like    una/image_transcoder.php?o=sys_cover_preview&h=4&dpx=1&t=1595269570

                    • And what error do you see? Do you have the storage folder with correct permissions?

                      • image_transcoder.php?o=sys_images_editor&h=351&dpx=1&t=1652415428

                        please need help since 2 days try to install UNA and always get this error.

                        thansk for your help

                        ( ! ) Fatal error: Uncaught Less_Exception_Compiler: variable @bx-page-width is undefined in file template-css-default.less in default.less on line 4, column 11 2| 3| .bx-def-page-width { 4| width:@bx-page-width; 5| } 6| 7| .bx-def-box-sizing { in plugins-wikimedia-less.php-lib-Less-Tree-Variable.php on line 48( ! ) Less_Exception_Compiler: variable @bx-page-width is undefined in file template-css-default.less in default.less on line 4, column 11 2| 3| .bx-def-page-width { 4| width:@bx-page-width; 5| } 6| 7| .bx-def-box-sizing { in plugins-wikimedia-less.php-lib-Less-Tree-Variable.php on line 48Call Stack#TimeMemoryFunctionLocation10.78053889808BxDolDb->pdoExceptionHandler( $oException = class Less_Exception_Compiler { public $currentFile = ['entryPath' => 'studio-template-css-', 'entryUri' => 'http:--192.168.2.94-studio-template-css-', 'rootpath' => 'studio-template-css-', 'currentDirectory' => 'template-css-', 'currentUri' => 'http:--192.168.2.94-template-css-default.less', 'filename' => 'template-css-default.less', 'uri_root' => 'http:--192.168.2.94-template-css-', 'reference' => TRUE]; public $index = 56; protected $input = '@import \'_mixins.less\';\n\n.bx-def-page-width {\n width:@bx-page-width;\n}\n\n.bx-def-box-sizing {\n .box-sizing(border-box);\n}\n\n.bx-def-align-center {\n display: -webkit-flex !important;\n display: flex !important;\n\n -webkit-justify-content: center;\n justify-content: center;\n\n -webkit-align-items: center;\n align-items: center;\n}\n\n.bx-def-valign-center {\n display: -webkit-flex !important;\n display: flex !important;\n\n -webkit-align-items: center;\n align-items: center;\n}\n\n-* margins'...; protected $details = []; protected $message = 'variable @bx-page-width is undefined in file template-css-default.less in default.less on line 4, column 11\n2| \n3| .bx-def-page-width {\n4| width:@bx-page-width;\n5| }\n6| \n7| .bx-def-box-sizing {'; private ${Exception}string = ''; protected $code = 0; protected $file = 'plugins-wikimedia-less.php-lib-Less-Tree-Variable.php'; protected $line = 48; private ${Exception}trace = [0 => [...], 1 => [...], 2 => [...], 3 => [...], 4 => [...], 5 => [...], 6 => [...], 7 => [...], 8 => [...], 9 => [...], 10 => [...], 11 => [...], 12 => [...]]; private ${Exception}previous = NULL; public $xdebug_message = '( ! ) Less_Exception_Compiler: variable @bx-page-width is undefined in file template-css-default.less in default.less on line 4, column 11\n2| \n3| .bx-def-page-width {\n4| width:@bx-page-width;\n5| }\n6| \n7| .bx-def-box-sizing { in plugins-wikimedia-less.php-lib-Less-Tree-Variable.php on line 48

                        • Hello @CarlosSV !

                          May you plz specify on what step did you meet it? Also what PHP version do you use?

                          • Thanks LeonidS on replay me.

                            PHP 7.4.29 (cli) (built: Apr 12 2022 10:55:38) ( NTS )

                            Copyright (c) The PHP Group

                            Zend Engine v3.4.0, Copyright (c) Zend Technologies

                                with Zend OPcache v7.4.29, Copyright (c), by Zend Technologies

                                with Xdebug v3.1.3, Copyright (c) 2002-2022, by Derick Rethans

                            I get this error when try to access /studio/launcher.php i can't go further

                            again thanks

                            Login or Join to comment.