Page 1 of 1

problem after installation

Posted: Sun Dec 02, 2018 2:30 pm
by bmullan
Ubuntu 16.04
mysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64)
Server version: Apache/2.4.18

After installation & modification of

I try to access nuBuilder using firefox

http://10.105.172.82/

and I see the following:
\n"; } function nuCSSIndexInclude($pfile){ $timestamp = date("YmdHis", filemtime($pfile)); //-- Add timestamp so JavaScript changes are effective immediately print "\n"; } function nuHeader(){ $getHTMLHeaderSQL = "SELECT set_header FROM zzzzsys_setup WHERE zzzzsys_setup_id = 1 "; $rs = nuRunQuery($getHTMLHeaderSQL); $obj = db_fetch_object($rs); $HTMLHeader = $obj->set_header; $j = "\n\n" . $HTMLHeader . "\n\n"; return $j; } nuJSIndexInclude($_SESSION['nubuilder_session_data']['JQ_PATH']); nuJSIndexInclude('nuformclass.js'); nuJSIndexInclude('nuform.js'); nuJSIndexInclude('nuformdrag.js'); nuJSIndexInclude('nucalendar.js'); nuJSIndexInclude('nucommon.js'); nuJSIndexInclude('nureportjson.js'); nuJSIndexInclude('nuajax.js'); //-- calls to server nuCSSIndexInclude('nubuilder4.css'); ?>
Any idea what I may have done wrong?
brian

Re: problem after installation

Posted: Sun Dec 02, 2018 2:48 pm
by bmullan
Just in case it was a problem with the version of MySQL I removed MySQL and installed MariaDB.

Then used Chrome to try to access nuBuilder and I get:
<?php

require_once('nuchoosesetup.php');
require_once('nuindexlibs.php');

if ( !$_SESSION['nubuilder_session_data']['PLUGIN'] ) {
require_once('nustandalonesetuplibs.php');
nuStandaloneImportNewDB();
}

if ( $_SESSION['nubuilder_session_data']['PLUGIN'] && !isset($_SESSION['nubuilder_session_data']['SESSION_ID']) ) {
require_once('nuwordpresssetuplibs.php');
nuCheckWPUser();
}

require_once('nusystemupdatelibs.php');
nuMigrateSQL();
?>
<!DOCTYPE html>
<html onclick="nuClick(event)">
<head>
<title>nuBuilder 4</title>
<meta http-equiv='Content-type' content='text/html;charset=UTF-8'>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<?php

function nuJSIndexInclude($pfile){

//$timestamp = date("YmdHis", filemtime($pfile)); //-- Add timestamp so JavaScript changes are effective immediately
$timestamp = date("YmdHis");
print "<script src='$pfile?ts=$timestamp' type='text/javascript'></script>\n";
}

function nuCSSIndexInclude($pfile){

$timestamp = date("YmdHis", filemtime($pfile)); //-- Add timestamp so JavaScript changes are effective immediately
print "<link rel='stylesheet' href='$pfile?ts=$timestamp' />\n";
}

function nuHeader(){

$getHTMLHeaderSQL = "SELECT set_header FROM zzzzsys_setup WHERE zzzzsys_setup_id = 1 ";
$rs = nuRunQuery($getHTMLHeaderSQL);
$obj = db_fetch_object($rs);
$HTMLHeader = $obj->set_header;
$j = "\n\n" . $HTMLHeader . "\n\n";
return $j;
}

nuJSIndexInclude($_SESSION['nubuilder_session_data']['JQ_PATH']);

nuJSIndexInclude('nuformclass.js');
nuJSIndexInclude('nuform.js');
nuJSIndexInclude('nuformdrag.js');
nuJSIndexInclude('nucalendar.js');
nuJSIndexInclude('nucommon.js');
nuJSIndexInclude('nureportjson.js');
nuJSIndexInclude('nuajax.js'); //-- calls to server
nuCSSIndexInclude('nubuilder4.css');
?>

<script>

<?php echo $_SESSION['nubuilder_session_data']['PLUGIN'] ? 'var $ = jQuery;' : ''; ?>

function nuValidCaller(o){

if(o === null){return false;}
return o.hasOwnProperty('nuVersion');
}

function nuHomeWarning(){

if(window.nuEDITED){
return nuTranslate('Leave this form without saving ?')+' '+nuTranslate('Doing this will return you to the login screen.');
}
return nuTranslate('Doing this will return you to the login screen.');
}

function nuLoginRequest(u, p){

$.ajax({
async : true,
dataType : "json",
url : "nuapi.php",
method : "POST",
data : {nuSTATE :
{call_type : 'login',
username : arguments.length == 0 ? $('#nuusername').val() : u,
password : arguments.length == 0 ? $('#nupassword').val() : p,
login_form_id : nuLoginF,
login_record_id : nuLoginR}
},
dataType : "json",
success : function(data,textStatus,jqXHR){

if(nuDisplayError(data)){
if(data.log_again == 1){location.reload();}
} else {
window.nuFORM.addBreadcrumb();
var last = window.nuFORM.getCurrent();
last.call_type = 'getform';
last.form_id = data.form_id;
last.record_id = data.record_id;
last.filter = data.filter;
last.search = data.search;

if(parent['nuHashFromEditForm']===undefined){
last.hash = [];
}else{
last.hash = parent.nuHashFromEditForm();
}

last.FORM = data.form;
nuBuildForm(data);
}
},
error : function(jqXHR,textStatus,errorThrown){

var msg = String(jqXHR.responseText).split("\n");
nuMessage(msg);
window.test = jqXHR.responseText;

nuFormatAjaxErrorMessage(jqXHR, errorThrown);

},
});
}

window.nuVersion = 'nuBuilder4';
window.nuDocumentID = Date.now();

if(parent.window.nuDocumentID == window.nuDocumentID){
window.onbeforeunload = nuHomeWarning;
}
window.nuHASH = [];

<?php
$nuWelcomeBodyInnerHTML = (isset($nuWelcomeBodyInnerHTML)?$nuWelcomeBodyInnerHTML:'');
$welcome = addslashes($nuWelcomeBodyInnerHTML);
$nuHeader = nuHeader();
$opener = '';
$search = '';
$iframe = '';
$target = '';
$l = scandir('graphics');
$f = JSON_encode($l);
$nuBrowseFunction = 'browse';
$like = '';
$nuUser = '';
$nuPassword = '';
$nuForm = '';
$nuRecord = '';
$nuHome = '';

//-- $_GETS are sanitized in nuchoosesetup.php

if(isset($_GET['u'])) {$nuUser = $_GET['u'];}
if(isset($_GET['p'])) {$nuPassword = $_GET['p'];}
if(isset($_GET['f'])) {$nuForm = $_GET['f'];}
if(isset($_GET['r'])) {$nuRecord = $_GET['r'];}
if(isset($_GET['h'])) {$nuHome = $_GET['h'];}

if(isset($_GET['opener'])) {$opener = $_GET['opener'];}
if(isset($_GET['search'])) {$search = $_GET['search'];}
if(isset($_GET['iframe'])) {$iframe = $_GET['iframe'];}
if(isset($_GET['target'])) {$target = $_GET['target'];}
if(isset($_GET['like'])) {$like = $_GET['like'];}
if(isset($_GET['browsefunction'])) {$nuBrowseFunction = $_GET['browsefunction'];}

$h1 = "
window.nuLoginU = '$nuUser';
window.nuLoginP = '$nuPassword';
window.nuLoginF = '$nuForm';
window.nuLoginR = '$nuRecord';
window.nuLoginH = '$nuHome';
window.nuGraphics = $f;
window.nuIsWindow = '$iframe';
window.nuImages = [];
";

if ( $_SESSION['nubuilder_session_data']['PLUGIN'] ) {
$h1 .= "\nwindow.nuWordpress = true;\n";
$p = true;
} else {
$h1 .= "\nwindow.nuWordpress = false;\n";
$p = false;
}

$s = isset($_SESSION['nubuilder_session_data']['SESSION_ID']);



if ( $nuUser != '' && $nuPassword != '' ){
$h2 = nuUseUP($nuBrowseFunction, $target, $welcome, $nuUser, $nuPassword);
}else{

if($p){

if($s){
$h2 = nuGetJS_action_screen($nuBrowseFunction, $target, $welcome, $opener, $search, $like);
}else{
$h2 = nuGetJS_plugin_login($nuBrowseFunction, $target);
}

}else{

if($opener == ''){
$h2 = nuGetJS_standalone_login($nuBrowseFunction, $target, $welcome);
}else{
$h2 = nuGetJS_action_screen($nuBrowseFunction, $target, $welcome, $opener, $search, $like);
}

}
}

// end choose h2

