The feed deleted for 2 weeks does not work in the cpanel, this error message:

Tamás Varga Posted in Technical Support 3 years ago

The feed deleted for 2 weeks does not work in the cpanel, this error message:

/home/elittagh/public_html/cron/cron.php: line 1: ?php: No such file
or directory
/home/elittagh/public_html/cron/cron.php: line 2: syntax error near
unexpected token `'OSSN_ALLOW_SYSTEM_START','
/home/elittagh/public_html/cron/cron.php: line 2:
`define('OSSN_ALLOW_SYSTEM_START', TRUE);'

cron.php:

<?php
define('OSSN_ALLOW_SYSTEM_START', true);
require_once ('system/start.php');
function delete_2weeks_posts() {
    $wall = new OssnWall;
    $listUser = $wall->GetPosts(array(
        'type' => 'user',
        'page_limit' => false,
        'wheres' => array(
            "(FROM_UNIXTIME(o.time_created) <= DATE_SUB(NOW(), INTERVAL 2 WEEK))"
        )
    ));
    if ($listUser) {
        foreach ($listUser as $post) {
            $post->deleteObject($post->guid);
            ossn_trigger_callback('post', 'delete', $post->guid);
        }
    }
}
delete_2weeks_posts();
Replies
German Michael Zülsdorff Replied 3 years ago

And running this command does not delete the old posts?

Hungarian Tamás Varga Replied 3 years ago

¬Z¬Man: php /home/elittagh/public_html/cron/cron.php

German Michael Zülsdorff Replied 3 years ago

which command did you run?

Hungarian Tamás Varga Replied 3 years ago

PHP:
~]$ php --version
PHP 7.3.30 (cli) (built: Sep 1 2021 00:30:00) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.30, Copyright (c) 1998-2018 Zend Technologies
with the ionCube PHP Loader + ionCube24 v10.4.5, Copyright (c) 2002-2020, by ionCube Ltd.

I was wrong, I didn't delete the feed, I just ran the command.

Hungarian Tamás Varga Replied 3 years ago

Thanks a lot for the help, the php /home/elittagh/public_html/cron/cron.php command ran properly, I have to work with the provider.

German Michael Zülsdorff Replied 3 years ago

Please provide your cron command.

To me it looks like you are either trying to execute your script without PHP or you have no executable PHP at all.
To verify:

  • open a terminal shell from your cpanel
  • run the command php --version

This should give something like

PHP 7.2.34-nmm1 (cli) (built: Jan 18 2021 08:47:17) ( NTS )

Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with the ionCube PHP Loader + ionCube24 v10.4.0, Copyright (c) 2002-2020, by ionCube Ltd.

If not, ask your provider which way to execute PHP from the command line

If PHP is available this way, run your script manually like

php /home/elittagh/public_html/cron/cron.php
Indonesian Arsalan Shah Replied 3 years ago

I tested above code and there is no such a error there must be something wrong in your actual file. Upload your actual file to https://gist.github.com/

Hungarian Tamás Varga Replied 3 years ago

.

require_once('/home/elittagh/public_html/system/start.php');

I rewrote this as a path. You haven't deleted the feed yet.

Indonesian Arsalan Shah Replied 3 years ago

There is no such a file , you need to change 'system/start.php' to full path of the file in OSSN.

Premium Version

Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.

$199 (Life Time)
Learn More

Other Questions