Stats Problem

Mark

Administrator
Staff member
permission denied is probably an issue with your host, I suspect the path is wrong and your host overlooked it.

As for the PHP error, that looks like an include path is not correct, I will check this again tomorrow but I am quite sure it should be fine. Make sure your cron script is in the same directory as your settings_sql.php file
 

Bart

Active Member
The Cron worked manually when i did it but i think there might be a problem now, will the cron work by itself now as the next time it runs will be 21 hours apart from when i ran it manually, could that cause any problems?
 

Basti

Administrator
Staff member
It would always run at midnight no matter if you called it manually or not. This is ofc depending if the path to cron.php is correct.

I would suggest while cron.php is not running you make a few tests.
1. Join your list with a new account
2. Download and open cron_test.php and replace in the databasse query at the bottom of the file
Code:
username = 'username'
The username in quotes, need to be replaced by your newly made account ( keep the quotes )
3. upload cron_test.php to where cron.php is
4. setup a new cron job to let it run every minute
5. for the path try a few variations.
/usr/bin/php /home/username/public_html/maxleech.com/test_cron.php
alter your username of course.
This test cron would update your test member unq_in_0_daily field in the database every minute. So watching his stats page for today hits in will give you a clue if it works or not.
 

Attachments

Bart

Active Member
Cron works fine now :) thanks!

I had to use:
"php /home/username/public_html/maxleech.com/test_cron.php"

while host told me to use:
"/home/username/public_html/maxleech.com/test_cron.php"
 

Basti

Administrator
Staff member
Good that it is sorted :)
I hate how there are so many differences in php paths. Would make life so much easier with a standart path
 

Bart

Active Member
Maybe in the next version the user could have the choice to either choose pseudo cron or cron job in the admin panel?
 

Basti

Administrator
Staff member
This could be an option but properbly is confusing for the average user.
At best we need to somehow fix the pseudo cron, but that is unlikely. That issue exist for so many years already
 

Mark

Administrator
Staff member
an option for psuedo cron VS cron job is what I was planning in the admin panel. Default is pseudo cron, if they experience 0 days then the can setup a cron job.
 

Bart

Active Member
I've had this error on my site and nothing has updated although that's didn't turn into 0 :
X-Powered-By: PHP/5.2.17
Content-type: text/html

<br />
<b>Fatal error</b>: Class 'PluginManager' not found in
<b>/home/username/public_html/maxleech.com/sources/misc/new_day.php</b> on line
<b>166</b><br />
 

Basti

Administrator
Staff member
Appears cron.php needs to call the plugin manager if you have any plugins active which make use of new_day.php
try this in cron.php find
Code:
require_once ("{$CONF['path']}/languages/{$CONF['default_language']}.php");
below add
Code:
//Start Up The Plugin manager
include ('plugins.php');
pluginManager::getPluginManager();
 
// Lets load The Plugin Language Files
$plugin_dir = opendir("{$CONF['path']}/plugins/");
while (false !== ($plugin_subdir = readdir($plugin_dir))) {
    if ($plugin_subdir != '.' && $plugin_subdir != '..' && $plugin_subdir !=
        'index.htm') {
        include ('plugins/' . $plugin_subdir . '/languages/english.php');
        if (file_exists('plugins/' . $plugin_subdir . '/languages/' . $CONF['default_language'] .
            '.php')) {
            include ('plugins/' . $plugin_subdir . '/languages/' . $CONF['default_language'] .
                '.php');
        }
    }
}
 

Mark

Administrator
Staff member
so its been a couple months with this cron job setup, everything is all good for you? if so, I am ready to commit this option into 0.9 release.
 

Bart

Active Member
Heya man, everything working fine as far as i can see, have a look at the stats: http://maxleech.com/stats/

Everything is getting counted and nothing is missing, sorry i forgot to report back.

Thanks again for all the help with this problem :)
 

Basti

Administrator
Staff member
If you are on 0.8 you should have the file ready for use in your topsite root.
additionally read post #12 for the index.php change. Unfortunatly we had no time yet to integrate a switching method
 

leonor

Active Member
License Active
Okay .... its not realy working for me.

I startet with creating a new job in Plesk. (its run every minute)



START ...
After one minute i got the first error Message via mail.
20:31
PHP Warning: require_once(): Unable to access ./sources/misc/classes.php in /var/www/vhosts/server_name_not_important/private-server/cron.php on line 34
PHP Warning: require_once(./sources/misc/classes.php): failed to open stream: No such file or directory in /var/www/vhosts/server_name_not_important/private-server/cron.php on line 34
PHP Fatal error: require_once(): Failed opening required './sources/misc/classes.php' (include_path='.:') in /var/www/vhosts/server_name_not_important/private-server/cron.php on line 34
I did this change:
Code:
// Change the path to your full path if necessary
$CONF['path'] = '.';
to
Code:
// Change the path to your full path if necessary
$CONF['path'] = '/var/www/vhosts/server_name_not_important/private-server/';
The next error from my cron service comes after one minute with this error:
21:41
PHP Notice: Undefined index: debug in /var/www/vhosts/server_name_not_important/private-server/cron.php on line 44
Then i changed:
Code:
$DB = "sql_{$CONF['sql']}";
$DB = new $DB;
$DB->connect($CONF['sql_host'], $CONF['sql_username'], $CONF['sql_password'], $CONF['sql_database'], $CONF['debug']);
to
Code:
$DB = new $DB;
$DB->connect($CONF['sql_host'], $CONF['sql_username'], $CONF['sql_password'], $CONF['sql_database']);
"fixed" no more email from my cron Servic, but then at 00:00 i got this mail:
00:00
PHP Notice: Undefined variable: starttime in /var/www/vhosts/server_name_not_important/private-server/sources/misc/new_day.php on line 28
PHP Fatal error: Class 'PluginManager' not found in /var/www/vhosts/server_name_not_important/private-server/sources/misc/new_day.php on line 120
Now i added the stuff from Post 30
And the error changed to:
00:09
PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /var/www/vhosts/server_name_not_important/private-server/plugins.php on line 40
 

Basti

Administrator
Staff member
Not sure how it is in plesk, but maybe the path to file is wrong, or rather path to php. Have you checked with your host to make sure php and file path are correct?
"Path to php" "path to file"

You should not make a edit on the file itself. The $conf['path'] is the same as in index.php, it doesnt trigger an error there so it should be ok
 
Top