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
Field | Original Value | New Value |
---|---|---|
Attachment | capture-for-jira-screenshot-20170517-100341-645.png [ 11631 ] |
Assignee | Jonathan Reissmueller [ jonathan ] |
Fix Version/s | 4.2.0-b1 [ 11014 ] | |
Fix Version/s | Short Term [ 10800 ] |
Story Points | 2 |
Sprint | 4.2.0 Sprint 1 [ 46 ] |
Rank | Ranked higher |
Sprint | 4.2.0 Sprint 1 [ 46 ] | 4.2.0 Sprint 1, 4.2.0 Sprint 2 [ 46, 47 ] |
Rank | Ranked higher |
Status | Open [ 1 ] | In Progress [ 3 ] |
Remaining Estimate | 0 minutes [ 0 ] | |
Time Spent | 2 hours, 24 minutes [ 8640 ] | |
Worklog Id | 10377 [ 10377 ] |
Time Spent | 2 hours, 24 minutes [ 8640 ] | 2 hours, 34 minutes [ 9240 ] |
Worklog Id | 10377 [ 10377 ] |
Time Spent | 2 hours, 34 minutes [ 9240 ] | 3 hours, 30 minutes [ 12600 ] |
Worklog Id | 10381 [ 10381 ] |
Status | In Progress [ 3 ] | In Review [ 5 ] |
Resolution | Fixed [ 1 ] |
Time Spent | 3 hours, 30 minutes [ 12600 ] | 3 hours, 56 minutes [ 14160 ] |
Worklog Id | 10414 [ 10414 ] |
Sprint | 4.2.0 Sprint 1, 4.2.0 Sprint 2 [ 46, 47 ] | 4.2.0 Sprint 1, 4.2.0 Sprint 2, 4.2.0 Sprint 3 [ 46, 47, 48 ] |
Rank | Ranked higher |
Status | In Review [ 5 ] | Closed [ 6 ] |
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.