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.
當我運行php -m cmd時,POSIX沒有出現,但是,我從使用Plesk 9的Linux上的phpinfo()-enable-posix = shared中看到它。
Basically, I can't use posix_*() functions as described at http://www.php.net/manual/en/ref.posix.php
基本上,我不能使用http://www.php.net/manual/en/ref.posix.php中描述的posix _ *()函數。
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
3 个解决方案
#1
38
I found the solution:
我找到了解決方案:
yum install php-process
This package enables php-posix.
這個包啟用php-posix。
#2
3
While resolved, the original problem would seem to be that posix_getpwuid is not supported on Windows:
解決之后,最初的問題似乎是Windows上不支持posix_getpwuid:
來自:http://www.php.net/manual/en/function.posix-getpwuid.php
On Windows, posix_getpwuid() is not implemented
在Windows上,未實現posix_getpwuid()
if you just want the username of the current user, you can use get_current_user().
如果您只想要當前用戶的用戶名,可以使用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').
要正確獲取正在運行的用戶,請測試function_exists('posix_getpwuid'),如果沒有,則假設您在Windows上運行並調用getenv('USERNAME')。
#3
1
In openSUSE use command zypper install php-posix for installing php-process for using php function posix_getuid
在openSUSE中使用命令zypper安裝php-posix來安裝php-process以使用php函數posix_getuid