Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't run finder_indexer.php from cron #17

Closed
ghost opened this issue Nov 20, 2015 · 2 comments
Closed

can't run finder_indexer.php from cron #17

ghost opened this issue Nov 20, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 20, 2015

finder-indexer.php has a check to make sure you're not running from a web browser.

however it's throwing the error 'This is a command line only application' for me when i run it as php finder_indexer.php from a cron job (which should be allowed and is probably the most common use case). if i run the same command from the command line it works (returns 'cgi')

so i don't think 'cli' is the only possible value that should be allowed?

@ghost
Copy link
Author

ghost commented Nov 20, 2015

note, when run from cron, PHP_SAPI returns 'cgi-fcgi' vs. 'cgi'. so checking for either, or that 'cgi' is in the string (or 'apahe' is not in the string) would be a more generic way to kill the script if it's being run from the web interface.

right now i have to hack line 22 of finder_indexer.php to look for 'cgi' or 'cgi-fcgi' in order for it to run in my environment.
if (PHP_SAPI !== 'cli') -------> if (PHP_SAPI !== 'cli' and PHP_SAPI !== 'cgi-fcgi')

@ghost ghost changed the title can't run finder-indexer.php from cron can't run finder_indexer.php from cron Nov 20, 2015
@tiagovtg
Copy link
Member

tiagovtg commented Sep 1, 2017

@barrycox your issue, need to be open in a issue oficial joomla at https://issues.joomla.org/

Thx

@tiagovtg tiagovtg closed this as completed Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant