sanwhere after reinstalling it again and adding the code to flarum folder which is in public_html

I encountered HTTP ERROR 500

php flarum cache:clear and php flarum queue:work (became silent after http 500 error)

    install supervisor with this command on your server:

    sudo yum -y install supervisor (Cent-OS)

    than run it and enable it on restart:

    sudo systemctl start supervisord
    sudo systemctl enable supervisord

    add this after the last line of supervisord.conffile:

    [program:any_name]
    process_name=%(program_name)s_%(process_num)02d
    command=php flarum queue:work sqs --sleep=3 --tries=3
    directory=/path_to_flarum
    autostart=true
    autorestart=true
    user=root
    numprocs=1
    redirect_stderr=true
    stdout_logfile=/path_to_flarum/worker.log
    stopwaitsecs=3600

    after that, run this command:

    systemctl restart supervisord

    than this to see if it is active:

    systemctl status supervisord

    you can check the log file at /var/log/supervisor/supervisord.log and search for INFO success: at the last line. if you see that, supervisor is running and it will run your command on restart.

    Braden did you add the lines exiting file or you created a new file?

    exiting file need to be like below:

    <?php
    
    /*
     * This file is part of Flarum.
     *
     * (c) Toby Zerner <toby.zerner@gmail.com>
     *
     * For the full copyright and license information, please view the LICENSE
     * file that was distributed with this source code.
     */
    
    use Flarum\Extend;
    
    return [
        new Blomstra\Redis\Extend\Redis([
            'host' => '127.0.0.1',
            'password' => null,
            'port' => 6379,
            'database' => 1,
        ])
    ];

      Braden look for log files in storage/logs and report the error here

      Hari Cloudflare doesn't even cache dynamic pages, you cannot fix an internal server error on the origin by clearing cache 🙂

        sanwhere let me first contact my host if they can install that on my server since am using a shared hosting.

        no i added the lines in the existing file.

        @Hari i have purge everything

        i will return with the feedback

          Braden since am using a shared hosting.

          I would be surprised if a shared hosting provider would offer redis. Unless they are able to separate its data between the customers/sites that run on one machine. Most likely they cannot, so if they do offer redis it might imply that they share sensitive data between customers/sites and as such that would be a red flag.

            matteocontrini very true because i had uninstalled Cloudflare long ago , so i got confused but still purge everything.

            Inside
            storage/logs there were no errors reported, i could have quote it.

            Now the error surfaced

            use Flarum\Extend;
            
            return [
                new Blomstra\Redis\Extend\Redis([
                    'host' => '127.0.0.1',
                    'password' => null,
                    'port' => 6379,
                    'database' => 1,
                ])
            ];

            its added in extend.php but not found

            and immediately after adding this code, with or without the extension installed, it brings the http 500 error

              • [deleted]

              Braden if your host does not support redis (which I expect they won't), then this extension has no value, and you should remove it. This would also clear the HTTP 500 error.

                [deleted] i really need to save money for dedi and donating to flarum

                @luceos
                Funny thing,
                when i used blomstra/flarum-redis: ^ 0.2.4-beta (it caused the error)

                But using a downgrade version 0.2.3, its now working!

                  Braden that can be caused by running an outdated Flarum version, didn't you mention you still are on Flarum beta.15 or something?

                  Please upgrade as soon as possible!

                  9 days later

                  luceos hello I like this extension but I don't want to install redis as per security reasons also I don't need cache as my speed is already good, but I still need queues so is their any alternative that works without redis. Also a suggestion that if the queues feature will be included built in in the core it will be more better as it's a must have feature.

                    9 days later

                    luceos instead of supervisor or systemd can we just use corn job?

                    i don't know this is the right question or not.

                    due to the limitations, I could not able to use supervisor for my custom php instance at cloudways.

                      Hari you can use the exact same method the database queue is set up as a Cron.

                      See luceos

                      Hari If it is possible to set up a cron on your hosting that allows you to run tasks without a timeout. Then you can use the method I mentioned earlier: rafaucau

                      This script checks if the queue process is running, if not, it starts it. This way, when the process crashes, cron will restart it.
                      I use it on my forum because I don't have the possibility to manage processes there.

                      I think that if you have such a possibility on your hosting, it is better to use Redis queue than the database queue because of better performance.

                        rafaucau does installing this extension install redis or you have to install redis separately

                        • Hari replied to this.

                          rafaucau you have replied to me earlier but at that moment i thought i don't need redies queue.. currently, i am using an extension it badly needs a queue so now re-visiting 😂. thanks for mentioning it again, that really helps my situation. i will keep you posted

                          Ffuser1 you need to install Redis first, once go through readme. in my case, i have enabled it at cloudways dashboard