Failed to load server settings

General discussion about netjukebox
Locked
bodenzord
User
Posts: 6
Joined: Wed Aug 01, 2012 7:37 am

Failed to load server settings

Post by bodenzord »

I just installed netjukebox on a webserver that hosts my website, and I'm getting the following error: "Failed to load server settings"

The server specs are:

Server OS: FreeBSD 7.3-RELEASE-p2
Database: MySQL 5.0.91-log
HTTP Server: Apache/2.2.22
PHP Version: 5.3.13 (Zend: 2.3.0)

After uploading the netjukebox folder and configuring the config.inc.php file, I ran /tools/mysqli2mysql.php.

It was at this point that I ran into a syntax error with mysqli2mysql.php on line 44. I fixed it with the following:

Code: Select all

//NJB_HOME_DIR	= str_replace('\\', '/', $directory) . '/';
define('NJB_HOME_DIR', str_replace('\\', '/', $directory) . '/');
Once this was fixed, the script ran successfully, but this is where I get the error, "Failed to load server settings".

So I'm stuck and don't know what to do. Any suggestions?
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Failed to load server settings

Post by wbartels »

Thanks for the fix! Implemented in netjukebox 5.37.5

With most Linux distributions you can use the MySQLi engine, then there is no need to run the /tools/mysqli2mysql.php script.
With my Ubuntu 12.04 distribution netjukebox 5.37.5 works with the default netjukebox installation and after running the /tools/mysqli2mysql.php script.

I wound try it again without running the /tools/mysqli2mysql.php script.
Please let me know if this did the trick.
bodenzord
User
Posts: 6
Joined: Wed Aug 01, 2012 7:37 am

Re: Failed to load server settings

Post by bodenzord »

Thanks for the reply. Unfortunately, it still won't work when using mysqli.

When looking at the code of mysqli.inc.php on line 55...

Code: Select all

$query = @mysqli_query($db, 'SELECT name, value FROM server') or message(__FILE__, __LINE__, 'error', '[b]Failed to load server settings[/b]');
...you'll notice that it's trying to do a query of the database for a table called 'server'. Well, I don't have a table called 'server'. My web host provider is Pair Networks, and I created a new database through my account portal. This is a dry-bones database without any tables. It's now up to me to create these.

So...what to do next? Is it possible to skip this section of code and just go straight to creating the tables for the music catalog? How necessary is the "Load server settings" section?
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Failed to load server settings

Post by wbartels »

Don’t create the database and set $cfg['mysqli_auto_create_db'] = true; in the confg.inc.php file.
Than netjukebox will create the database and import the sql file.

or

Create that database (same as in the config.inc.php file: $cfg['mysqli_db']) manually.
And manually import the sql file (sql/netjukebox_40.sql).
bodenzord
User
Posts: 6
Joined: Wed Aug 01, 2012 7:37 am

Re: Failed to load server settings

Post by bodenzord »

Thank you! That worked like a charm.

FYI...I'm unable to create databases via php code. I'm forced to create them through my account portal. Furthermore, the name of the database is somewhat pre-defined based off of my username. Anyway, importing the sql file worked perfectly.

As a side note, I was confused on how to define the Media Directory in the config.inc.php. It took me a couple of attempts. For some reason, I figured that it would be within the netjukebox directory, so I created a /data/Media/ directory in there, which didn't work. In the long run, I created a /data/Media/ directory outside of my webroot directory and inside of my user directory. So within config.inc.php, I defined it as a full and complete filesystem directory as such: /usr/home/username/data/Media/
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Failed to load server settings

Post by wbartels »

bodenzord wrote:Thank you! That worked like a charm.

FYI...I'm unable to create databases via php code. I'm forced to create them through my account portal. Furthermore, the name of the database is somewhat pre-defined based off of my username. Anyway, importing the sql file worked perfectly.
Thanks!
I will add a more meaningful error message in netjukebox_5.37.6 and up:

Failed to load MySQL server settings
When creating the database manually
also import the sql/netjukebox_40.sql file manually.

bodenzord wrote: As a side note, I was confused on how to define the Media Directory in the config.inc.php. It took me a couple of attempts. For some reason, I figured that it would be within the netjukebox directory, so I created a /data/Media/ directory in there, which didn't work. In the long run, I created a /data/Media/ directory outside of my webroot directory and inside of my user directory. So within config.inc.php, I defined it as a full and complete filesystem directory as such: /usr/home/username/data/Media/
When starting a directory with a slash in Linux means from the root,
so you have to set the directory from the root like you did with: /usr/home/username/data/Media/
It is not smart to place the media file in the netjukebox directory than it is very easy to download them without login in.
Locked