How does one easily add posix support to PHP using

2020-08-09 07:58发布

问题:

I am running CentOS 5.2 and using yum to manage packages. I have had little luck installing php-posix but know with almost 100% certitude that it is a real and available package...somewhere. Has anyone had luck installing it?

FWIW, I am using the following:

sudo yum install -y php-posix

Update: I've realized that this may be an issue with my host (Slicehost) as I do in fact have cli, posix, and pcntl enabled for my PHP version (5.2.9)

回答1:

You can try and see if it's in the testing repository.

To see if it's in that repository.

yum --disablerepo=\* --enablerepo=c5-testing list available \*php\*

And to install it.

yum --enablerepo=c5-testing install php-posix

Be aware though, that the PHP version it needs may be higher than you currently have.



回答2:

While the question was for centos, notice that for fedora the php-posix package is provided by php-process from fedora 11. I assume this change also will hit centos at some point.



回答3:

This work for me where I have problem with symfony.

http://blog.myee.web.id/warning-the-posix_isatty-is-available-failed-install-and-enable-the-php_posix-extension-used-to-colorized-the-cli-output/

I Hope work for you. thanks



回答4:

I am running CentOS 5.3. The PHP that is included already has the Posix functions built in. You may or may not have found the introdctory documentation for the POSIX functions (which indicate that these functions are not available in Windows). Have you tried using a particular function and it didn't work?


    <?php print_r(posix_uname()) ?>

in its own file works for me.