Page 1 of 1

Blank screen after install using MAMP

Posted: Fri Aug 28, 2020 4:28 pm
by rastriffler
Hey, folks - I've searched the forums and seen others with the same problem, but none of the solutions seem to help me...

I have a fresh install of MAMP, which includes MySQL 5.7.26 and PHP 7.2.1

I've downloaded and installed the nuBuilder from the main site, unzipped and copied the folder to my htdocs directory and named it "nubuilder4".

I've created the database (nubuilder4) and modified the root user on localhost to have no password.

When I open localhost/nubuilder4/index.php I get a blank screen, and the following error message in the php_error.log:

Code: Select all

[28-Aug-2020 14:05:59 UTC] PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database 'nubuilder4' in /Applications/MAMP/htdocs/nubuilder4/nudatabase.php:12
Stack trace:
#0 /Applications/MAMP/htdocs/nubuilder4/nudatabase.php(12): PDO->__construct('mysql:host=127....', 'root', '', Array)
#1 /Applications/MAMP/htdocs/nubuilder4/nuchoosesetup.php(21): require_once('/Applications/M...')
#2 /Applications/MAMP/htdocs/nubuilder4/index.php(3): require_once('/Applications/M...')
#3 {main}
  thrown in /Applications/MAMP/htdocs/nubuilder4/nudatabase.php on line 12
My nuconfig.php has been modified as follows:

Code: Select all

<?php

    $nuConfigDBHost                 = "127.0.0.1";
    $nuConfigDBName                 = "nubuilder4";
    $nuConfigDBUser                 = "root";
    $nuConfigDBPassword             = "";
    $nuConfigDBGlobeadminUsername   = "globeadmin";     //-- globeadmin username
    $nuConfigDBGlobeadminPassword   = "nu";             //-- globeadmin password
    $nuConfigTitle                  = "nuBuilder 4";
    $nuConfigIsDemo                 = false;
	$nuConfigTimeOut             	= 1440;
I don't understand why it says user ""@'localhost', when I"ve clearly set the user to be 'root' in the nuconfig.php file.

Any help is MUCH appreciated!

Re: Blank screen after install using MAMP

Posted: Fri Aug 28, 2020 5:22 pm
by kev1n
Hi,

You could try this workaround by modifying nudatabase.php and entering the db credentials right there. I had to that for a UniServerZ installation because I couldn't get it work either with the default settings. Change the port if necessary.

The beginning of the file looks like this:

Code: Select all

<?php 

mb_internal_encoding('UTF-8');

$_POST['RunQuery'] 	= 0;

/*
$DBHost         	= $_SESSION['nubuilder_session_data']['DB_HOST'];
$DBName         	= $_SESSION['nubuilder_session_data']['DB_NAME'];
$DBUser         	= $_SESSION['nubuilder_session_data']['DB_USER'];
$DBPassword     	= $_SESSION['nubuilder_session_data']['DB_PASSWORD'];
$DBCharset      	= $_SESSION['nubuilder_session_data']['DB_CHARSET'];
*/

$DBHost = '127.0.0.1';
$DBName   = 'nubuilder4';
$DBUser = 'root';
$DBPassword = '';
$port = "3306";
$charset = 'utf8mb4';

$options = [
    \PDO::ATTR_ERRMODE            => \PDO::ERRMODE_EXCEPTION,
    \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
    \PDO::ATTR_EMULATE_PREPARES   => false,
];

$dsn = "mysql:host=$DBHost;dbname=$DBName;charset=$charset;port=$port";
try {
     $nuDB = new \PDO($dsn, $DBUser, $DBPassword, $options);
	 
} catch (\PDOException $e) {
     throw new \PDOException($e->getMessage(), (int)$e->getCode());
}

/*
$nuDB 				= new PDO("mysql:host=$DBHost;dbname=$DBName;charset=$DBCharset;port=3306", $DBUser, $DBPassword, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES $DBCharset"));
*/

Re: Blank screen after install using MAMP

Posted: Fri Aug 28, 2020 11:18 pm
by rastriffler
Thanks, Kev1n!

I did some hard-coding of values as you suggested and (still not sure why it's necessary, but) it seems to have worked.

Now I'm able to log in as globeadmin, but I'm not seeing the admin screen - there are no set and builder tabs.

Any idea what could be going on? Are there some additional steps you need to go through when using MAMP? Some tweak to the config, maybe?

Thanks!

- Roger

Re: Blank screen after install using MAMP

Posted: Sat Aug 29, 2020 2:54 am
by kev1n
Hi,

Check the developer console (F12) for errors.
Also check the nuDebug Results, Apache/Nginx log files.

Re: Blank screen after install using MAMP

Posted: Sat Aug 29, 2020 3:25 am
by kev1n
I'm not sure if there is a similar configuration required as under Linux where
you need to modify a file /etc/alternatives/my.cnf and change this at the bottom:

Code: Select all

[client]
port=3306
socket=/tmp/mysql.sock

[mysqld]
port=3306
socket=/tmp/mysql.sock
key_buffer_size=16M
max_allowed_packet=8M
sql-mode=NO_ENGINE_SUBSTITUTION

[mysqldump]
quick

Re: Blank screen after install using MAMP

Posted: Sun Aug 30, 2020 10:42 pm
by rastriffler
Hey, Kev1n -

I'm going to have to do some research and try to understand exactly what that code does, but THANK YOU - That worked!

You rock - many thanks for the help!

- Roger

Re: Blank screen after install using MAMP

Posted: Mon Aug 31, 2020 12:12 am
by admin
.