Sync_Users.php Errors When Trying to Run it from the CLI

Sync_Users.php Errors When Trying to Run it from the CLI

by Mike Halverson -
Number of replies: 7

I'm trying to run the sync_users.php to synchronize my AD users in Moodle 2.8.5 on Ubuntu 14.04.01 and I continue to receive the same error:

PHP Notice: Undefined index: HTTP_HOST in /opt/bitnami/apps/moodle/htdocs/config.php on line 23
!!! Detected incorrect $CFG->wwwroot in config.php, it must not contain trailing slash.
Please notify server administrator. !!!

I've tried changing the HTTP_HOST to my actual amazon EC2 public dns name and I receive the same error. Any help would be appreciated.

Thanks

(Edited by Helen Foster to remove attached file - original submission Thursday, 23 April 2015, 4:46 PM)

Average of ratings: -
In reply to Mike Halverson

Re: Sync_Users.php Errors When Trying to Run it from the CLI

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The config file contains your hash and database access.  Probably need to change that now!!

What is the address that your $_Server variable points to?  Does it have a slash at the end of it?  If so, remove it...

In reply to Emma Richardson

Re: Sync_Users.php Errors When Trying to Run it from the CLI

by Mike Halverson -

Thanks for the information on the hash.  I actually only use this as a test account, but really appreciate the knowledge.  How what I know that my $_Server variable point to?  Where would I locate that?  Thanks for your assistance.

In reply to Mike Halverson

Re: Sync_Users.php Errors When Trying to Run it from the CLI

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Perhaps in your apache file?  Honestly, I use a pretty basic setup.  You have added an if clause to your site location area in config.php (Helen was good enough to take that down) that has me a little confused.  Normally, the server url is posted there.  I am presuming your if clause must point to another file somewhere which defines $_server with an actual web address. 

In reply to Emma Richardson

Re: Sync_Users.php Errors When Trying to Run it from the CLI

by Mike Halverson -

This is an Bitnami image hosted on Amazon Web Services.  I have limited knowledge as to why the config.php looks this way.  It is what was included in the image.  I've tried other support options and I'm not having too much luck.  Anybody out there that might have any ideas, I would really appreciate it.


Thanks

In reply to Mike Halverson

Re: Sync_Users.php Errors When Trying to Run it from the CLI

by Dave Perry -
Picture of Testers

Tip: if you want to share configs with the community or support staff (we do this on another one), create a copy and remove the database names/passwords and your salt. Then you aren't sharing damaging information (well, the local siteroot folder might be considered damaging if your server was properly compromised, but that's about it).

In reply to Mike Halverson

Re: Sync_Users.php Errors When Trying to Run it from the CLI

by Mike Halverson -

I've attached my config.php file here.

In reply to Mike Halverson

Re: Sync_Users.php Errors When Trying to Run it from the CLI

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Do you have no support with your server? 

You could try replacing the whole if clause with:

$CFG->wwwroot   = 'http://yourdomain.com';

and see if that makes any difference..not sure if you are using https or not...adjust accordingly if you are..