Skip to content

installing flarum with plesk

Solved Configure
78 2 17.8k 1
  • finally got it running but i am getting these errors how to fix them?

    root@amazing-hellman:/var/www/vhosts/test.tk/httpdocs# php flarum info
    PHP Fatal error:  Uncaught PDOException: could not find driver in /var/www/vhosts/test.tk/httpdocs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
    Stack trace:
    #0 /var/www/vhosts/test.tk/httpdocs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(40): PDO->__construct()
    #1 /var/www/vhosts/test.tk/httpdocs/vendor/illuminate/database/Connectors/Connector.php(67): Doctrine\DBAL\Driver\PDOConnection->__construct()
    #2 /var/www/vhosts/test.tk/httpdocs/vendor/illuminate/database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection()
    #3 /var/www/vhosts/test.tk/httpdocs/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
    #4 /var/www/vhosts/test.tk/httpdocs/vendor/illuminate/database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
    #5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connector in /var/www/vhosts/test.tk/httpdocs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php on line 18
    root@amazing-hellman:/var/www/vhosts/test.tk/httpdocs# 
    
  • finally got it running but i am getting these errors how to fix them?

    root@amazing-hellman:/var/www/vhosts/test.tk/httpdocs# php flarum info
    PHP Fatal error:  Uncaught PDOException: could not find driver in /var/www/vhosts/test.tk/httpdocs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
    Stack trace:
    #0 /var/www/vhosts/test.tk/httpdocs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(40): PDO->__construct()
    #1 /var/www/vhosts/test.tk/httpdocs/vendor/illuminate/database/Connectors/Connector.php(67): Doctrine\DBAL\Driver\PDOConnection->__construct()
    #2 /var/www/vhosts/test.tk/httpdocs/vendor/illuminate/database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection()
    #3 /var/www/vhosts/test.tk/httpdocs/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
    #4 /var/www/vhosts/test.tk/httpdocs/vendor/illuminate/database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
    #5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connector in /var/www/vhosts/test.tk/httpdocs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php on line 18
    root@amazing-hellman:/var/www/vhosts/test.tk/httpdocs# 
    

    @Hari That looks like the php-mysql extension is not installed, or not loaded for the PHP version you are using.

  • i want to learn these things

    • change PHP version to 8 at the server level and also for my domain in Plesk using SSH

    • instead of maria DB i want to use MySQL as default, how can i do that? is it really possible? without a docker or any other things (since i am getting those SQL errors as shown in the earlier reply want to switch to MySQL from MariaDB)

    • update composer to v2 for my domain via SSH.

    @phenomlab said in installing flarum with plesk:

    @Hari Flarum will 100% work on Plesk, but as I alluded to in a previous thread, it’s not a simple exercise. Installing Flarum using Pocket Hold isn’t necessary as you should be able to complete the entire installation process using SSH without issue.

    i don’t know the reason but i am unable to install any extensions or flarum using SSH that is the reason i had to use pocket hold

  • Hariundefined Hari has marked this topic as solved on
  • i want to learn these things

    • change PHP version to 8 at the server level and also for my domain in Plesk using SSH

    • instead of maria DB i want to use MySQL as default, how can i do that? is it really possible? without a docker or any other things (since i am getting those SQL errors as shown in the earlier reply want to switch to MySQL from MariaDB)

    • update composer to v2 for my domain via SSH.

    @phenomlab said in installing flarum with plesk:

    @Hari Flarum will 100% work on Plesk, but as I alluded to in a previous thread, it’s not a simple exercise. Installing Flarum using Pocket Hold isn’t necessary as you should be able to complete the entire installation process using SSH without issue.

    i don’t know the reason but i am unable to install any extensions or flarum using SSH that is the reason i had to use pocket hold

    @Hari My responses below

    change PHP version to 8 at the server level and also for my domain in Plesk using SSH

    PHP 8.x has been available in Plesk since October 2021. There’s no need to change this using SSH, and it’s actually not recommended. The entire point of Plesk is to manage this using the portal - see below

    https://support.plesk.com/hc/en-us/articles/115000769793

    instead of maria DB i want to use MySQL as default, how can i do that? is it really possible? without a docker or any other things (since i am getting those SQL errors as shown in the earlier reply want to switch to MySQL from MariaDB)

    Possible, yes - although it’s usually the other way round in the sense that people want to replace MySQL with MariaDB

    https://www.plesk.com/blog/product-technology/mysql-vs-mariadb/

    update composer to v2 for my domain via SSH.

    You should take the same route as is advertised here

    https://getcomposer.org/download/

  • @Hari My responses below

    change PHP version to 8 at the server level and also for my domain in Plesk using SSH

    PHP 8.x has been available in Plesk since October 2021. There’s no need to change this using SSH, and it’s actually not recommended. The entire point of Plesk is to manage this using the portal - see below

    https://support.plesk.com/hc/en-us/articles/115000769793

    instead of maria DB i want to use MySQL as default, how can i do that? is it really possible? without a docker or any other things (since i am getting those SQL errors as shown in the earlier reply want to switch to MySQL from MariaDB)

    Possible, yes - although it’s usually the other way round in the sense that people want to replace MySQL with MariaDB

    https://www.plesk.com/blog/product-technology/mysql-vs-mariadb/

    update composer to v2 for my domain via SSH.

    You should take the same route as is advertised here

    https://getcomposer.org/download/

    @phenomlab oh i see in that case i think my old backup is causing the issues regarding MySQL and PHP versions. i will try fresh installation now.

  • @phenomlab oh i see in that case i think my old backup is causing the issues regarding MySQL and PHP versions. i will try fresh installation now.

    @Hari Ok. Let me know.

  • @Hari Ok. Let me know.

    @phenomlab

    i have installed and set my project settings to PHP 8 but CLI is not updating to 8.0

    f0ec177a-355a-4321-9095-1e8a5889dc31-image.png

    should i try this?

    https://talk.plesk.com/threads/set-default-php-version-for-command-line.345940/

    407d76d6-2f86-4303-a2f9-0e9fdbc16b4c-image.png

  • @phenomlab

    i have installed and set my project settings to PHP 8 but CLI is not updating to 8.0

    f0ec177a-355a-4321-9095-1e8a5889dc31-image.png

    should i try this?

    https://talk.plesk.com/threads/set-default-php-version-for-command-line.345940/

    407d76d6-2f86-4303-a2f9-0e9fdbc16b4c-image.png

    @Hari What version of Plesk do you have ? You should be able to install this using the links I posted earlier ?

  • @Hari What version of Plesk do you have ? You should be able to install this using the links I posted earlier ?

    @phenomlab

    Plesk Obsidian Version 18.0.41

    acfd0388-0760-4f77-826d-38d063b053ac-image.png

    domain settings

    596f60af-adaa-4e8a-bf52-45c6608812fa-image.png

  • @phenomlab

    Plesk Obsidian Version 18.0.41

    acfd0388-0760-4f77-826d-38d063b053ac-image.png

    domain settings

    596f60af-adaa-4e8a-bf52-45c6608812fa-image.png

    @Hari What’s the output of php -v from CLI ?

  • @Hari What’s the output of php -v from CLI ?

    @phenomlab

    11bfa541-1459-4df4-ba9d-3e44dacef7b2-image.png

    i just sent logins, please teach me what changes i need to make i really want to learn this setup process … i want to do a youtube video on this too 😄

  • @phenomlab

    11bfa541-1459-4df4-ba9d-3e44dacef7b2-image.png

    i just sent logins, please teach me what changes i need to make i really want to learn this setup process … i want to do a youtube video on this too 😄

    @Hari Looks like the environment variable is not set.

    What is the output of

    locate php and whereis php ?

  • @Hari Looks like the environment variable is not set.

    What is the output of

    locate php and whereis php ?

    @phenomlab

    28f85e13-05c1-47fd-a458-d696cd71264d-image.png

    5c7af3dc-bb2c-4005-9cd0-1b7703a1518a-image.png

    should i goto the root and run these commands again?

  • @phenomlab

    28f85e13-05c1-47fd-a458-d696cd71264d-image.png

    5c7af3dc-bb2c-4005-9cd0-1b7703a1518a-image.png

    should i goto the root and run these commands again?

    @Hari No. Plesk typically installs PHP in /opt/plesk/php/7.4/bin so what is the output of /opt/plesk/php/7.4/bin/php -v ?

    Should be

    PHP 7.4.28 (cli) (built: Feb 18 2022 07:57:20) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with the ionCube PHP Loader + ionCube24 v11.0.1, Copyright (c) 2002-2022, by ionCube Ltd.
        with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
    

    Therefore, PHP 8 should be in /opt/plesk/php/8.0/bin, so you should also get output from /opt/plesk/php/8.0/bin/php -v as below

    PHP 8.0.16 (cli) (built: Feb 18 2022 07:57:20) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v4.0.16, Copyright (c) Zend Technologies
        with Zend OPcache v8.0.16, Copyright (c), by Zend Technologies
    

    This means that because your environment variable is missing, you have to specify the full path to PHP 8, so instead of just php, you need /opt/plesk/php/8.0/bin/php

    Welcome to Plesk 😕

  • @Hari No. Plesk typically installs PHP in /opt/plesk/php/7.4/bin so what is the output of /opt/plesk/php/7.4/bin/php -v ?

    Should be

    PHP 7.4.28 (cli) (built: Feb 18 2022 07:57:20) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with the ionCube PHP Loader + ionCube24 v11.0.1, Copyright (c) 2002-2022, by ionCube Ltd.
        with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
    

    Therefore, PHP 8 should be in /opt/plesk/php/8.0/bin, so you should also get output from /opt/plesk/php/8.0/bin/php -v as below

    PHP 8.0.16 (cli) (built: Feb 18 2022 07:57:20) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v4.0.16, Copyright (c) Zend Technologies
        with Zend OPcache v8.0.16, Copyright (c), by Zend Technologies
    

    This means that because your environment variable is missing, you have to specify the full path to PHP 8, so instead of just php, you need /opt/plesk/php/8.0/bin/php

    Welcome to Plesk 😕

  • @Hari sorry - that should be /opt/plesk/php/8.0/bin/php. Previous post corrected.

  • @Hari sorry - that should be /opt/plesk/php/8.0/bin/php. Previous post corrected.

    @phenomlab i installed Plesk directly from DO app area… it’s free up to 2-3 domains.

    after running opt command the screen got stuck

  • @phenomlab i installed Plesk directly from DO app area… it’s free up to 2-3 domains.

    after running opt command the screen got stuck

    @Hari That’s expected because you are now running PHP as a daemon 🙂 Kill it by pressing CTRL + C (sometimes CTRL + Z or CTRL + X), then issue the correct command of /opt/plesk/php/8.0/bin/php -v which should spit out the version used in CLI.

  • @Hari That’s expected because you are now running PHP as a daemon 🙂 Kill it by pressing CTRL + C (sometimes CTRL + Z or CTRL + X), then issue the correct command of /opt/plesk/php/8.0/bin/php -v which should spit out the version used in CLI.

  • @Hari There you go…!


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics