How to find on what settings php is running



in your webserver where php is installed
create test file called test.php with below content

<?php phpinfo(); ?>

Once done run this file http://hostname/test.php
It give a long information like below
Apache VersionApache/2.2.22 (Ubuntu)
Apache API Version20051115
Server Administratorwebmaster@localhost
Hostname:Port127.0.1.1:80
User/Groupwww-data(33)/33
Max RequestsPer Child: 0 - Keep Alive: on - Max Per Connection: 100
TimeoutsConnection: 300 - Keep-Alive: 5
Virtual ServerYes
Server Root/etc/apache2
Loaded Modulescore mod_log_config mod_logio prefork http_core mod_so mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_reqtimeout mod_setenvif mod_status
DirectiveLocal ValueMaster Value
engine11
last_modified00
xbithack00

Apache Environment

VariableValue
HTTP_HOST192.168.9.123
HTTP_CONNECTIONkeep-alive
HTTP_USER_AGENTMozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODINGgzip,deflate,sdch
HTTP_ACCEPT_LANGUAGEen-US,en;q=0.8
HTTP_ACCEPT_CHARSETISO-8859-1,utf-8;q=0.7,*;q=0.3
PATH/usr/local/bin:/usr/bin:/bin
SERVER_SIGNATURE
Apache/2.2.22 (Ubuntu) Server at 192.168.9.123 Port 80
SERVER_SOFTWAREApache/2.2.22 (Ubuntu)
SERVER_NAME192.168.9.123
SERVER_ADDR192.168.9.123
SERVER_PORT80
REMOTE_ADDR192.168.9.145
DOCUMENT_ROOT/var/www
SERVER_ADMINwebmaster@localhost
SCRIPT_FILENAME/var/www/test.php
REMOTE_PORT65260
GATEWAY_INTERFACECGI/1.1
SERVER_PROTOCOLHTTP/1.1
REQUEST_METHODGET
QUERY_STRINGno value
REQUEST_URI/test.php
SCRIPT_NAME/test.php

HTTP Headers Information

HTTP Request Headers
HTTP RequestGET /test.php HTTP/1.1
Host192.168.9.123
Connectionkeep-alive
User-AgentMozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
Accepttext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encodinggzip,deflate,sdch
Accept-Languageen-US,en;q=0.8
Accept-CharsetISO-8859-1,utf-8;q=0.7,*;q=0.3
HTTP Response Headers
X-Powered-ByPHP/5.3.10-1ubuntu3.4
VaryAccept-Encoding
Content-Encodinggzip

bcmath

BCMath supportenabled
DirectiveLocal ValueMaster Value
bcmath.scale00

bz2

BZip2 SupportEnabled
Stream Wrapper supportcompress.bzip2://
Stream Filter supportbzip2.decompress, bzip2.compress
BZip2 Version1.0.6, 6-Sept-2010

calendar

Calendar supportenabled

Core

PHP Version5.3.10-1ubuntu3.4
DirectiveLocal ValueMaster Value
allow_call_time_pass_referenceOffOff
allow_url_fopenOnOn
allow_url_includeOffOff
always_populate_raw_post_dataOffOff
arg_separator.input&&
arg_separator.output&&
asp_tagsOffOff
auto_append_fileno valueno value
auto_globals_jitOnOn
auto_prepend_fileno valueno value
browscapno valueno value
default_charsetno valueno value
default_mimetypetext/htmltext/html
define_syslog_variablesOffOff
disable_classesno valueno value
disable_functionspcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
display_errorsOffOff
display_startup_errorsOffOff
doc_rootno valueno value
docref_extno valueno value
docref_rootno valueno value
enable_dlOffOff
error_append_stringno valueno value
error_logno valueno value
error_prepend_stringno valueno value
error_reporting2252722527
exit_on_timeoutOffOff
expose_phpOnOn
extension_dir/usr/lib/php5/20090626/usr/lib/php5/20090626
file_uploadsOnOn
highlight.bg#FFFFFF#FFFFFF
highlight.comment#FF8000#FF8000
highlight.default#0000BB#0000BB
highlight.html#000000#000000
highlight.keyword#007700#007700
highlight.string#DD0000#DD0000
html_errorsOffOff
ignore_repeated_errorsOffOff
ignore_repeated_sourceOffOff
ignore_user_abortOffOff
implicit_flushOffOff
include_path.:/usr/share/php:/usr/share/pear.:/usr/share/php:/usr/share/pear
log_errorsOnOn
log_errors_max_len10241024
magic_quotes_gpcOffOff
magic_quotes_runtimeOffOff
magic_quotes_sybaseOffOff
mail.add_x_headerOnOn
mail.force_extra_parametersno valueno value
mail.logno valueno value
max_execution_time3030
max_file_uploads2020
max_input_nesting_level6464
max_input_time6060
max_input_vars10001000
memory_limit128M128M
open_basedirno valueno value
output_buffering40964096
output_handlerno valueno value
post_max_size8M8M
precision1414
realpath_cache_size16K16K
realpath_cache_ttl120120
register_argc_argvOffOff
register_globalsOffOff
register_long_arraysOffOff
report_memleaksOnOn
report_zend_debugOnOn
request_orderGPGP
safe_modeOffOff
safe_mode_exec_dirno valueno value
safe_mode_gidOffOff
safe_mode_include_dirno valueno value
sendmail_fromno valueno value
sendmail_path/usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i 
serialize_precision1717
short_open_tagOnOn
SMTPlocalhostlocalhost
smtp_port2525
sql.safe_modeOffOff
track_errorsOffOff
unserialize_callback_funcno valueno value
upload_max_filesize2M2M
upload_tmp_dirno valueno value
user_dirno valueno value
user_ini.cache_ttl300300
user_ini.filename.user.ini.user.ini
variables_orderGPCSGPCS
xmlrpc_error_number00
xmlrpc_errorsOffOff
y2k_complianceOnOn
zend.enable_gcOnOn

