mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
installer fails, if posix is not installed on linux systems #3317
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#3317
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bjoern86 on GitHub (Sep 21, 2018).
installer fails on step 2 with this error:
Fatal error: Uncaught Error: Call to undefined function posix_getpwuid() in /SuiteCRM/include/utils.php:455 Stack trace: #0 /SuiteCRM/install/ready.php(284): getRunningUser() #1 /SuiteCRM/install.php(796): require('/html/SuiteCRM/...') #2 {main} thrown in /SuiteCRM/include/utils.php on line 455
This is because posix is not installed on an linux system with PHP-FPM up and running. The problem is, that there is only a check if the os is windows and if not, the script asumes, that posix is installed. We better check if posix is installed and not for windws in line 452:
if (!function_exists('posix_getpwuid')) {
instead of
if (is_windows()) {
this should be fixed in update scripts as well.
@pgorod commented on GitHub (Sep 21, 2018):
Actually the script tries a few different methods and is ready to return a value even if none of them work.
https://github.com/salesagility/SuiteCRM/blob/master/include/utils.php#L445
But it seems on some systems, instead of simply returning NULL there, break the script execution with a FATAL. It would be interesting to know more about the specifics of your system.
Anyway, I've seen this happen a couple of times in the forums and I agree it would be better to make it more resilient.
But perhaps the correct way to do it is not replacing it on top of the
is_windowstest - it's simply wrapping the posix call inside a newif (!function_exists('posix_getpwuid')).@pgorod commented on GitHub (Sep 21, 2018):
Sorry, I hadn't refreshed the page when I wrote that comment - now I see you already provided a fix (and you made it like I said was better, cool). Thanks
@pgorod commented on GitHub (Jun 14, 2019):
New fix proposed in #7398 addressing all the issues raised by @gymad in comments on #6344