$h3 = "
function nuResize(){

if($('#nuTabHolder').css('display') == 'block'){
$('#nuActionHolder').css('width', window.innerWidth);
$('#nuBreadcrumbHolder').css('width', window.innerWidth);
$('#nuTabHolder').css('width', window.innerWidth);
}

}
</script>
<script id='nuheader'>
$nuHeader
</script>
<script>
";

$h = $h1.$h2.$h3;
print $h;
?>
</script>
</head>
<?php
nuLoadBody();
//nuLoadBody(true);
?>
</body>
</html>

Re: problem after installation

Posted: Sun Dec 02, 2018 4:50 pm
by bmullan
After enabling PHP display errors and startup errors in "/etc/php/7.2/apache2/php.ini".

When I try to login to nuBuilder I get:

Fatal error: Uncaught Error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in /var/www/nubuilder/nudatabase.php:11 Stack trace: #0 /var/www/nubuilder/nuchoosesetup.php(21): require_once() #1 /var/www/nubuilder/index.php(3): require_once('/var/www/nubuil...') #2 {main} thrown in /var/www/nubuilder/nudatabase.php on line 11


my nuconfig.php is:
# more nuconfig.php
<?php

$nuConfigDBHost = "127.0.0.1";
$nuConfigDBName = "nubuilder4";
$nuConfigDBUser = "root";
$nuConfigDBPassword = "xxxxxxxx";
$nuConfigDBGlobeadminUsername = "bmullan"; //-- globeadmin username
$nuConfigDBGlobeadminPassword = "xxxxxxxx"; //-- globeadmin password
$nuConfigTitle = "nuBuilder 4";
$nuConfigIsDemo = false;
$nuConfigTimeOut = 1440;
/* $nuWelcomeBodyInnerHTML = "


<div id='outer' style='width:100%'>

<div id='login' class='nuLogin'>
<table>
<tr>
<td align='center' style='text-align:center;height:50px' colspan='2'>
<div id='nulogo' style='margin:50px 0px 20px 65px;background-size:100% 100%;background-image:url(\"graphics/logo.png\");width
:200px;height:80px;'></div>
</td>
</tr>
<tr>
<td style='text-align:right;margin:0px 5px 0px 20px;'><span style='padding:0px 5px 0px 40px;'>Username</span></td>
<td style='text-align:left'><input id='nuusername'/></td>
</tr>
<tr>
<td style='text-align:right;margin:0px 5px 0px 20px;'><span style='padding:0px 5px 0px 40px;'>Password</span></td>
<td style='text-align:left'><input id='nupassword' type='password' onkeypress='nuSubmit(event)'/></td>
</tr>
<tr>
<td style='text-align:center' colspan='2'>
<input id='submit' type='button' class='nuButton' style='margin:20px 0px 0px 50px;width:90px;height:30px;' onclick='nuLoginR
equest()' value='Log in'/>
</td>
</tr>
</table>
</div>

</div>

";
*/

if(array_key_exists('REQUEST_URI', $_SERVER)){
if(strpos($_SERVER['REQUEST_URI'], basename(__FILE__)) !== false){
header('HTTP/1.0 404 Not Found', true, 404);
die();
}
}

?>

Re: problem after installation

Posted: Sun Dec 02, 2018 11:59 pm
by admin
bmullan,

If you are having the PHP display as a text file, it means you don't have PHP running OR you have just typed a file name in the URL - file:///C:/xampp/htdocs/nuBuilder4/index.php


Steven

Re: problem after installation

Posted: Mon Dec 03, 2018 12:43 pm
by bmullan
Steven

Showing the "/var/www/nubuilder/index.php" was done from the CLI using "more ./index.php"

Also I'm on linux (ubuntu) not windows and PHP is installed. If I create a phptest.php file with ONLY the following in it:

<?php phpinfo(); ?>

And if I point my browser to http:<ip>/testphp.php I get the phpinfo display
admin wrote:bmullan,

If you are having the PHP display as a text file, it means you don't have PHP running OR you have just typed a file name in the URL - file:///C:/xampp/htdocs/nuBuilder4/index.php

Steven

Re: problem after installation

Posted: Wed Jan 30, 2019 2:44 am
by xyz2019
I seemed to get the same issue and could only see the text version of PHP. Wondering if there is a way to solve this issue?

Re: problem after installation

Posted: Wed Jan 30, 2019 3:22 am
by xyz2019