# Expected Users

**URL:** <https://ask.gibbonedu.org/t/expected-users/1369>\
**Category:** Administration\
**Created:** [May 8, 2017, 8:07pm UTC](https://ask.gibbonedu.org/t/expected-users/1369 "2017-05-08T20:07:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 8, 2017, 8:07pm UTC](https://ask.gibbonedu.org/t/expected-users/1369/1 "2017-05-08T20:07:08Z")

</div>

Hi Ross,  
I am doing the attendance records for students in a school year Sept 2016- July 2017. I had set the students who started in the 3rd week of Sept 2016 and Jan 2017 to expected users with their expected start date in the system. I enrolled them to their expected form group.The question is, shouldn’t the system automatically set them to full users at the appointed start date? Or is their something I am overlooking?  
Regards

---

<div class="post-metadata">

**Author:** ![ross](https://ask.gibbonedu.org/user_avatar/ask.gibbonedu.org/ross/32/8_2.png) [@ross](https://ask.gibbonedu.org/u/ross)\
**Post date:** [May 9, 2017, 12:06am UTC](https://ask.gibbonedu.org/t/expected-users/1369/2 "2017-05-09T00:06:28Z")

</div>

Willpro, this only happens automatically if you use the User Management command line script, [as described on this page](https://gibbonedu.org/support/administrators/command-line-tools/). The bottom of the guide includes information on using cron to schedule the running of the script. Good luck! Ross.

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 11, 2017, 3:21am UTC](https://ask.gibbonedu.org/t/expected-users/1369/3 "2017-05-11T03:21:55Z")

</div>

Hi Ross,  
Where do i put the script? in the user admin module?

---

<div class="post-metadata">

**Author:** ![ross](https://ask.gibbonedu.org/user_avatar/ask.gibbonedu.org/ross/32/8_2.png) [@ross](https://ask.gibbonedu.org/u/ross)\
**Post date:** [May 14, 2017, 9:49am UTC](https://ask.gibbonedu.org/t/expected-users/1369/4 "2017-05-14T09:49:06Z")

</div>

Willpro, no the script should be left in /cli and run from there. How you initiate it depends on your OS (Linux uses cron for scheduled commands). Ross.

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 15, 2017, 12:54am UTC](https://ask.gibbonedu.org/t/expected-users/1369/5 "2017-05-15T00:54:58Z")

</div>

Ross,  
Thanks for your reply.  
I am still a bit confused. I input the path to the script in /home/bxxxxx/public\_html/xxxxxx/cli/userAdmin\_statusCheckAndFix.php and set the schedule in cron and it’s saying: No such file or directory. What am i doing wrong?

---

<div class="post-metadata">

**Author:** ![ross](https://ask.gibbonedu.org/user_avatar/ask.gibbonedu.org/ross/32/8_2.png) [@ross](https://ask.gibbonedu.org/u/ross)\
**Post date:** [May 15, 2017, 2:44pm UTC](https://ask.gibbonedu.org/t/expected-users/1369/6 "2017-05-15T14:44:23Z")

</div>

Willpro, in my experience, and following [the guide on our site](https://gibbonedu.org/support/administrators/command-line-tools/), cron entries work best when first calling the directory the script is in, and then, after a ; seperator, calling the file:

0 1 \* \* \* cd /var/www/gibbon/cli/ ; php userAdmin\_statusCheckAndFix.php

Replace /var/www/gibbon/cli/ with /home/bxxxxx/public\_html/xxxxxx/cli/ and it should work for you.

Ross

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 15, 2017, 4:30pm UTC](https://ask.gibbonedu.org/t/expected-users/1369/7 "2017-05-15T16:30:09Z")

</div>

Ross,  
i tried it as you suggested : /home/bxxxxx/public\_html/mxxxxxxxx/cli/ ; php userAdmin\_statusCheckAndFix.php  
but i am still getting this error message: /bin/bash: /home/bxxxxx/public\_html/mxxxxxxxx/cli/: is a directory  
Status: 404 Not Found  
X-Powered-By: PHP/7.0.18  
Content-type: text/html; charset=UTF-8  
No input file specified

I also tried it these 2 ways as well (1) :/home/bxxxxx/public\_html/mxxxxxxxx/cli/ ; userAdmin\_statusCheckAndFix.php and I got this error:/bin/bash: /home/bxxxxx/public\_html/mxxxxxxxxx/cli/: is a directory  
/bin/bash: userAdmin\_statusCheckAndFix.php: command not found

(2) /home/bxxxxx/public\_html/mxxxxxxxx/cli/userAdmin\_statusCheckAndFix.php and i got this error:/bin/bash: /home/bxxxxxx/public\_html/mxxxxxxxx/cli/userAdmin\_statusCheckAndFix.php: Permission denied

I don’t know what I am missing here.

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 15, 2017, 7:55pm UTC](https://ask.gibbonedu.org/t/expected-users/1369/8 "2017-05-15T19:55:33Z")

</div>

I spoke to the host and they gave me this command to use: /usr/local/bin/php /home/cPanel username/public\_html/path to cron.php  
When i input the necessary info in like this, there are no error message: /usr/local/bin/php /home/bxxxxx/public\_html//mxxxxxxxx/cli/userAdmin\_statusCheckAndFix.php  
However I am not sure has to how long the script takes to run and i am not seeing any output message as to the result. Checking the system I am still seeing the students as ‘expected’ and not as ‘full’ even after the time had elasped

---

<div class="post-metadata">

**Author:** ![ross](https://ask.gibbonedu.org/user_avatar/ask.gibbonedu.org/ross/32/8_2.png) [@ross](https://ask.gibbonedu.org/u/ross)\
**Post date:** [May 16, 2017, 12:19am UTC](https://ask.gibbonedu.org/t/expected-users/1369/9 "2017-05-16T00:19:12Z")

</div>

Willpro,

The script should notify the main system admin (as per System Settings) when it has run. Are you seeing that notification?

Expected users are turned to full depending if their start date is set and has been equaled or passed in time. Do your expected users have their start date set?

Thanks,

Ross

---

<div class="post-metadata">

**Author:** ![sandra](https://ask.gibbonedu.org/user_avatar/ask.gibbonedu.org/sandra/32/5_2.png) [@sandra](https://ask.gibbonedu.org/u/sandra)\
**Post date:** [May 16, 2017, 12:26am UTC](https://ask.gibbonedu.org/t/expected-users/1369/10 "2017-05-16T00:26:13Z")

</div>

Also, for whatever reason a cron file requires a blank line at the end of the file, otherwise it silently fails to run. Lost a bit of time to that one once 😃

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 16, 2017, 12:42am UTC](https://ask.gibbonedu.org/t/expected-users/1369/11 "2017-05-16T00:42:40Z")

</div>

Thanks for your reply Ross/Sandra,  
I have my notification set, i got all the previous error messages. The start date for the users were set for Jan 2017.  
How would i put the blank line at the end of the line?

---

<div class="post-metadata">

**Author:** ![ross](https://ask.gibbonedu.org/user_avatar/ask.gibbonedu.org/ross/32/8_2.png) [@ross](https://ask.gibbonedu.org/u/ross)\
**Post date:** [May 16, 2017, 12:52am UTC](https://ask.gibbonedu.org/t/expected-users/1369/12 "2017-05-16T00:52:00Z")

</div>

Willpro, I usually set cron up using the crontab command in Linux with the -e parameter, and it seems to do the line automatically. I suggest you check out your PHP error log as well to see if you are getting any error messages when the CLI script is running.

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 16, 2017, 1:35am UTC](https://ask.gibbonedu.org/t/expected-users/1369/13 "2017-05-16T01:35:42Z")

</div>

As far as I see error consist of the wrong path to config.php file.

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 16, 2017, 7:48pm UTC](https://ask.gibbonedu.org/t/expected-users/1369/14 "2017-05-16T19:48:08Z")

</div>

Ross/Sandra,  
I got the script /home/bxxxxx/public\_html/mxxxxxxxx/cli/userAdmin\_statusCheckAndFix.php updated to an absolute path to config files:  
require getcwd().‘/home/bxxxxx/public\_html/mxxxxxxxx/config.php’;  
require getcwd().‘/home/bxxxxx/public\_html/mxxxxxxxx/functions.php’;  
I got one notification that cli was executed but i am unable to get the script to run any further cron task. What else am i doing wrong?

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 17, 2017, 10:20am UTC](https://ask.gibbonedu.org/t/expected-users/1369/15 "2017-05-17T10:20:09Z")

</div>

In further discussion with the host they identified the following as shown here:

We have set up your cron job from official developer’s instruction.

> **[Command Line Tools | Gibbon Documentation](https://docs.gibbonedu.org/administration/command-line-tools)**
>
> The Free, Flexible, Open Source School Software

When performing the script, we found this error:

### 

[16-May-2017 22:49:19 America/Jamaica] PHP Warning: stream\_socket\_enable\_crypto(): Peer certificate CN=`*.websitehostserver.net' did not match expected CN=`localhost’ in /home/bxxxxxx/public\_html/mxxxxxxxx/lib/PHPMailer/class.smtp.php on line 354

### 

If your script should use SSL for SMTP connection it should connect to the hostname server but not localhost.

We recommend to contact your web-developer from regarding the issue.

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 17, 2017, 11:05pm UTC](https://ask.gibbonedu.org/t/expected-users/1369/16 "2017-05-17T23:05:54Z")

</div>

I got this report from the host also:

Dear Customer,

Please check the part of error logs bellow:

### 

[17-May-2017 15:55:03 UTC] PHP Notice: Undefined index: SERVER\_PORT in /home/bxxxxxx/public\_html/mxxxxxxxxxxx/src/Gibbon/core.php on line 244  
[17-May-2017 15:55:03 UTC] PHP Notice: Undefined index: SERVER\_PORT in /home/bxxxxxx/public\_html/mxxxxxxxxxx/src/Gibbon/core.php on line 244  
[17-May-2017 15:55:03 UTC] PHP Notice: Undefined index: SERVER\_NAME in /home/bxxxxxx/public\_html/mxxxxxxxx/src/Gibbon/core.php on line 246  
[17-May-2017 18:00:01 UTC] PHP Notice: Undefined index: SERVER\_PORT in /home/bxxxxxxx/public\_html/mxxxxxxxxx/src/Gibbon/core.php on line 244  
[17-May-2017 18:00:01 UTC] PHP Notice: Undefined index: SERVER\_PORT in /home/bxxxxxx/public\_html/mxxxxxxxx/src/Gibbon/core.php on line 244  
[17-May-2017 18:00:01 UTC] PHP Notice: Undefined index: SERVER\_NAME in /home/bxxxxxx/public\_html/mxxxxxxxxx/src/Gibbon/core.php on line 246

### 

Looks like it’s using 80 port but as far as I see the script can’t be performed via the http request. Please make sure that your script is configured correctly.

---

<div class="post-metadata">

**Author:** ![ross](https://ask.gibbonedu.org/user_avatar/ask.gibbonedu.org/ross/32/8_2.png) [@ross](https://ask.gibbonedu.org/u/ross)\
**Post date:** [May 18, 2017, 12:44pm UTC](https://ask.gibbonedu.org/t/expected-users/1369/17 "2017-05-18T12:44:58Z")

</div>

Willpro, OK, this is useful, and it is to do with the way the server is set up. Gibbon, by default, sends via localhost as it is simply and reliable…but not all servers support this, and there are some good reasons to switch over to an authenticated SMTP server. The best solution is to go to Admin \> System Admin \> Third Party Settings and enable SMTP Mail. You’ll need to speak to your host, or consult their documentation, in order to know how to set this up. Hope this helps. Ross.

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 19, 2017, 6:56pm UTC](https://ask.gibbonedu.org/t/expected-users/1369/18 "2017-05-19T18:56:43Z")

</div>

Hi Ross,  
Still at square one. Enabled smtp and configured as suggested but I am still getting the same result hsa can be seen below:

cd /home/bxxxxx/public\_html/mxxxxxxxxxx/cli/ ; php userAdmin\_statusCheckAndFix.php

X-Powered-By: PHP/7.0.19  
Set-Cookie: PHPSESSID=9g14pvjelai56ljbrr2fv0o681; path=/  
Content-type: text/html; charset=UTF-8

This script cannot be run from a browser, only via CLI.

---

<div class="post-metadata">

**Author:** ![willpro](https://ask.gibbonedu.org/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@willpro](https://ask.gibbonedu.org/u/willpro)\
**Post date:** [May 19, 2017, 10:17pm UTC](https://ask.gibbonedu.org/t/expected-users/1369/19 "2017-05-19T22:17:13Z")

</div>

I contacted the host again (greengeeks) and this is their response:

The following crontab you set up looks fine

00 14 \* \* \* cd /home/bxxxxxx/public\_html/mxxxxxxxxx/cli/ ; php userAdmin\_statusCheckAndFix.php

But there are errors in your error\_log file

[19-May-2017 20:17:46 UTC] PHP Notice: Undefined index: SERVER\_PORT in /home/bxxxxxx/public\_html/mxxxxxxxxxx/src/Gibbon/core.php on line 244  
[19-May-2017 20:17:46 UTC] PHP Notice: Undefined index: SERVER\_PORT in /home/bxxxxxxx/public\_html/mxxxxxxxxxp/src/Gibbon/core.php on line 244  
[19-May-2017 20:17:46 UTC] PHP Notice: Undefined index: SERVER\_NAME in /home/bxxxxxxx/public\_html/mxxxxxxxxxx/src/Gibbon/core.php on line 246

Please contact developer for farther assistance

---

<div class="post-metadata">

**Author:** ![sandra](https://ask.gibbonedu.org/user_avatar/ask.gibbonedu.org/sandra/32/5_2.png) [@sandra](https://ask.gibbonedu.org/u/sandra)\
**Post date:** [May 20, 2017, 1:42am UTC](https://ask.gibbonedu.org/t/expected-users/1369/20 "2017-05-20T01:42:50Z")

</div>

Hi Willpro,

Luckily those are just PHP notices rather than errors, they shouldn’t prevent the script from running. I tested on this end with v13 and the script runs despite the notices (which have been handled in v14).

However, your previous post I think sheds some light on the problem: the output “This script cannot be run from a browser, only via CLI.” shouldn’t be occurring if the script _is_ being run from CLI. If you type something like  
`php -r ‘echo php_sapi_name()."
";’ in the command line it should return <code class="CodeInline">cli. If not, then it’s possible the script isn’t handling this check properly for your type of server configuration.`

`
Ross, it sounds like there are instances where php_sapi_name() might not return ‘cli’ from the command line: http://stackoverflow.com/questions/933367/php-how-to-best-determine-if-the-current-invocation-is-from-cli-or-web-server/25967493#25967493`

[Next page](https://ask.gibbonedu.org/t/expected-users/1369.md?page=2)
