From 0ebc62fc6381537098396514cf1e76c945093756 Mon Sep 17 00:00:00 2001
From: Dave Goodwin Sorry, the attempt to connect to the host has failed. MySQL reports the following error - Sorry, the attempt to connect to the host has failed. MySQL reports the following error - Sorry, the attempt to create the database to the database has failed. MySQL reports the following error -
Sorry, the attempt to specify which database we need to work on (the MySQL keyword - USE) has failed. MySQL reports the following error - "; ?>
+?> - Sorry, the attempt to specify which database we need to work on (the MySQL keyword - USE) has failed. MySQL reports the following error - "; ?> - $temp = explode(";",file_get_contents("basic.sql")); + -Sorry, The query has failed. MySQL reports the following error -
+ }else{ - +Sorry, The query has failed. MySQL reports the following error -
- } + +if($query_response){ -Sorry, The query has failed. MySQL reports the following error -
- - /* - * Create the database - */ +Sorry, The query has failed. MySQL reports the following error -
- $buffer = file_get_contents("xampp_database.txt"); - $file_handle = fopen("../database.php",'w'); - fwrite($file_handle,$buffer,strlen($buffer)); - fclose($file_handle); + +if(!is_writeable('../index.php')) { + echo "Check your file permissions, index.php file is not writeable by the web server; you will want to replace index.php with demo.txt"; +} +if(is_file('../index.php') && is_writeable('../index.php')) { + @copy("../index.php","../index.txt"); + if(copy("../demo.txt","../index.php")) { + echo "Login requirement removed; using demo.txt as index.php page (index.php -> index.txt && demo.txt -> index.php).
"; + } +} -Please go to http://localhost/xertetoolkits/ -
-- Please see the Xerte site at http://www.nottingham.ac.uk/xerte and please consider joining the mailing list. -
+// update DB so it should work on Windows and OSX installs - rather than being hard coded to WAMP installs... +$site_url = 'http://' . $_SERVER['HTTP_HOST'] . dirname(dirname($_SERVER['REQUEST_URI'])); + +$db_site_url = mysql_real_escape_string($site_url); +mysql_query("UPDATE sitedetails SET site_url = '$db_site_url/' WHERE site_id = 1"); + +$home = realpath(dirname(dirname(__FILE__))); +$db_root_file_path = mysql_real_escape_string($home); +$db_import_path = mysql_real_escape_string($home . DIRECTORY_SEPARATOR . 'import' . DIRECTORY_SEPARATOR); +mysql_query("UPDATE sitedetails SET root_file_path = '$db_root_file_path/' WHERE site_id = 1"); +mysql_query("UPDATE sitedetails SET import_path = '$db_import_path/' WHERE site_id = 1"); + +?> ++ Please see the Xerte site at http://www.nottingham.ac.uk/xerte and please consider joining the mailing list. +