php_uname

(PHP 4 >= 4.0.2, PHP 5, PHP 7)

php_unameReturns information about the operating system PHP is running on

Description

string php_uname ([ string $mode = "a" ] )

php_uname() returns a description of the operating system PHP is running on. This is the same string you see at the very top of the phpinfo() output. For the name of just the operating system, consider using the PHP_OS constant, but keep in mind this constant will contain the operating system PHP was built on.

On some older UNIX platforms, it may not be able to determine the current OS information in which case it will revert to displaying the OS PHP was built on. This will only happen if your uname() library call either doesn't exist or doesn't work.

Parameters

mode

mode is a single character that defines what information is returned:

  • 'a': This is the default. Contains all modes in the sequence "s n r v m".
  • 's': Operating system name. eg. FreeBSD.
  • 'n': Host name. eg. localhost.example.com.
  • 'r': Release name. eg. 5.1.2-RELEASE.
  • 'v': Version information. Varies a lot between operating systems.
  • 'm': Machine type. eg. i386.

Return Values

Returns the description, as a string.

Examples

Example #1 Some php_uname() examples

<?php
echo fpurpose">() stylenAHcriptionfppose"><000"> Linux Linuxose"><000"> Operat : Rel Operatose"><000"> ref='/m rINNT000"> */ose"><000"> fpif () stylenAHcrontoun/wrspan>fpu style="color: #007700">() stylenAHcrubronspan>fpu style="color: #007700">() stylenAHcriptionfp, () stylenAHc0nfp, () stylenAHc3nfp)) () sDDass="p'rIN'nfp) () sDDass="p'impa < fppose"><} () sDDass="p'impa < fppose"><}ose"><000"> izer"> = ge=function.as bThape ape alsolt b href='/manase /a> ion.arametparac:ss="title">Examples

2

php_uname() examples

<?php
echDIRECTORY_SEPARATORnfpp /> <?php
echriptSHLIB_SUFFIXnfpp /> <?php
echrATH_SEPARATORnfpp /><000"> // <?php
echDIRECTORY_SEPARATORnfpp /> <?php
echriptSHLIB_SUFFIXnfpp /> <?php
echrATH_SEPARATORnfpp /> izer"> = ge=function.as

seeAlsop"e s="function"> seeAlsop"e Return Val >php/a> 39; web dd> < manues.htspan cl
  • seeAlsop"e <"function. - n/refsspan> — . n.as
    nanuadiv id="function">
    string you a at the very ass="chaadd-nanu ?bug_type=Documentat/repf="fr ?.js"> e'rand"><'12'src="/im'12'iptimall>add aa"> e.ismall>ion.phpinfo id="refsect1-functioa hrel/en/ibus.baNanuav> string you coun> 2a"> es.ispan cle-exan.php-uname">Reallnanuadiv
    v nanua-vanuu">upmp;manpage=functio
    v nanua-vanu <...">v <1anpage=function.php- rel="s the os="functudd>r2rem>Grzpphp_ae ve="functgenan &h3 c;p_ae iv ifsect1-ditle="ef="ht2012-09-29 05:07trong>Exam5 years agostrong>php_er="Search" o">
    vng>

    > Nanuarametase ion't 4218PHP irametiturrent .baS informationp>

    > p_er="Search" o"> "ot3>

    v nanua-vanuu">upmp;manpage=functio
    v nanua-vanu <...">v <-2anpage=function.php- rel="s the os="functudd>r2rem>Yzmir Ramireze. egstrong>php_ae ve="functgenan &h3 c;p_ae iv ifsect1-ditle="ef="ht2011-08-24 10:s="pong>Exam6 years agostrong>php_er="Search" o">
    vng>

    > Nanuarametple #1 Som'n') liba"> always eqscal$_SERVER['HOST_NAME']ose"><000"> Tn/sempara"> ametHP iape criptione def="screparadd> < ss=yinff t hmpara"> s s inon't uddode> ill dtionurlsr Machine M > > p_er=" izer"> =ng>

    foothe very ass="chaadd-nanu ?bug_type=Documentat/repf="fr ?.js"> e'rand"><'12'src="/im'12'iptimall>add aa"> e.ismall>ion.ph
    em>: Ma s.ie ="layout" clas p.ne type. egae na/p> '="layouext '>Parameters <>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thnterrt-o/dd>
    e="ef="htnterrt_​o/dd> ">nterrt_​o/dd> HP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thnterrt
    e="ef="htnterrt">nterrtHP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thcli-tion
    php
    e="ef="htcli_​tio_​
    <_​functiocli_​tio_​
    <_​functHP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thcli-sion
    php
    e="ef="htcli_​sio_​
    <_​functiocli_​sio_​
    <_​functHP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thdl
    e="ef="htdl>>dlHP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of the
    e
    >>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgcut"ref='-cyc
    >>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgcunfon sod>gc_​nfon soHP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgcuena sod>gc_​ena soHP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgcuena sodd>gc_​ena so+HP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgcumem-" typdd>gc_​mem_​t typdHP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgioncfg-v>
    href="htgio_​cfg_​v><">gio_​cfg_​v>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgioncs, it -udd>/dd> href="htgio_​cs, it _​udd>r2gio_​cs, it _​udd>HP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgionef='/ma-/a>
    r2gio_​ef='/ma_​t"> HP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgione
    >>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgioninclud pars< href="htgio_​includ _​ rs>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgioninclud dd>
    >>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgion/feam+ne
    >>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgion/a> <-gpcd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgion/a> <-runtimed>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgionrequir dd>
    >>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgionresourc
    >>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgioenvd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgionvotmodd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgiomygidd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgiomyind>
    >>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgiomypidd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgiomyuidd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgioass=>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thgior/en/f=>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thini-.php-=>ini_​.php-eatump;perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thini-gionall=>ini_​gio_​alleatump;perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thini-gio=>ini_​gioeatump;perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thini-restore=>ini_​restoreeatump;perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thini-sio=>ini_​sioeatump;perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of th/a> <-runtimed>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thlay"d>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thlemory-tion eak-/en/f=>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thlemory-tion/en/f=>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thref=ini-/feam+n
    >>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thref=ini-scann dd>
    >>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thref= cla-guidd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thref=lass="prev"> sref="hte >>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involvecs, it d"eters>>>>>>>>>>>>>>>>>> very top of thref=u"prev"> sref="hte >>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of threfclass="next"sref="hte >>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of threfspan classref="hte >>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of threfvmpara" classref="hte >>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thruoenvd>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of threstoreninclud pars< href="htrestore_​includ _​ rs>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thsioninclud pars< href="htsio_​includ _​ rs>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thsion/a> <-runtimed>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thsiontime-limitd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thsys-tiontemp-di-=>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thvmpara">=>">vmpara"_​t"sh3 >HP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>eters>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thzend= cla-guidd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thzend=theadc-idd>>>>>>>>>>>>>>>get-involved"eters>>>>>>>>>>>>>>>>>> very top of thzend=vmpara" classref="htzendn​vmpara"p"zendn​vmpara"HP&perm>>>>>>>>>>>>>>>>>> /rating syste type. e>>>>>>>>>>>>eters>>>>>>>>>>em>. e>>>>>>>>>>>>eters>> /rating syste type. e>>>>>>>>eters>>>>>>>>>>em>. HP&e nathe d p_er=" .ie ="layo p.ne type. e>ete