• Resources
  • A Shared Hosting Install Tip (Wrong PHP Version / Error)

Besides other information you can find throughout this forum around installing Flarum with shared hosting, here's the latest thing I've learned.

In the past this was not evident because PHP versions weren't changing as much.

If you go to install Flarum via composer with a shared hosting provider, you may get an error that your PHP version is not compatible. Usually, shared hosts will let you change the PHP version. However, this may not help. Because also usually, shared hosts have composer installed somewhere else. So, yes, you changed your PHP to version 8+, but where composer is installed, it may only be 7.something or less.

You can try (if using PHP 8) this:

php8 composer require...

But if that doesn't work it may be that you simply need to ask your web host for the proper command. It could be something like:

you/php8/folder/php-cli composer require...

The above will not work, it's an example showing that to force usage of a certain PHP version via command line, you have to point to it properly. And with shared hosts, it's not going to be the plain old php8 composer....

I hope this helps someone one day. Us shared hosting users must stick together. Haha! πŸ˜‚

There's also --ignore-platform-reqs but I'm trying to offer a little bit safer solution. Which is: ask your host for the path.

    010101 I hope this helps someone one day. Us shared hosting users must stick together. Haha! πŸ˜‚

    πŸ˜‚ So true, not that I run my flarum in shared hosting but when i wanted to suggest flarum to someone or make tutorials i have felt it's difficult by the larvel/SSH limitations it's not like wordpress we download plugin and upload to host

    Still i don't know how to run redis on plesk using SSH without docker it shows many errors when i run commands.

    I recommend to get hosting from cloudways or learn ways to run flarum using stock ubantu using SSH

    Running php8 cli is really complicated on plesk though we set to use 8.0 it still uses 7.4 for SSH

    https://sudonix.com/topic/234/installing-flarum-with-plesk/


    If you get time can you please share regular flarum commands in plesk (including paths)
    Like migrate flarum, cron job. ..etc

    I can only see plesk is the best platform to manage flarum on own on a digital ocean droplet.

    Softlocus demands money to install flarum in plesk odibisan

    However i manged to run flarum but without redis

    I have tested virtualmin but flarum doesn't boot due to virtualmin and MySQL load on 1gb ram 1cpu

    I am aware flarum is doing something for shared hosting environment but it will definitely take another few months for the improvements.

      I discovered all that myself the hard way on Siteground and I think I have posted on other discussions. But let's do it again for people who need it on Siteground.

      In order to use PHP 8 from command line, you should use php80. And for the composer, the command is:
      php80 -d memory_limit=4096M /usr/local/bin/composer.phar

      I've created an alias to the latter.

        Hari If you get time can you please share regular flarum commands in plesk (including paths)
        Like migrate flarum, cron job. ..etc

        I have zero experience with plesk. I can’t help there. 😭

        CyberGene But let's do it again for people who need it on Siteground.

        Thank you! This should help the next time someone searches SiteGround and Flarum. But, SiteGround could make changes and so the only guaranteed solution I can think of is: Ask your host. πŸ₯Ί Which is sad because some hosts’ tech support may not understand at first. They may get confused. But, just keep asking your host. πŸ€“

        Yes I have some problems with update to Flarum 1.2.0 in shared hosting (Banahosting)

        In Bana when go to the first install I go with this command to call composer in php7.3 to install.
        ea-php73 /opt/cpanel/composer/bin/composer

        Then when need update Flarum have some problems....
        At first go to update with php8.1 but view in my server that change the first letters in the php version. All the old version up to 8.0 start with ea- (ea-php7.1, ea-php7.2, etc...) but in php 8.1 this letters change to alt- (alt-php81)

        I testing tu upgrade Flarum with this command:
        alt-php81 /opt/cpanel/composer/bin/composer but in my server not working and said me: command not found

        I contact with support and sending me other address to working with composer in php8.1
        /opt/alt/php81/usr/bin/php /opt/cpanel/composer/bin/composer
        but in my case the command line when go to update said me: "nothing to install, update or remove"

        After this problem, update with composer in php8.0 because have the letter ea-
        ea-php80 /opt/cpanel/composer/bin/composer

        I don't know what will happen to me when Flarum needs to run on 8.1... πŸ˜