ctype

ctype functionsenabled

date

date/time supportenabled
"Olson" Timezone Database Version0.system
Timezone Databaseinternal
Default timezoneAmerica/Los_Angeles
DirectiveLocal ValueMaster Value
date.default_latitude31.766731.7667
date.default_longitude35.233335.2333
date.sunrise_zenith90.58333390.583333
date.sunset_zenith90.58333390.583333
date.timezoneno valueno value

dba

DBA supportenabled
Supported handlerscdb cdb_make db4 inifile flatfile
DirectiveLocal ValueMaster Value
dba.default_handlerflatfileflatfile

dom

DOM/XMLenabled
DOM/XML API Version20031129
libxml Version2.7.8
HTML Supportenabled
XPath Supportenabled
XPointer Supportenabled
Schema Supportenabled
RelaxNG Supportenabled

ereg

Regex LibraryBundled library enabled

exif

EXIF Supportenabled
EXIF Version1.4 $Id: exif.c 321634 2012-01-01 13:15:04Z felipe $
Supported EXIF Version0220
Supported filetypesJPEG,TIFF
DirectiveLocal ValueMaster Value
exif.decode_jis_intelJISJIS
exif.decode_jis_motorolaJISJIS
exif.decode_unicode_intelUCS-2LEUCS-2LE
exif.decode_unicode_motorolaUCS-2BEUCS-2BE
exif.encode_jisno valueno value
exif.encode_unicodeISO-8859-15ISO-8859-15

fileinfo

fileinfo supportenabled
version1.0.5-dev

filter

Input Validation and Filteringenabled
Revision$Revision: 321634 $
DirectiveLocal ValueMaster Value
filter.defaultunsafe_rawunsafe_raw
filter.default_flagsno valueno value

ftp

FTP supportenabled

gd

GD Supportenabled
GD Version2.0
FreeType Supportenabled
FreeType Linkagewith freetype
FreeType Version2.4.8
T1Lib Supportenabled
GIF Read Supportenabled
GIF Create Supportenabled
JPEG Supportenabled
libJPEG Versionunknown
PNG Supportenabled
libPNG Version1.2.46
WBMP Supportenabled
DirectiveLocal ValueMaster Value
gd.jpeg_ignore_warning00

gettext

GetText Supportenabled

hash

hash supportenabled
Hashing Enginesmd2 md4 md5 sha1 sha224 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost adler32 crc32 crc32b salsa10 salsa20 haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5

iconv

iconv supportenabled
iconv implementationglibc
iconv library version2.15
DirectiveLocal ValueMaster Value
iconv.input_encodingISO-8859-1ISO-8859-1
iconv.internal_encodingISO-8859-1ISO-8859-1
iconv.output_encodingISO-8859-1ISO-8859-1

json

json supportenabled
json version1.2.1

libxml

libXML supportactive
libXML Compiled Version2.7.8
libXML Loaded Version20708
libXML streamsenabled

mbstring

Multibyte Supportenabled
Multibyte string enginelibmbfl
HTTP input encoding translationdisabled
mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.
Multibyte (japanese) regex supportenabled
Multibyte regex (oniguruma) backtrack checkOn
Multibyte regex (oniguruma) version4.7.1
DirectiveLocal ValueMaster Value
mbstring.detect_orderno valueno value
mbstring.encoding_translationOffOff
mbstring.func_overload00
mbstring.http_inputpasspass
mbstring.http_outputpasspass
mbstring.http_output_conv_mimetypes^(text/|application/xhtml\+xml)^(text/|application/xhtml\+xml)
mbstring.internal_encodingno valueno value
mbstring.languageneutralneutral
mbstring.strict_detectionOffOff
mbstring.substitute_characterno valueno value

