Fix “PHP Fatal error: Call to undefined function posix_getpwuid()”

Example Error Message

PHP Fatal error:  Call to undefined function posix_getpwuid() in /path/to/your/file.php on line 5

Cause

PHP posix extension is not available. Check this by invoking this command in your shell :

$ php -m | grep -i posix

If this output posix then you have posix extension installed.

How to fix

Debian

Should be enabled by default when you install php from apt-get.

CentOS

Need php-process extension installation (the package name is depend on your system, usually started with php-process).

$ sudo yum install php-process.x86_64

Manual Compilation

Based on PHP documentation. This compile option is enabled by default.

Iklan