Is there in JM4 also cron possible for Smart Search like in JM3

This forum is for general questions about extensions for Joomla! 4.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
multiaction
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Apr 17, 2015 6:51 am

Is there in JM4 also cron possible for Smart Search like in JM3

Post by multiaction » Thu Feb 24, 2022 12:27 pm

In JM3 in cli folder was a finder file you can start by cron to start indexing Smart Search. But that file is not in JM4 anymore.... Is it possible to run index in JM4 by cron?

Regards

Alex

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12473
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by brian » Thu Feb 24, 2022 1:03 pm

php cli/joomla.php finder:index
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

multiaction
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Apr 17, 2015 6:51 am

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by multiaction » Thu Feb 24, 2022 1:05 pm

Thanks my joomla master :)

multiaction
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Apr 17, 2015 6:51 am

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by multiaction » Mon Mar 14, 2022 1:33 pm

From the cli folder I can start it now in ssh...
But when I try to make a cron, like
php /home/???/domains/???.nl/public_html/cli/joomla.php finder:index

then I get the error:
[ERROR] Could not parse the requested URI
http:///home/???/domains/???.nl/public_html/cli/joomla.php

Any idea what I do wrong?

Regards

Alex

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12473
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by brian » Mon Mar 14, 2022 2:23 pm

check with your host what is the correct path to use for the php cli

it will vary between hosts
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 711
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by ceford » Mon Mar 14, 2022 4:20 pm

In a cron you usually need to give the full path to the php executable. My host gives an example in cPanel:

/usr/local/bin/php /home/username/public_html/path/to/cron/script

multiaction
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Apr 17, 2015 6:51 am

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by multiaction » Mon Mar 14, 2022 8:16 pm

The path is ok, he even try to start:

Finder Indexer
==========================

Starting Indexer
Setting up Smart Search plugins
Setup 37988 items in 0.024 seconds.


[ERROR] Could not parse the requested URI http:///home/user/domains/user.nl/public_html/cli/joomla.php

But then it throws the error

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14565
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by toivo » Mon Mar 14, 2022 9:31 pm

Just tested the CLI statement Joomla 4.0.6 and 4.1.1-dev in localhost using PHP 8.1.2. In both cases the indexing worked all right but a PHP Deprecated error was displayed:

Code: Select all

Deprecated: Joomla\Component\Finder\Administrator\Indexer\Result implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in C:\www\joomla4test\administrator\components\com_finder\src\Indexer\Result.php on line 27
Toivo Talikka, Global Moderator

User avatar
DaveOzric
Joomla! Ace
Joomla! Ace
Posts: 1588
Joined: Sat May 22, 2010 10:29 pm
Contact:

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by DaveOzric » Wed May 11, 2022 5:42 pm

toivo wrote:
Mon Mar 14, 2022 9:31 pm
Just tested the CLI statement Joomla 4.0.6 and 4.1.1-dev in localhost using PHP 8.1.2. In both cases the indexing worked all right but a PHP Deprecated error was displayed:

Code: Select all

Deprecated: Joomla\Component\Finder\Administrator\Indexer\Result implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in C:\www\joomla4test\administrator\components\com_finder\src\Indexer\Result.php on line 27
I'm looking for this on PHP 7 and 8.0, not 8.1 yet. Is this issue only related to PHP 8.1?

User avatar
DaveOzric
Joomla! Ace
Joomla! Ace
Posts: 1588
Joined: Sat May 22, 2010 10:29 pm
Contact:

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by DaveOzric » Wed May 11, 2022 7:44 pm

I have tried this and the Siteground support said it's the script.

Code: Select all

RuntimeException {#737
  #message: "Could not parse the requested URI http:///home/*****/www/s.com/public_html/cli/joomla.php"
  #code: 0
  #file: "./www/s.com/public_html/libraries/vendor/joomla/uri/src/AbstractUri.php"
  #line: 373
  trace: {
    ./www/s.com/public_html/libraries/vendor/joomla/uri/src/AbstractUri.php:373 { â?¦}
    ./www/s.com/public_html/libraries/src/Uri/Uri.php:309 {
      Joomla\CMS\Uri\Uri->parse($uri)
      â?º {
      â?º \treturn parent::parse($uri);
      â?º }
      arguments: {
        $uri: "http:///home/u1175-owwys3zvyiec/www/s.com/public_html/cli/joomla.php"
      }
    }
    ./www/s.com/public_html/libraries/vendor/joomla/uri/src/AbstractUri.php:111 { â?¦}
    ./www/s.com/public_html/libraries/src/Uri/Uri.php:121 { â?¦}
    ./www/s.com/public_html/libraries/src/Uri/Uri.php:142 { â?¦}
    ./www/s.com/public_html/libraries/src/Uri/Uri.php:204 { â?¦}
    ./www/s.com/public_html/plugins/system/pwebopengraph/pwebopengraph.php:701 { â?¦}
    ./www/s.com/public_html/plugins/system/pwebopengraph/pwebopengraph.php:130 { â?¦}
    ./www/s.com/public_html/libraries/src/Extension/ExtensionManagerTrait.php:242 { â?¦}
    ./www/s.com/public_html/libraries/src/Extension/ExtensionManagerTrait.php:160 { â?¦}
    ./www/s.com/public_html/libraries/src/Extension/ExtensionManagerTrait.php:94 { â?¦}
    ./www/s.com/public_html/libraries/src/Plugin/PluginHelper.php:236 { â?¦}
    ./www/s.com/public_html/libraries/src/Plugin/PluginHelper.php:194 { â?¦}
    ./www/s.com/public_html/libraries/src/Application/ConsoleApplication.php:231 { â?¦}
    ./www/s.com/public_html/cli/joomla.php:78 { â?¦}
  }
}

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14565
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by toivo » Thu May 12, 2022 12:15 am

DaveOzric wrote:
Wed May 11, 2022 7:44 pm
I have tried this and the Siteground support said it's the script.

Code: Select all

RuntimeException {#737
  #message: "Could not parse the requested URI http:///home/*****/www/s.com/public_html/cli/joomla.php"
multiaction wrote:
Mon Mar 14, 2022 8:16 pm
[ERROR] Could not parse the requested URI http:///home/user/domains/user.nl/public_html/cli/joomla.php
Run the following command in the shell or the command prompt:

Code: Select all

php -version
What does it report as the version of PHP CLI?
Toivo Talikka, Global Moderator

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14565
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by toivo » Thu May 12, 2022 1:40 am

Ran the CLI command finder:index using PHP 8.0.15 and PHP 8.1.2 in the latest Nightly Build Joomla 4.1.4-dev and Joomla 4.2.0-alpha3-dev installed in Wampserver 3.2.8 running in localhost.

The Indexer worked perfectly in all combinations of versions of Joomla and PHP. No parse error was reported, the warning about array key HTTP_HOST in libraries/src/Uri/Uri.php is still in Joomla 4.1 but gone in the latest development version of Joomla 4.2.
Toivo Talikka, Global Moderator

User avatar
DaveOzric
Joomla! Ace
Joomla! Ace
Posts: 1588
Joined: Sat May 22, 2010 10:29 pm
Contact:

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by DaveOzric » Thu May 12, 2022 12:55 pm

PHP is 7.4.29. Is that what you want? I don't know how to run a command on the server.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14565
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by toivo » Fri May 13, 2022 5:02 am

Just tested the finder:index command in CLI using PHP 7.4.26 and the results are the same as earlier with PHP 8.0.

DaveOzric wrote:
Wed May 11, 2022 7:44 pm
I have tried this and the Siteground support said it's the script.

Code: Select all

RuntimeException {#737
  #message: "Could not parse the requested URI http:///home/*****/www/s.com/public_html/cli/joomla.php"
The error message is correct because cli/joomla.php is not a URI that can be parsed but a CLI command executed from the shell, a command prompt or as a cron task 'php cli/joomla.php'.

The php command is either presented with the full path to the PHP executable, as @ceford mentioned earlier, or the folder containing the PHP executable has to be included in the system path.
Toivo Talikka, Global Moderator

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12473
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by brian » Fri May 13, 2022 7:17 am

As usual siteground support in their rush to answer you have not actually looked at your issue.

A cron job is a command that is executed at a specified time or interval.
The command is not a web link that you go to.
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 711
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by ceford » Fri May 13, 2022 7:34 am

Is this the clue:
#message: "Could not parse the requested URI http:///home/*****/www/s.com/public_html/cli/joomla.php"
The command is supposed to be

/usr/local/bin/php /home/*****/www/s.com/public_html/cli/joomla.php finder:index

Is that what you are using? Is the dot in the path causing the problem.

User avatar
DaveOzric
Joomla! Ace
Joomla! Ace
Posts: 1588
Joined: Sat May 22, 2010 10:29 pm
Contact:

Re: Is there in JM4 also cron possible for Smart Search like in JM3

Post by DaveOzric » Fri May 13, 2022 12:02 pm

brian wrote:
Fri May 13, 2022 7:17 am
As usual siteground support in their rush to answer you have not actually looked at your issue.

A cron job is a command that is executed at a specified time or interval.
The command is not a web link that you go to.
Sorry, that string was the error. The cron I used was this:

php /home/u1175-owwys3zvyiec/www/s.com/public_html/cli/joomla.php finder:index


Post Reply

Return to “Extensions for Joomla! 4.x”