mcrypt

mcrypt supportenabled
mcrypt_filter supportenabled
Version2.5.8
Api No20021217
Supported cipherscast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modescbc cfb ctr ecb ncfb nofb ofb stream
DirectiveLocal ValueMaster Value
mcrypt.algorithms_dirno valueno value
mcrypt.modes_dirno valueno value

mhash

MHASH supportEnabled
MHASH API VersionEmulated Support

mysql

MySQL Supportenabled
Active Persistent Links0
Active Links0
Client API version5.5.28
MYSQL_MODULE_TYPEexternal
MYSQL_SOCKET/var/run/mysqld/mysqld.sock
MYSQL_INCLUDE-I/usr/include/mysql
MYSQL_LIBS-L/usr/lib/x86_64-linux-gnu -lmysqlclient_r
DirectiveLocal ValueMaster Value
mysql.allow_local_infileOnOn
mysql.allow_persistentOnOn
mysql.connect_timeout6060
mysql.default_hostno valueno value
mysql.default_passwordno valueno value
mysql.default_portno valueno value
mysql.default_socket/var/run/mysqld/mysqld.sock/var/run/mysqld/mysqld.sock
mysql.default_userno valueno value
mysql.max_linksUnlimitedUnlimited
mysql.max_persistentUnlimitedUnlimited
mysql.trace_modeOffOff

mysqli

MysqlI Supportenabled
Client API library version5.5.28
Active Persistent Links0
Inactive Persistent Links0
Active Links0
Client API header version5.5.24
MYSQLI_SOCKET/var/run/mysqld/mysqld.sock
DirectiveLocal ValueMaster Value
mysqli.allow_local_infileOnOn
mysqli.allow_persistentOnOn
mysqli.default_hostno valueno value
mysqli.default_port33063306
mysqli.default_pwno valueno value
mysqli.default_socket/var/run/mysqld/mysqld.sock/var/run/mysqld/mysqld.sock
mysqli.default_userno valueno value
mysqli.max_linksUnlimitedUnlimited
mysqli.max_persistentUnlimitedUnlimited
mysqli.reconnectOffOff

openssl

OpenSSL supportenabled
OpenSSL Library VersionOpenSSL 1.0.1 14 Mar 2012
OpenSSL Header VersionOpenSSL 1.0.1 14 Mar 2012

pcre

PCRE (Perl Compatible Regular Expressions) Supportenabled
PCRE Library Version8.12 2011-01-15
DirectiveLocal ValueMaster Value
pcre.backtrack_limit10000001000000
pcre.recursion_limit100000100000

PDO

PDO supportenabled
PDO driversmysql

pdo_mysql

PDO Driver for MySQLenabled
Client API version5.5.28
DirectiveLocal ValueMaster Value
pdo_mysql.default_socket/var/run/mysqld/mysqld.sock/var/run/mysqld/mysqld.sock

Phar

Phar: PHP Archive supportenabled
Phar EXT version2.0.1
Phar API version1.1.1
SVN revision$Revision: 321634 $
Phar-based phar archivesenabled
Tar-based phar archivesenabled
ZIP-based phar archivesenabled
gzip compressionenabled
bzip2 compressionenabled
Native OpenSSL supportenabled
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
DirectiveLocal ValueMaster Value
phar.cache_listno valueno value
phar.readonlyOnOn
phar.require_hashOnOn

posix

Revision$Revision: 321634 $

Reflection

Reflectionenabled
Version$Revision: 321634 $

session

Session Supportenabled
Registered save handlersfiles user
Registered serializer handlersphp php_binary wddx
DirectiveLocal ValueMaster Value
session.auto_startOffOff
session.bug_compat_42OffOff
session.bug_compat_warnOffOff
session.cache_expire180180
session.cache_limiternocachenocache
session.cookie_domainno valueno value
session.cookie_httponlyOffOff
session.cookie_lifetime00
session.cookie_path//
session.cookie_secureOffOff
session.entropy_fileno valueno value
session.entropy_length00
session.gc_divisor10001000
session.gc_maxlifetime14401440
session.gc_probability00
session.hash_bits_per_character55
session.hash_function00
session.namePHPSESSIDPHPSESSID
session.referer_checkno valueno value
session.save_handlerfilesfiles
session.save_path/var/lib/php5/var/lib/php5
session.serialize_handlerphpphp
session.use_cookiesOnOn
session.use_only_cookiesOnOn
session.use_trans_sid00

