error after install

error after install

I chung - келді
Number of replies: 8

I got the following error when install:

Parse error: parse error, unexpected T_VARIABLE in /home/freehost/t35.com/u/c/ucway/moodle/config.php on line 67

Fatal error: Call to undefined function: get_string() in /home/freehost/t35.com/u/c/ucway/moodle/mod/resource/lib.php on line 10

Please advise how to fix it. My url is  http://ucway.t35.com/moodle/

In reply to I chung

Re: error after install

Martin Dougiamas - келді
Core developers қатысушының суреті Documentation writers қатысушының суреті Moodle HQ қатысушының суреті Particularly helpful Moodlers қатысушының суреті Plugin developers қатысушының суреті Testers қатысушының суреті
It looks like you've made a simple error in config.php ... left out a quote (") or a semicolon (;) somewhere. Look around line 67 or just before.
In reply to Martin Dougiamas

Re: error after install

I chung - келді

After I fix up the " & ; I got another error:

Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/freehost/t35.com/u/c/ucway/moodle/lib/adodb/drivers/adodb-mysql.inc.php on line 175

The database details specified in config.php are not correct, or the database is down.

In reply to I chung

Re: error after install

Martin Dougiamas - келді
Core developers қатысушының суреті Documentation writers қатысушының суреті Moodle HQ қатысушының суреті Particularly helpful Moodlers қатысушының суреті Plugin developers қатысушының суреті Testers қатысушының суреті
"The database details specified in config.php are not correct"

Check them closely - your provider should be able to help.
In reply to Martin Dougiamas

Re: error after install

I chung - келді

My setting as follows:

$CFG->dbtype    = "mysql";     // eg mysql (postgres7, oracle, access etc)
$CFG->dbhost    = "localhost"; // eg localhost
$CFG->dbname    = "moodledb";    // eg moodle
$CFG->dbuser    = "username";
$CFG->dbpass    = "password";


///////////////////////////////////////////////////////////////////////////
// Now you need to tell Moodle where it is located. Specify the full
// web address where moodle has been installed (without trailing slash)

//$CFG->wwwroot   = "http://example.com/moodle";
$CFG->wwwroot   = "http://ucway.t35.com/moodle";

///////////////////////////////////////////////////////////////////////////
// Next, specify the full OS directory path to this same location
// For Windows this might be something like "C:\apache\htdocs\moodle"

//$CFG->dirroot   = "/web/moodle";
$CFG->dirroot = "/home/freehost/t35.com/u/c/ucway/moodle";

///////////////////////////////////////////////////////////////////////////
// Now you need a place where Moodle can save uploaded files.  This
// directory should be writeable by the web server user (usually 'nobody'
// or 'apache'), but it should not be accessible directly via the web.

//$CFG->dataroot  = "/home/moodledata";
$CFG->dataroot  = "/home/freehost/t35.com/u/c/ucway/moodle/moodledata/";

///////////////////////////////////////////////////////////////////////////
// A very small percentage of servers have a bug which causes HTTP_REFERER
// not to work.  The symptoms of this are that you fill out the configure
// form during Moodle setup but when hit save you find yourself on the
// same form, unable to progress.  If this happens to you, come back here
// and set the following to true.  Otherwise this should always be false.

$CFG->buggy_referer = false;
//$CFG->buggy_referer = true;

///////////////////////////////////////////////////////////////////////////
// To continue the setup, use your web browser to go to your Moodle page //
///////////////////////////////////////////////////////////////////////////

$CFG->libdir    = "$CFG->dirroot/lib";   // Do not change this
require("$CFG->libdir/setup.php");       // Do not change this

 

anything need to change?

In reply to I chung

Re: error after install

Missy Manning - келді
I have this same error and everything is correct with my settings. I am not sure where to start next.

Did you ever fix this???

In reply to Missy Manning

Re: error after install

I chung - келді
In reply to I chung

Re: error after install

Martin Dougiamas - келді
Core developers қатысушының суреті Documentation writers қатысушының суреті Moodle HQ қатысушының суреті Particularly helpful Moodlers қатысушының суреті Plugin developers қатысушының суреті Testers қатысушының суреті
I'm assuming you guys are not actually using "username" for your username and "password" for your password, right?

Are you able to access your database OK by another method (ie not using Moodle)?

Again, I would highly recommend approaching your system administrator for help - that's what they're there for!

I will eat this computer if it's a Moodle problem!
In reply to Martin Dougiamas

Re: error after install

André Müller - келді

Hey Martin, you haven´t to eat your computer, it is a server prob!

2. simple things!

If you use SuseLinux the MYSQL_SOCKET is /var/lib/mysql/mysql.sock and not tmp/mysql.sock!

And sql.safe_mode has to be off, otherwise you will not be able to declare a hostname, username or password. Then username is the current user id of PHP.

Here only the system admin can help!

Another thing, moodle use pconnect (persistent connections), this is a bad thing on shared servers! Better use connect!

Change in lib/adodb/drivers/adodb-mysql.inc.php

$this->_connectionID = mysql_pconnect to

$this->_connectionID = mysql_connect

and all your trouble is gone

André