Jump to content

DigitalSparky

Members
  • Posts

    7
  • Joined

  • Last visited

Reputation Activity

  1. Like
    DigitalSparky got a reaction from Web Hosting UK in Stop cron email going to admin@ email address   
    Just to quickly add to this one, > /dev/null 2>&1 pipes everything to the abyss, which means you'll even lose errors.

    you may wish to remove the 2>&1 so you still get emails if there is an error, it may be helpful in the event errors occur, instead of silently failing :).
    FYI:

    >/dev/null = Pipe standard out to /dev/null
    2>&1 = Pipe standard error to standard out, which in turn pipes to /dev/null

    so removing 2>&1 means stderr (standard error) will still come through, so you'll get emails in the event of errors, otherwise not.

    there are other ways to monitor your systems to ensure errors are picked up quickly, but they vary widely in complexity depending on requirements, so this is a rather simple approach, but can still be effective.
    YMMV, but monitoring, logging, trend analysis, etc will help considerably with bug and outage detection, allowing you to maintain higher uptime and business continuity.
     
  2. Like
    DigitalSparky got a reaction from Paul in Alternative of Mailparse?   
    I'd probably go back to the hosting provider and request the allow it, even if it's just for one profile.
    It's certainly more performant than having a composer package or something like that handle it (C compiled library vs PHP interpreted).
    Enabling for individual profiles these days is very simple, as there are user level php.ini's which you can enable/disable modules, and it's exactly what other module enable/disable controls use, so the only thing they really need to do is install it...
  3. Like
    DigitalSparky got a reaction from activa in PDO Port handling bug   
    Hi folks,
    Couldn't find this reported, however it seems there's a bit of an issue when attempting to install 4.0.0 using PHP 7.
    It appears there's a syntax error when taking into account MySQL Ports
    I've configured my development environment to use MySQL on port 13306 and entered the host as 127.0.0.1:13306
    Installation works perfectly on PHP 5.6.23 (via FPM & CLI), however via PHP 7.0.18 it throws the following error:
    SQLSTATE[HY000] [2002] Failed to parse address "127.0.0.1:13306:3306" Changing config.php to the host as 127.0.0.1 and port 13306 does not remedy this issue, as such it appears that I'm unable to use PHP 7.0 with MySQL from a fresh install.
    Oddly enough an upgrade, admittedly on a slightly older php7 version, worked without issue.
    Note: it was installed using 127.0.0.1:13306 in the host string, as there was no separate port, despite the configuration having a port option.
    The exception is occurring on line 74 of core/ServiceProviders/MinphpBridge.php (the new PDO connection setup).

    var_dump($dbInfo); shows the following data:
     
    array(10) { ["driver"]=> string(5) "mysql" ["host"]=> string(9) "127.0.0.1" ["port"]=> string(5) "13306" ["database"]=> string(6) "blesta" ["user"]=> string(6) "blesta" ["pass"]=> string(6) "blesta" ["persistent"]=> bool(false) ["charset_query"]=> string(16) "SET NAMES 'utf8'" ["sqlmode_query"]=> string(26) "SET sql_mode='TRADITIONAL'" ["options"]=> array(0) { } } I've confirmed via debug that the data being input to new PDO is:

    string(40) "mysql:dbname=blesta;host=127.0.0.1:13306"

    Changing lines 64 to 74 from:
    $connection = new PDO( $dbInfo['driver'] . ':dbname=' . $dbInfo['database'] . ';host=' . $dbInfo['host'] . ( isset($dbInfo['port']) ? ':' . $dbInfo['port'] : '' ), $dbInfo['user'], $dbInfo['pass'], $options ); to
    $connection = new PDO( $dbInfo['driver'] . ':dbname=' . $dbInfo['database'] . ';host=' . $dbInfo['host'] . ( isset($dbInfo['port']) ? ';port=' . $dbInfo['port'] : '' ), $dbInfo['user'], $dbInfo['pass'], $options ); Resolves the issue, and the site is now operational.

    This fix obviously relies on the port being explicitly set, so having a field to fill in that port is still required.

    Edit: looks like it worked doing the upgrade because my other upgrade was on my other laptop, that runs mysql on 3306...
  4. Like
    DigitalSparky got a reaction from Adam in PDO Port handling bug   
    Hi folks,
    Couldn't find this reported, however it seems there's a bit of an issue when attempting to install 4.0.0 using PHP 7.
    It appears there's a syntax error when taking into account MySQL Ports
    I've configured my development environment to use MySQL on port 13306 and entered the host as 127.0.0.1:13306
    Installation works perfectly on PHP 5.6.23 (via FPM & CLI), however via PHP 7.0.18 it throws the following error:
    SQLSTATE[HY000] [2002] Failed to parse address "127.0.0.1:13306:3306" Changing config.php to the host as 127.0.0.1 and port 13306 does not remedy this issue, as such it appears that I'm unable to use PHP 7.0 with MySQL from a fresh install.
    Oddly enough an upgrade, admittedly on a slightly older php7 version, worked without issue.
    Note: it was installed using 127.0.0.1:13306 in the host string, as there was no separate port, despite the configuration having a port option.
    The exception is occurring on line 74 of core/ServiceProviders/MinphpBridge.php (the new PDO connection setup).

    var_dump($dbInfo); shows the following data:
     
    array(10) { ["driver"]=> string(5) "mysql" ["host"]=> string(9) "127.0.0.1" ["port"]=> string(5) "13306" ["database"]=> string(6) "blesta" ["user"]=> string(6) "blesta" ["pass"]=> string(6) "blesta" ["persistent"]=> bool(false) ["charset_query"]=> string(16) "SET NAMES 'utf8'" ["sqlmode_query"]=> string(26) "SET sql_mode='TRADITIONAL'" ["options"]=> array(0) { } } I've confirmed via debug that the data being input to new PDO is:

    string(40) "mysql:dbname=blesta;host=127.0.0.1:13306"

    Changing lines 64 to 74 from:
    $connection = new PDO( $dbInfo['driver'] . ':dbname=' . $dbInfo['database'] . ';host=' . $dbInfo['host'] . ( isset($dbInfo['port']) ? ':' . $dbInfo['port'] : '' ), $dbInfo['user'], $dbInfo['pass'], $options ); to
    $connection = new PDO( $dbInfo['driver'] . ':dbname=' . $dbInfo['database'] . ';host=' . $dbInfo['host'] . ( isset($dbInfo['port']) ? ';port=' . $dbInfo['port'] : '' ), $dbInfo['user'], $dbInfo['pass'], $options ); Resolves the issue, and the site is now operational.

    This fix obviously relies on the port being explicitly set, so having a field to fill in that port is still required.

    Edit: looks like it worked doing the upgrade because my other upgrade was on my other laptop, that runs mysql on 3306...
  5. Like
    DigitalSparky got a reaction from Michael in Blesta 4.0 on PHP 7   
    Yup, I just applied that and all is working - the hotfix, unfortunately, is not listed in the README.md... the PHP 5.5 one is though... haha...
×
×
  • Create New...