Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to install posix in php

Tags:

POSIX does not appear when I run php -m cmd, however, I see it from the phpinfo() –enable-posix=shared on Linux with Plesk 9.

Basically, I can't use posix_*() functions as described at http://www.php.net/manual/en/ref.posix.php

this shows doesn't exists:

if (function_exists('posix_getuid')) {     echo "posix_getuid available"; } else {     echo "posix_getuid not available"; // this prints in my server. } 

Could someone show me how to install it? Thank you.

 [PHP Modules] bz2 calendar ctype curl date dbase dom exif fileinfo filter ftp gd geoip gettext gmp hash iconv imap ionCube Loader json libxml mbstring mcrypt memcache mhash mysql mysqli openssl pcntl pcre PDO pdo_mysql pdo_sqlite readline Reflection session shmop SimpleXML sockets SPL sqlite standard tokenizer wddx xml xmlreader xmlwriter xsl zip zlib 
like image 441
Nizzy Avatar asked Feb 04 '10 04:02

Nizzy


People also ask

What is PHP Posix?

summary: PHP posix extension. description: PHP (recursive acronym for 'PHP: Hypertext Preprocessor') is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.


2 Answers

I found the solution:

yum install php-process 

This package enables php-posix.

like image 85
Nizzy Avatar answered Oct 01 '22 01:10

Nizzy


While resolved, the original problem would seem to be that posix_getpwuid is not supported on Windows:

from: http://www.php.net/manual/en/function.posix-getpwuid.php

On Windows, posix_getpwuid() is not implemented

  • if you just want the username of the current user, you can use get_current_user().

  • To properly get the running user, test if function_exists('posix_getpwuid') and if not, assume you're running on Windows and call getenv('USERNAME').

like image 39
elpatron Avatar answered Oct 01 '22 01:10

elpatron