shmop

shmop supportenabled

SimpleXML

Simplexml supportenabled
Revision$Revision: 321634 $
Schema supportenabled

soap

Soap Clientenabled
Soap Serverenabled
DirectiveLocal ValueMaster Value
soap.wsdl_cache11
soap.wsdl_cache_dir/tmp/tmp
soap.wsdl_cache_enabled11
soap.wsdl_cache_limit55
soap.wsdl_cache_ttl8640086400

sockets

Sockets Supportenabled

SPL

SPL supportenabled
InterfacesCountable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
ClassesAppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException

standard

Dynamic Library Supportenabled
Path to sendmail/usr/sbin/sendmail -t -i
DirectiveLocal ValueMaster Value
assert.active11
assert.bail00
assert.callbackno valueno value
assert.quiet_eval00
assert.warning11
auto_detect_line_endings00
default_socket_timeout6060
fromno valueno value
safe_mode_allowed_env_varsPHP_PHP_
safe_mode_protected_env_varsLD_LIBRARY_PATHLD_LIBRARY_PATH
url_rewriter.tagsa=href,area=href,frame=src,input=src,form=fakeentrya=href,area=href,frame=src,input=src,form=fakeentry
user_agentno valueno value

sysvmsg

sysvmsg supportenabled
Revision$Revision: 321634 $

tokenizer

Tokenizer Supportenabled

wddx

WDDX Supportenabled
WDDX Session Serializerenabled

xml

XML Supportactive
XML Namespace Supportactive
libxml2 Version2.7.8

xmlreader

XMLReaderenabled

xmlwriter

XMLWriterenabled

zip

Zipenabled
Extension Version$Id: php_zip.c 321634 2012-01-01 13:15:04Z felipe $
Zip version1.9.1
Libzip version0.9.0

zlib

ZLib Supportenabled
Stream Wrapper supportcompress.zlib://
Stream Filter supportzlib.inflate, zlib.deflate
Compiled Version1.2.1.1
Linked Version1.2.3.4
DirectiveLocal ValueMaster Value
zlib.output_compressionOffOff
zlib.output_compression_level-1-1
zlib.output_handlerno valueno value

Additional Modules

Module Name
sysvsem
sysvshm

Environment

VariableValue
APACHE_RUN_DIR/var/run/apache2
APACHE_PID_FILE/var/run/apache2.pid
PATH/usr/local/bin:/usr/bin:/bin
APACHE_LOCK_DIR/var/lock/apache2
LANGC
APACHE_RUN_USERwww-data
APACHE_RUN_GROUPwww-data
APACHE_LOG_DIR/var/log/apache2
PWD/home/naresh

PHP Variables

VariableValue
_SERVER["HTTP_HOST"]192.168.9.123
_SERVER["HTTP_CONNECTION"]keep-alive
_SERVER["HTTP_USER_AGENT"]Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
_SERVER["HTTP_ACCEPT"]text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
_SERVER["HTTP_ACCEPT_ENCODING"]gzip,deflate,sdch
_SERVER["HTTP_ACCEPT_LANGUAGE"]en-US,en;q=0.8
_SERVER["HTTP_ACCEPT_CHARSET"]ISO-8859-1,utf-8;q=0.7,*;q=0.3
_SERVER["PATH"]/usr/local/bin:/usr/bin:/bin
_SERVER["SERVER_SIGNATURE"]
Apache/2.2.22 (Ubuntu) Server at 192.168.9.123 Port 80
_SERVER["SERVER_SOFTWARE"]Apache/2.2.22 (Ubuntu)
_SERVER["SERVER_NAME"]192.168.9.123
_SERVER["SERVER_ADDR"]192.168.9.123
_SERVER["SERVER_PORT"]80
_SERVER["REMOTE_ADDR"]192.168.9.145
_SERVER["DOCUMENT_ROOT"]/var/www
_SERVER["SERVER_ADMIN"]webmaster@localhost
_SERVER["SCRIPT_FILENAME"]/var/www/test.php
_SERVER["REMOTE_PORT"]65260
_SERVER["GATEWAY_INTERFACE"]CGI/1.1
_SERVER["SERVER_PROTOCOL"]HTTP/1.1
_SERVER["REQUEST_METHOD"]GET
_SERVER["QUERY_STRING"]no value
_SERVER["REQUEST_URI"]/test.php
_SERVER["SCRIPT_NAME"]/test.php
_SERVER["PHP_SELF"]/test.php
_SERVER["REQUEST_TIME"]1347181887

PHP License

This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.