ling
ling

Reputation: 10017

php_posix on mac osx

I'm trying to enable php_posix functions support for php 5.3.6 on Mac OsX 10.6.

Although php doc says posix functions are enabled by default, ( http://php.net/manual/en/posix.installation.php )

if I run a php script with the posix_isatty() function, I get an error: Fatal error: Call to undefined function posix_isatty()

??

My safe_mode is set to Off as recommended by php documentation. I used macport to install php, and it seems that they didn't use --disable-posix.

Here is the portion of my phpinfo() that proves it:

Configure Command './configure' '--prefix=/opt/local' '--mandir=/opt/local/share/man' '--infodir=/opt/local/share/info' '--with-config-file-path=/opt/local/etc/php5' '--with-config-file-scan-dir=/opt/local/var/db/php5' '--disable-all' '--enable-bcmath' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-hash' '--enable-json' '--enable-libxml' '--enable-pdo' '--enable-phar' '--enable-session' '--enable-simplexml' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-bz2=/opt/local' '--with-mhash=/opt/local' '--with-pcre-regex=/opt/local' '--with-readline=/opt/local' '--with-libxml-dir=/opt/local' '--with-zlib=/opt/local' '--without-pear' '--disable-cgi' '--with-apxs2=/opt/local/apache2/bin/apxs'

if I run php -m, php_posix doesn't appear in the modules list.

So my conclusion at this point is: it's not installed.

How can I install it?

Upvotes: 1

Views: 1160

Answers (2)

Steven Green
Steven Green

Reputation: 983

Mac Ports has a package for the PHP Posix module:

sudo port install php55-posix

Replace 55 with the version of php you installed.

Upvotes: 5

aurora
aurora

Reputation: 9627

I think the problem is, that you are using the switch "--disable-all", which -- as far as i know -- deactivates all extensions including posix. I would recommend building PHP without "--disable-all" and use the extension-specific "--disable..." switch if you really need to deactivate some extension.

Upvotes: 2

Related Questions