Welcome Guest, Not a member yet? Register   Sign In
Problems conntecting to db, an error with BASEPATH maybe?
#1

[eluser]_Darkdreams[/eluser]
I hope i'm posting this in the right place, could someone have a look at the following error and possibly help?:

Code:
Fatal error: require_once() [function.require]: Failed opening required '/home/darkdreams/www/www/system/database/drivers/mysql/mysql_driver.php' (include_path='.:/usr/local/php5/lib/php') in /home/darkdreams/www/www/system/database/DB.php on line 129

Now it seems to me that the url there has got the www folder in there one too many times. I have access to the level above www with my webspace but at the moment everything is located in the www folder (I couldnt work out how to put things outside it)

Now when I look at line 129 in DB.php i see that the url is made up using BASEPATH which I gather gets the base path from the server. Is there any way to define this as it would seem to be the problem.

If it helps my mySQL set up is as follows:

Code:
Local (web applications): Host: localhost | Socket: /tmp/mysql5.sock
Note: Most PHP applications/scripts will accept the following syntax:
MySQL Host: localhost:/tmp/mysql5.sock

and my database config file looks like this:

Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost:/tmp/mysql5.sock";
$db['default']['username'] = "**********";
$db['default']['password'] = "**********";
$db['default']['database'] = "**********";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

Any help or pointers as to how i can figure this out myself would be greatly appreciated

_darkdreams
#2

[eluser]CroNiX[/eluser]
What if you just set the hostname to "localhost"?
#3

[eluser]_Darkdreams[/eluser]
Oooh a reply, I thought this one fell to the wayside Smile

Same error I'm afraid. I'll change it and upload the file though, might help.

Is it me or does the www/www/ look wrong in the url at all?
#4

[eluser]stuffradio[/eluser]
I only use localhost when I'm connecting... unless the MySQL server is in a remote location.
#5

[eluser]_Darkdreams[/eluser]
Same here but this is new hosting and to be honest i've not got it working with or without the socket stuff on the end.

The url is http://www.darkdreams.co.uk and is currently set to localhost as suggested. I found this on the hosting help site:

To access your MySQL database from your PHP scripts, you need to provide the following database server name in your connection string:

localhost:/tmp/mysql5.sock

Here is a sample connection string to use with MySQL 5:

$link = mysql_connect('localhost:/tmp/mysql5.sock', 'mysql_user', 'mysql_password');

Any clues?
#6

[eluser]CroNiX[/eluser]
Sorry, Ive never seen that before. You should probably just call the support for your hosting company, thats an abnormal setup.
#7

[eluser]_Darkdreams[/eluser]
Will do, thanks for the help Smile
#8

[eluser]_Darkdreams[/eluser]
:down: where's the facepalm smiley? so after looking all over and still not figuring this out it turns out that filezilla only uploaded 50% of the overall site files! It wasn't even a group of folders, it was random files.

Turns out though that the weird socket stuff is required for my space.

Sorry for the waste of time, move along nothing to see here :lol:

Oh and thanks again Smile
#9

[eluser]InsiteFX[/eluser]
you have www/www should only be www/system

Probality your base_url path

Enjoy
InsiteFX
#10

[eluser]_Darkdreams[/eluser]
Actually it turns out the www/www is correct. My server grants me access to the folder outside the www folder which, bizarrely is called www.

The problem was down to user error, the ftp didn't complete properly and random files were missed. It took comparing each file name folder by folder to fix it.

Thanks for the reply though.




Theme © iAndrew 2016 - Forum software by © MyBB