Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2387

Improve the cron command listed under system automation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0
    • Fix Version/s: 4.2.0-b1
    • Component/s: Staff Interface
    • Labels:
      None

      Description

      Under Settings > System > Automation, the path to PHP is hard coded as /usr/bin/php but this is not always the correct path to PHP. Additionally, the command does not currently direct the output to /dev/null, so it may result in emails being generated by the cron.

      There is a constant called PHP_BINDIR which should show the path to the directory. For example, if PHP is in /usr/bin/php, it should return /usr/bin and we can append "/php". See http://php.net/manual/en/reserved.constants.php

      There is another constant called PHP_BINARY which is suppose to show the full path in PHP 5.4+, but it returned nothing in my tests.

      So, this may not be a foolproof way to determine the path to PHP, but it's better than always assuming it's /usr/bin/php

      Additionally, " >/dev/null 2>&1" should be appended to the end of the cron command.

        Activity

        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        PHP_BINARY is set at run time
        PHP_BINDIR is set at compile time

        Since php does not have to be located in the place it was compiled, we would have to look at PHP_BINARY if we were to try to determine this path.

        Show
        tyson Tyson Phillips (Inactive) added a comment - PHP_BINARY is set at run time PHP_BINDIR is set at compile time Since php does not have to be located in the place it was compiled, we would have to look at PHP_BINARY if we were to try to determine this path.

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              5/Dec/17

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 3 hours, 56 minutes
              3h 56m

                Agile