Giter Site home page Giter Site logo

Comments (11)

toddeTV avatar toddeTV commented on May 23, 2024

Same here. .bashrc and .bash_profile are set so that php -v brings the PHP version 7.4. But the bin/grav scheduler -r with a following bin/grav scheduler -d shows, that it tries to use PHP version 5.4.
But it seems less a plugin problem but more of a server configuration issue.

from grav-plugin-tntsearch.

ViliusS avatar ViliusS commented on May 23, 2024

Grav CLI tries to determine correct PHP version automatically. What does "/usr/bin/env php" return?

from grav-plugin-tntsearch.

kees-closed avatar kees-closed commented on May 23, 2024

Grav CLI tries to determine correct PHP version automatically. What does "/usr/bin/env php" return?

That seems to be the difference in behavior of this plugin. The other plugins don't depend on this. Maybe it's best to keep things consistent? I now see the error /usr/bin/env: php: No such file or directory in the scheduler overview. This wasn't the case before. I guess Grav 1.7 changed this? Because the error used to be as I described it in the first post.

I asked the admin of the system to install coreutils, because env is missing. Hopefully that fixes it. But I personally think it would be best to stick to a certain standard that doesn't require extra system packages. And since the other plugins run fine in the scheduler, there seems to be better ways to do this.

I'll report back once I know more.

from grav-plugin-tntsearch.

ViliusS avatar ViliusS commented on May 23, 2024

It's just coincidence because this plugin specifically uses Grav CLI, nothing wrong with that. Other plugins probably execute direct Grav APIs.

If /usr/bin/env fails then you should see failing main "bin/grav" too.

As to why it worked before for you, plugin was fixed to run again couple of months ago, because it was completely broken in 1.6 and 1.7 and you probably never saw that in the GUI.

from grav-plugin-tntsearch.

kees-closed avatar kees-closed commented on May 23, 2024

I specifically provide the PHP version for /bin/grav, otherwise an error indeed returns about a wrong PHP version. Now it indeed also returns the env error. So this has become more clear with Grav 1.7. Hopefully env will be able to point to the PHP version set as default by Plesk.

I use this, then it works fine for all plugins, except the tntsearch.
/opt/plesk/php/7.4/bin/php ~/www.zeitgeistbeweging.nl/bin/grav scheduler -d

Let's see if the coreutils package fixes everything :)

from grav-plugin-tntsearch.

kees-closed avatar kees-closed commented on May 23, 2024

It's just coincidence because this plugin specifically uses Grav CLI, nothing wrong with that. Other plugins probably execute direct Grav APIs.

If /usr/bin/env fails then you should see failing main "bin/grav" too.

As to why it worked before for you, plugin was fixed to run again couple of months ago, because it was completely broken in 1.6 and 1.7 and you probably never saw that in the GUI.

On a Plesk system this is not convenient. I just talked to the admin. He removed the /usr/bin/php binary because Plesk uses /opt/plesk/php/7.4/bin/php. With Plesk you can select a different PHP version per vhost. So I can also on the fly switch to PHP 8. This is then picked up by Grav without issues. This also works fine for all plugins, but tntsearch does not work in such a setup when using the scheduler. When running the tntsearch index from the GUI, it works fine.

Would it be possible to use the Grav APIs? Because a good fix is not possible. If a symlink was created for /usr/bin/php to /opt/plesk/php/7.4/bin/php, then that has to be manually maintained. It also should be a sensible default for all the other users on the system. Plesk doesn't work like that.

from grav-plugin-tntsearch.

ViliusS avatar ViliusS commented on May 23, 2024

It's just coincidence because this plugin specifically uses Grav CLI, nothing wrong with that. Other plugins probably execute direct Grav APIs.
If /usr/bin/env fails then you should see failing main "bin/grav" too.
As to why it worked before for you, plugin was fixed to run again couple of months ago, because it was completely broken in 1.6 and 1.7 and you probably never saw that in the GUI.

On a Plesk system this is not convenient. I just talked to the admin. He removed the /usr/bin/php binary because Plesk uses /opt/plesk/php/7.4/bin/php. With Plesk you can select a different PHP version per vhost. So I can also on the fly switch to PHP 8.

This is EXACTLY what env was designed for and why it should be used. You don't need to create a symlink to the correct PHP version, env should find it according to your PATH environment. As far as I remember Plesk uses different users for different vhosts. If env cannot find correct PHP version then your PATH for that particular user is misconfigured.

I'm running Grav with TNTSearch under Virtualmin with similar setup. It works correctly.

This is then picked up by Grav without issues. This also works fine for all plugins, but tntsearch does not work in such a setup when using the scheduler. When running the tntsearch index from the GUI, it works fine.

Would it be possible to use the Grav APIs? Because a good fix is not possible. If a symlink was created for /usr/bin/php to /opt/plesk/php/7.4/bin/php, then that has to be manually maintained. It also should be a sensible default for all the other users on the system. Plesk doesn't work like that.

There is no point of changing how plugin works because as I said, other plugins and Grav itself uses the same CLI functionality. If you think Grav is not compatible with Plesk you should rise the ticket on main Grav repository, but again, your issue should be easy fixable by an admin.

from grav-plugin-tntsearch.

kees-closed avatar kees-closed commented on May 23, 2024

The only plugin that has issues is tntsearch. Everything else works fine. So the issue I'm having is not really with Plex. Because Grav works fine. It's only tntsearch that runs into this problem. So I'll repeat my kind and respectful request to make use of the Grav API instead of what is used now. In my opinion that would be the most easy and productive way forward. But I'll leave that up to you. I hope you change your mind.

from grav-plugin-tntsearch.

ViliusS avatar ViliusS commented on May 23, 2024

I'm not the plugin author, so it's not up to me. I just wanted to help.

All I can do is just repeat myself, that if you see this issue, there will be other issues, like for example "bin/grav backup" failing. Every code which depends on the Grav CLI and is executed automatically WILL fail.

The issue is in the environment, and should be fixed there.

from grav-plugin-tntsearch.

kees-closed avatar kees-closed commented on May 23, 2024

Backups work fine as well via the scheduler. It's only tntsearch that causes this issue.

$ /opt/plesk/php/7.4/bin/php ~/www.zeitgeistbeweging.nl/bin/grav scheduler -d

Job Details
===========

┌─────────────────────┬──────────────────┬──────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Job ID              │ Last Run         │ Next Run         │ Errors                                                                                                                                                        │
├─────────────────────┼──────────────────┼──────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ tntsearch-index     │ 2021-01-29 05:01 │ 2021-01-30 05:01 │ /usr/bin/env: php: No such file or directory                                                                                                                  │
│ email-flushqueue    │ 2021-01-29 06:37 │ 2021-01-29 06:38 │ None                                                                                                                                                          │
│ git-sync            │ 2021-01-28 23:00 │ 2021-01-29 12:00 │ None                                                                                                                                                          │
│ default-site-backup │ 2021-01-29 01:00 │ 2021-01-30 01:00 │ None                                                                                                                                                          │
│ cache-clear         │ 2021-01-29 03:00 │ 2021-01-30 03:00 │ None                                                                                                                                                          │
└─────────────────────┴──────────────────┴──────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

from grav-plugin-tntsearch.

kees-closed avatar kees-closed commented on May 23, 2024

Will someone please have a look at this? On a Plesk instance this is broken, only for the TNT Search plugin.

from grav-plugin-tntsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.