Equivalent of PHP's print_r(), var_dump(), or var

Does anyone know the Java equivalent of PHP's print_r(), var_dump(), or var_export()?
I just started with Java a few days ago and I'm having a really tough time debugging stuff.
Thanks!

You might want to read: http://today.java.net/today/2004/05/05/HardcoreJava.pdf
This is a chapter from O'Reilly's Hardcore Java (http://www.oreilly.com/catalog/hardcorejv/) Review of book here: http://www.jaxmagazine.com/itr/buchtipps/psecom,id,283,nodeid,148.html
I have only briefed through it (I am also coming from php and looking for the same answer that you are), and there is some sort of generic toString-method that will print out more or less var_dump()-like strings.
I gave up this way as I did not want to buy the mentioned book, and believe there is a simpler solution out there.
I have found JOI - Java Object Inspector (http://www.programmers-friend.org/JOI/), which I am about to start using, hoping it will be helpful although clumsy as it cannot be used in logs etc.
The optimal would of course be a function String varToString(Object object) that used reflection-methods to output detailed information about object's insides, although I have not found any. I am building a lite version myself at this moment, being able to output at least strings and nested arrays.
I believe somebody have written something similar? Please share, if so!

Similar Messages

  • Applescript equivalent of PHP $$ variable

    Hi, i hope someone can help with this.
    I'm new to mac developing and am trying to write a simple mac app to output some serial commands. This is all working fine but the software i'm using to output the serial commands works on applescript, hence using it over a purely Cocoa application.
    Anyway, i have a series of buttons called statusButton1 to statusButton 12 say, and i want to turn them green (from grey) when they are clicked. I can do that by the command
    statusButton1's setImage_(greenLightImage)
    Where greenLightImage is the variable of the green button image.
    What I am trying to avoid is a pile of if statements to turn the correct button green and the others off depending on which button is pressed. I am currently calling a function passing the number of the button pressed.
    What i would like to do is something like...
    statusButton(passedVariable) setImage_(greenLightImage)
    I've done a lot of PHP programming before and in that language i would do something like
    $temp = "statusButton" . $passedVariable
    $$temp... (whatever command to change image)
    I have tried many things and can't find an equivalent. Is there such a thing, or is there a better way (sure there is)
    Thanks

    AppleScript doesn't have a lot of language features such as pointers or variable variables, but when you have several items that you deal with often, usually you can put them into a list (or record) and then index into or loop through the items, for example:
    # a property or top level variable containing all of the buttons
    set buttonList to {statusButton1, statusButton2, statusButton3, statusButton4}
    on doButton:sender # handle button press
      repeat with aButton in buttonList
        (aButton's setImage:greyImage) # unset
      end repeat
      sender's setImage:greenLightImage # reset
      # whatever
    end doButton:
    Edit to add:
    Cocoa also has several classes that provide methods for managing arrays (lists) and dictionaries (records), as well as some controller classes for various object collections.

  • Does lion server dovecot have the equivalent of the "mail_location = mbox:~/IMAP:INBOX=/var/mail/%u" setting.

      I have a lot of legacy users migrating from unix/linux that use the old setting for folders for holding their imap mail.  The new way of storing mail doesn't allow containers for folders, and I can't think of an easy way to convert a gigabyte or so of old mail that's on the old Linux server running dovecot.

    Update for Mavericks-
    I don't know if this is totally accurate, but it worked. After upgrading to Mavericks, the previous setup above disappeared. Something in the Dovecot setup is different now, and these changes brought it back.
    edit files have moved to /Library/Server/Mail/Config/dovecot/conf.d/
    do the same edits as outlined above except for the last one- 10-mail.conf
    The Namespace sections have changed. Using the above reference, I made these changes. **Uncomment means to remove the # from the first of the line.
    namespace inbox {
    **uncomment type = private
    **uncomment separator = ^ (add this character)
    **uncomment prefix =
    In the next two sections (shared namespaces) change the prefix lines to match the separator ^ (you're replacing the periods with the new delimiter.) Mavericks activates these namespaces by default- I don't know what they do. It won't work unless you make them match.
    namespace acl-mailboxes {
    prefix = shared^%%u^
    namespace list-archives {
    prefix = archives^%%u^
    Stop and restart mail service and all is back to the way it was.

  • Nginx + php-fpm problem

    Hello there.
    I just setup nginx with mysql and php-fpm to my archlinux install and i need help.
    i checked all over internet and try every solution, none still work.
    i have a blank page problem
    this is working correctly:
    <?php
    phpinfo();
    ?>
    short tags are enabled and php short tags are also working.
    i try to install phpbb, the install page load, once the install done.. blank page.
    i tryed a working backup of phpbb from my old server.. blank page, same with my phpnuke backup, blank page.
    i tryed chown to root:root and http:http, and chmod rwx for group user and other, i dont think it is a permission problem.
    Probably a little stupid error on my end but i can't find it, i tryed everything.
    my nginx.cong
    #user html;
    worker_processes 1;
    #error_log logs/error.log;
    #error_log logs/error.log notice;
    #error_log logs/error.log info;
    #pid logs/nginx.pid;
    events {
    worker_connections 1024;
    http {
    include mime.types;
    default_type application/octet-stream;
    #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    # '$status $body_bytes_sent "$http_referer" '
    # '"$http_user_agent" "$http_x_forwarded_for"';
    #access_log logs/access.log main;
    sendfile on;
    #tcp_nopush on;
    #keepalive_timeout 0;
    keepalive_timeout 65;
    #gzip on;
    server {
    listen 80;
    server_name localhost;
    #charset koi8-r;
    #access_log logs/host.access.log main;
    location / {
    root /usr/share/nginx/html;
    index index.html index.htm;
    #error_page 404 /404.html;
    # redirect server error pages to the static page /50x.html
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root /usr/share/nginx/html;
    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #location ~ \.php$ {
    # proxy_pass http://127.0.0.1;
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #location ~ \.php$ {
    # root html;
    # fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
    # fastcgi_index index.php;
    # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    # include fastcgi_params;
    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #location ~ /\.ht {
    # deny all;
    # another virtual host using mix of IP-, name-, and port-based configuration
    #server {
    # listen 8000;
    # listen somename:8080;
    # server_name somename alias another.alias;
    # location / {
    # root html;
    # index index.html index.htm;
    server {
    listen 80;
    listen clan-ws.net:80;
    server_name clan-ws.net www.clan-ws.net;
    autoindex on;
    root /srv/http/;
    index index.html index.htm index.php;
    location ~ \.php$ {
    #fastcgi_pass 127.0.0.1:9000;
    fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
    fastcgi_index index.php;
    # include fastcgi.conf;
    include fastcgi_params;
    # include /etc/nginx/fastcgi_params;
    # HTTPS server
    #server {
    # listen 443;
    # server_name localhost;
    # ssl on;
    # ssl_certificate cert.pem;
    # ssl_certificate_key cert.key;
    # ssl_session_timeout 5m;
    # ssl_protocols SSLv2 SSLv3 TLSv1;
    # ssl_ciphers HIGH:!aNULL:!MD5;
    # ssl_prefer_server_ciphers on;
    # location / {
    # root html;
    # index index.html index.htm;
    php-fpm.conf
    ; FPM Configuration ;
    ; All relative paths in this configuration file are relative to PHP's install
    ; prefix (/usr). This prefix can be dynamicaly changed by using the
    ; '-p' argument from the command line.
    ; Include one or more files. If glob(3) exists, it is used to include a bunch of
    ; files from a glob(3) pattern. This directive can be used everywhere in the
    ; file.
    ; Relative path can also be used. They will be prefixed by:
    ; - the global prefix if it's been set (-p arguement)
    ; - /usr otherwise
    ;include=/etc/php/fpm.d/*.conf
    ; Global Options ;
    [global]
    ; Pid file
    ; Note: the default prefix is /var
    ; Default Value: none
    pid = /run/php-fpm/php-fpm.pid
    ; Error log file
    ; If it's set to "syslog", log is sent to syslogd instead of being written
    ; in a local file.
    ; Note: the default prefix is /var
    ; Default Value: log/php-fpm.log
    ;error_log = log/php-fpm.log
    ; syslog_facility is used to specify what type of program is logging the
    ; message. This lets syslogd specify that messages from different facilities
    ; will be handled differently.
    ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
    ; Default Value: daemon
    ;syslog.facility = daemon
    ; syslog_ident is prepended to every message. If you have multiple FPM
    ; instances running on the same server, you can change the default value
    ; which must suit common needs.
    ; Default Value: php-fpm
    ;syslog.ident = php-fpm
    ; Log level
    ; Possible Values: alert, error, warning, notice, debug
    ; Default Value: notice
    ;log_level = notice
    ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
    ; interval set by emergency_restart_interval then FPM will restart. A value
    ; of '0' means 'Off'.
    ; Default Value: 0
    ;emergency_restart_threshold = 0
    ; Interval of time used by emergency_restart_interval to determine when
    ; a graceful restart will be initiated. This can be useful to work around
    ; accidental corruptions in an accelerator's shared memory.
    ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
    ; Default Unit: seconds
    ; Default Value: 0
    ;emergency_restart_interval = 0
    ; Time limit for child processes to wait for a reaction on signals from master.
    ; Available units: s(econds), m(inutes), h(ours), or d(ays)
    ; Default Unit: seconds
    ; Default Value: 0
    ;process_control_timeout = 0
    ; The maximum number of processes FPM will fork. This has been design to control
    ; the global number of processes when using dynamic PM within a lot of pools.
    ; Use it with caution.
    ; Note: A value of 0 indicates no limit
    ; Default Value: 0
    ; process.max = 128
    ; Specify the nice(2) priority to apply to the master process (only if set)
    ; The value can vary from -19 (highest priority) to 20 (lower priority)
    ; Note: - It will only work if the FPM master process is launched as root
    ; - The pool process will inherit the master process priority
    ; unless it specified otherwise
    ; Default Value: no set
    ; process.priority = -19
    ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
    ; Default Value: yes
    ;daemonize = yes
    ; Set open file descriptor rlimit for the master process.
    ; Default Value: system defined value
    ;rlimit_files = 1024
    ; Set max core size rlimit for the master process.
    ; Possible Values: 'unlimited' or an integer greater or equal to 0
    ; Default Value: system defined value
    ;rlimit_core = 0
    ; Specify the event mechanism FPM will use. The following is available:
    ; - select (any POSIX os)
    ; - poll (any POSIX os)
    ; - epoll (linux >= 2.5.44)
    ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
    ; - /dev/poll (Solaris >= 7)
    ; - port (Solaris >= 10)
    ; Default Value: not set (auto detection)
    ;events.mechanism = epoll
    ; When FPM is build with systemd integration, specify the interval,
    ; in second, between health report notification to systemd.
    ; Set to 0 to disable.
    ; Available Units: s(econds), m(inutes), h(ours)
    ; Default Unit: seconds
    ; Default value: 10
    ;systemd_interval = 10
    ; Pool Definitions ;
    ; Multiple pools of child processes may be started with different listening
    ; ports and different management options. The name of the pool will be
    ; used in logs and stats. There is no limitation on the number of pools which
    ; FPM can handle. Your system will tell you anyway :)
    ; Start a new pool named 'www'.
    ; the variable $pool can we used in any directive and will be replaced by the
    ; pool name ('www' here)
    [www]
    ; Per pool prefix
    ; It only applies on the following directives:
    ; - 'slowlog'
    ; - 'listen' (unixsocket)
    ; - 'chroot'
    ; - 'chdir'
    ; - 'php_values'
    ; - 'php_admin_values'
    ; When not set, the global prefix (or /usr) applies instead.
    ; Note: This directive can also be relative to the global prefix.
    ; Default Value: none
    ;prefix = /path/to/pools/$pool
    ; Unix user/group of processes
    ; Note: The user is mandatory. If the group is not set, the default user's group
    ; will be used.
    user = http
    group = http
    ; The address on which to accept FastCGI requests.
    ; Valid syntaxes are:
    ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
    ; a specific port;
    ; 'port' - to listen on a TCP socket to all addresses on a
    ; specific port;
    ; '/path/to/unix/socket' - to listen on a unix socket.
    ; Note: This value is mandatory.
    ;listen = 127.0.0.1:9000
    listen = /run/php-fpm/php-fpm.sock
    ; Set listen(2) backlog.
    ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
    ;listen.backlog = 128
    ; Set permissions for unix socket, if one is used. In Linux, read/write
    ; permissions must be set in order to allow connections from a web server. Many
    ; BSD-derived systems allow connections regardless of permissions.
    ; Default Values: user and group are set as the running user
    ; mode is set to 0666
    listen.owner = http
    listen.group = http
    listen.mode = 0660
    ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
    ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
    ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
    ; must be separated by a comma. If this value is left blank, connections will be
    ; accepted from any ip address.
    ; Default Value: any
    ;listen.allowed_clients = 127.0.0.1
    ; Specify the nice(2) priority to apply to the pool processes (only if set)
    ; The value can vary from -19 (highest priority) to 20 (lower priority)
    ; Note: - It will only work if the FPM master process is launched as root
    ; - The pool processes will inherit the master process priority
    ; unless it specified otherwise
    ; Default Value: no set
    ; priority = -19
    ; Choose how the process manager will control the number of child processes.
    ; Possible Values:
    ; static - a fixed number (pm.max_children) of child processes;
    ; dynamic - the number of child processes are set dynamically based on the
    ; following directives. With this process management, there will be
    ; always at least 1 children.
    ; pm.max_children - the maximum number of children that can
    ; be alive at the same time.
    ; pm.start_servers - the number of children created on startup.
    ; pm.min_spare_servers - the minimum number of children in 'idle'
    ; state (waiting to process). If the number
    ; of 'idle' processes is less than this
    ; number then some children will be created.
    ; pm.max_spare_servers - the maximum number of children in 'idle'
    ; state (waiting to process). If the number
    ; of 'idle' processes is greater than this
    ; number then some children will be killed.
    ; ondemand - no children are created at startup. Children will be forked when
    ; new requests will connect. The following parameter are used:
    ; pm.max_children - the maximum number of children that
    ; can be alive at the same time.
    ; pm.process_idle_timeout - The number of seconds after which
    ; an idle process will be killed.
    ; Note: This value is mandatory.
    pm = dynamic
    ; The number of child processes to be created when pm is set to 'static' and the
    ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
    ; This value sets the limit on the number of simultaneous requests that will be
    ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
    ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
    ; CGI. The below defaults are based on a server without much resources. Don't
    ; forget to tweak pm.* to fit your needs.
    ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
    ; Note: This value is mandatory.
    pm.max_children = 5
    ; The number of child processes created on startup.
    ; Note: Used only when pm is set to 'dynamic'
    ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
    pm.start_servers = 2
    ; The desired minimum number of idle server processes.
    ; Note: Used only when pm is set to 'dynamic'
    ; Note: Mandatory when pm is set to 'dynamic'
    pm.min_spare_servers = 1
    ; The desired maximum number of idle server processes.
    ; Note: Used only when pm is set to 'dynamic'
    ; Note: Mandatory when pm is set to 'dynamic'
    pm.max_spare_servers = 3
    ; The number of seconds after which an idle process will be killed.
    ; Note: Used only when pm is set to 'ondemand'
    ; Default Value: 10s
    ;pm.process_idle_timeout = 10s;
    ; The number of requests each child process should execute before respawning.
    ; This can be useful to work around memory leaks in 3rd party libraries. For
    ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
    ; Default Value: 0
    ;pm.max_requests = 500
    ; The URI to view the FPM status page. If this value is not set, no URI will be
    ; recognized as a status page. It shows the following informations:
    ; pool - the name of the pool;
    ; process manager - static, dynamic or ondemand;
    ; start time - the date and time FPM has started;
    ; start since - number of seconds since FPM has started;
    ; accepted conn - the number of request accepted by the pool;
    ; listen queue - the number of request in the queue of pending
    ; connections (see backlog in listen(2));
    ; max listen queue - the maximum number of requests in the queue
    ; of pending connections since FPM has started;
    ; listen queue len - the size of the socket queue of pending connections;
    ; idle processes - the number of idle processes;
    ; active processes - the number of active processes;
    ; total processes - the number of idle + active processes;
    ; max active processes - the maximum number of active processes since FPM
    ; has started;
    ; max children reached - number of times, the process limit has been reached,
    ; when pm tries to start more children (works only for
    ; pm 'dynamic' and 'ondemand');
    ; Value are updated in real time.
    ; Example output:
    ; pool: www
    ; process manager: static
    ; start time: 01/Jul/2011:17:53:49 +0200
    ; start since: 62636
    ; accepted conn: 190460
    ; listen queue: 0
    ; max listen queue: 1
    ; listen queue len: 42
    ; idle processes: 4
    ; active processes: 11
    ; total processes: 15
    ; max active processes: 12
    ; max children reached: 0
    ; By default the status page output is formatted as text/plain. Passing either
    ; 'html', 'xml' or 'json' in the query string will return the corresponding
    ; output syntax. Example:
    ; http://www.foo.bar/status
    ; http://www.foo.bar/status?json
    ; http://www.foo.bar/status?html
    ; http://www.foo.bar/status?xml
    ; By default the status page only outputs short status. Passing 'full' in the
    ; query string will also return status for each pool process.
    ; Example:
    ; http://www.foo.bar/status?full
    ; http://www.foo.bar/status?json&full
    ; http://www.foo.bar/status?html&full
    ; http://www.foo.bar/status?xml&full
    ; The Full status returns for each process:
    ; pid - the PID of the process;
    ; state - the state of the process (Idle, Running, ...);
    ; start time - the date and time the process has started;
    ; start since - the number of seconds since the process has started;
    ; requests - the number of requests the process has served;
    ; request duration - the duration in µs of the requests;
    ; request method - the request method (GET, POST, ...);
    ; request URI - the request URI with the query string;
    ; content length - the content length of the request (only with POST);
    ; user - the user (PHP_AUTH_USER) (or '-' if not set);
    ; script - the main script called (or '-' if not set);
    ; last request cpu - the %cpu the last request consumed
    ; it's always 0 if the process is not in Idle state
    ; because CPU calculation is done when the request
    ; processing has terminated;
    ; last request memory - the max amount of memory the last request consumed
    ; it's always 0 if the process is not in Idle state
    ; because memory calculation is done when the request
    ; processing has terminated;
    ; If the process is in Idle state, then informations are related to the
    ; last request the process has served. Otherwise informations are related to
    ; the current request being served.
    ; Example output:
    ; pid: 31330
    ; state: Running
    ; start time: 01/Jul/2011:17:53:49 +0200
    ; start since: 63087
    ; requests: 12808
    ; request duration: 1250261
    ; request method: GET
    ; request URI: /test_mem.php?N=10000
    ; content length: 0
    ; user: -
    ; script: /home/fat/web/docs/php/test_mem.php
    ; last request cpu: 0.00
    ; last request memory: 0
    ; Note: There is a real-time FPM status monitoring sample web page available
    ; It's available in: ${prefix}/share/fpm/status.html
    ; Note: The value must start with a leading slash (/). The value can be
    ; anything, but it may not be a good idea to use the .php extension or it
    ; may conflict with a real PHP file.
    ; Default Value: not set
    ;pm.status_path = /status
    ; The ping URI to call the monitoring page of FPM. If this value is not set, no
    ; URI will be recognized as a ping page. This could be used to test from outside
    ; that FPM is alive and responding, or to
    ; - create a graph of FPM availability (rrd or such);
    ; - remove a server from a group if it is not responding (load balancing);
    ; - trigger alerts for the operating team (24/7).
    ; Note: The value must start with a leading slash (/). The value can be
    ; anything, but it may not be a good idea to use the .php extension or it
    ; may conflict with a real PHP file.
    ; Default Value: not set
    ;ping.path = /ping
    ; This directive may be used to customize the response of a ping request. The
    ; response is formatted as text/plain with a 200 response code.
    ; Default Value: pong
    ;ping.response = pong
    ; The access log file
    ; Default: not set
    ;access.log = log/$pool.access.log
    ; The access log format.
    ; The following syntax is allowed
    ; %%: the '%' character
    ; %C: %CPU used by the request
    ; it can accept the following format:
    ; - %{user}C for user CPU only
    ; - %{system}C for system CPU only
    ; - %{total}C for user + system CPU (default)
    ; %d: time taken to serve the request
    ; it can accept the following format:
    ; - %{seconds}d (default)
    ; - %{miliseconds}d
    ; - %{mili}d
    ; - %{microseconds}d
    ; - %{micro}d
    ; %e: an environment variable (same as $_ENV or $_SERVER)
    ; it must be associated with embraces to specify the name of the env
    ; variable. Some exemples:
    ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
    ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
    ; %f: script filename
    ; %l: content-length of the request (for POST request only)
    ; %m: request method
    ; %M: peak of memory allocated by PHP
    ; it can accept the following format:
    ; - %{bytes}M (default)
    ; - %{kilobytes}M
    ; - %{kilo}M
    ; - %{megabytes}M
    ; - %{mega}M
    ; %n: pool name
    ; %o: ouput header
    ; it must be associated with embraces to specify the name of the header:
    ; - %{Content-Type}o
    ; - %{X-Powered-By}o
    ; - %{Transfert-Encoding}o
    ; %p: PID of the child that serviced the request
    ; %P: PID of the parent of the child that serviced the request
    ; %q: the query string
    ; %Q: the '?' character if query string exists
    ; %r: the request URI (without the query string, see %q and %Q)
    ; %R: remote IP address
    ; %s: status (response code)
    ; %t: server time the request was received
    ; it can accept a strftime(3) format:
    ; %d/%b/%Y:%H:%M:%S %z (default)
    ; %T: time the log has been written (the request has finished)
    ; it can accept a strftime(3) format:
    ; %d/%b/%Y:%H:%M:%S %z (default)
    ; %u: remote user
    ; Default: "%R - %u %t \"%m %r\" %s"
    ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
    ; The log file for slow requests
    ; Default Value: not set
    ; Note: slowlog is mandatory if request_slowlog_timeout is set
    ;slowlog = log/$pool.log.slow
    ; The timeout for serving a single request after which a PHP backtrace will be
    ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
    ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
    ; Default Value: 0
    ;request_slowlog_timeout = 0
    ; The timeout for serving a single request after which the worker process will
    ; be killed. This option should be used when the 'max_execution_time' ini option
    ; does not stop script execution for some reason. A value of '0' means 'off'.
    ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
    ; Default Value: 0
    ;request_terminate_timeout = 0
    ; Set open file descriptor rlimit.
    ; Default Value: system defined value
    ;rlimit_files = 1024
    ; Set max core size rlimit.
    ; Possible Values: 'unlimited' or an integer greater or equal to 0
    ; Default Value: system defined value
    ;rlimit_core = 0
    ; Chroot to this directory at the start. This value must be defined as an
    ; absolute path. When this value is not set, chroot is not used.
    ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
    ; of its subdirectories. If the pool prefix is not set, the global prefix
    ; will be used instead.
    ; Note: chrooting is a great security feature and should be used whenever
    ; possible. However, all PHP paths will be relative to the chroot
    ; (error_log, sessions.save_path, ...).
    ; Default Value: not set
    ;chroot =
    ; Chdir to this directory at the start.
    ; Note: relative path can be used.
    ; Default Value: current directory or / when chroot
    ;chdir = /srv/http
    ; Redirect worker stdout and stderr into main error log. If not set, stdout and
    ; stderr will be redirected to /dev/null according to FastCGI specs.
    ; Note: on highloaded environement, this can cause some delay in the page
    ; process time (several ms).
    ; Default Value: no
    ;catch_workers_output = yes
    ; Limits the extensions of the main script FPM will allow to parse. This can
    ; prevent configuration mistakes on the web server side. You should only limit
    ; FPM to .php extensions to prevent malicious users to use other extensions to
    ; exectute php code.
    ; Note: set an empty value to allow all extensions.
    ; Default Value: .php
    ;security.limit_extensions = .php .php3 .php4 .php5
    ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
    ; the current environment.
    ; Default Value: clean env
    ;env[HOSTNAME] = $HOSTNAME
    ;env[PATH] = /usr/local/bin:/usr/bin:/bin
    ;env[TMP] = /tmp
    ;env[TMPDIR] = /tmp
    ;env[TEMP] = /tmp
    ; Additional php.ini defines, specific to this pool of workers. These settings
    ; overwrite the values previously defined in the php.ini. The directives are the
    ; same as the PHP SAPI:
    ; php_value/php_flag - you can set classic ini defines which can
    ; be overwritten from PHP call 'ini_set'.
    ; php_admin_value/php_admin_flag - these directives won't be overwritten by
    ; PHP call 'ini_set'
    ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
    ; Defining 'extension' will load the corresponding shared extension from
    ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
    ; overwrite previously defined php.ini values, but will append the new value
    ; instead.
    ; Note: path INI options can be relative and will be expanded with the prefix
    ; (pool, global or /usr)
    ; Default Value: nothing is defined by default except the values in php.ini and
    ; specified at startup with the -d argument
    ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]
    ;php_flag[display_errors] = off
    ;php_admin_value[error_log] = /var/log/fpm-php.www.log
    ;php_admin_flag[log_errors] = on
    ;php_admin_value[memory_limit] = 32M
    php.ini
    [PHP]
    ; About php.ini ;
    ; PHP's initialization file, generally called php.ini, is responsible for
    ; configuring many of the aspects of PHP's behavior.
    ; PHP attempts to find and load this configuration from a number of locations.
    ; The following is a summary of its search order:
    ; 1. SAPI module specific location.
    ; 2. The PHPRC environment variable. (As of PHP 5.2.0)
    ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0)
    ; 4. Current working directory (except CLI)
    ; 5. The web server's directory (for SAPI modules), or directory of PHP
    ; (otherwise in Windows)
    ; 6. The directory from the --with-config-file-path compile time option, or the
    ; Windows directory (C:\windows or C:\winnt)
    ; See the PHP docs for more specific information.
    ; http://php.net/configuration.file
    ; The syntax of the file is extremely simple. Whitespace and lines
    ; beginning with a semicolon are silently ignored (as you probably guessed).
    ; Section headers (e.g. [Foo]) are also silently ignored, even though
    ; they might mean something in the future.
    ; Directives following the section heading [PATH=/www/mysite] only
    ; apply to PHP files in the /www/mysite directory. Directives
    ; following the section heading [HOST=www.example.com] only apply to
    ; PHP files served from www.example.com. Directives set in these
    ; special sections cannot be overridden by user-defined INI files or
    ; at runtime. Currently, [PATH=] and [HOST=] sections only work under
    ; CGI/FastCGI.
    ; http://php.net/ini.sections
    ; Directives are specified using the following syntax:
    ; directive = value
    ; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
    ; Directives are variables used to configure PHP or PHP extensions.
    ; There is no name validation. If PHP can't find an expected
    ; directive because it is not set or is mistyped, a default value will be used.
    ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
    ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
    ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a
    ; previously set variable or directive (e.g. ${foo})
    ; Expressions in the INI file are limited to bitwise operators and parentheses:
    ; | bitwise OR
    ; ^ bitwise XOR
    ; & bitwise AND
    ; ~ bitwise NOT
    ; ! boolean NOT
    ; Boolean flags can be turned on using the values 1, On, True or Yes.
    ; They can be turned off using the values 0, Off, False or No.
    ; An empty string can be denoted by simply not writing anything after the equal
    ; sign, or by using the None keyword:
    ; foo = ; sets foo to an empty string
    ; foo = None ; sets foo to an empty string
    ; foo = "None" ; sets foo to the string 'None'
    ; If you use constants in your value, and these constants belong to a
    ; dynamically loaded extension (either a PHP extension or a Zend extension),
    ; you may only use these constants *after* the line that loads the extension.
    ; About this file ;
    ; PHP comes packaged with two INI files. One that is recommended to be used
    ; in production environments and one that is recommended to be used in
    ; development environments.
    ; php.ini-production contains settings which hold security, performance and
    ; best practices at its core. But please be aware, these settings may break
    ; compatibility with older or less security conscience applications. We
    ; recommending using the production ini in production and testing environments.
    ; php.ini-development is very similar to its production variant, except it's
    ; much more verbose when it comes to errors. We recommending using the
    ; development version only in development environments as errors shown to
    ; application users can inadvertently leak otherwise secure information.
    ; Quick Reference ;
    ; The following are all the settings which are different in either the production
    ; or development versions of the INIs with respect to PHP's default behavior.
    ; Please see the actual settings later in the document for more details as to why
    ; we recommend these changes in PHP's behavior.
    ; display_errors
    ; Default Value: On
    ; Development Value: On
    ; Production Value: Off
    ; display_startup_errors
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: Off
    ; error_reporting
    ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
    ; Development Value: E_ALL
    ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
    ; html_errors
    ; Default Value: On
    ; Development Value: On
    ; Production value: On
    ; log_errors
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: On
    ; max_input_time
    ; Default Value: -1 (Unlimited)
    ; Development Value: 60 (60 seconds)
    ; Production Value: 60 (60 seconds)
    ; output_buffering
    ; Default Value: Off
    ; Development Value: 4096
    ; Production Value: 4096
    ; register_argc_argv
    ; Default Value: On
    ; Development Value: Off
    ; Production Value: Off
    ; request_order
    ; Default Value: None
    ; Development Value: "GP"
    ; Production Value: "GP"
    ; session.bug_compat_42
    ; Default Value: On
    ; Development Value: On
    ; Production Value: Off
    ; session.bug_compat_warn
    ; Default Value: On
    ; Development Value: On
    ; Production Value: Off
    ; session.gc_divisor
    ; Default Value: 100
    ; Development Value: 1000
    ; Production Value: 1000
    ; session.hash_bits_per_character
    ; Default Value: 4
    ; Development Value: 5
    ; Production Value: 5
    ; short_open_tag
    ; Default Value: On
    ; Development Value: Off
    ; Production Value: Off
    ; track_errors
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: Off
    ; url_rewriter.tags
    ; Default Value: "a=href,area=href,frame=src,form=,fieldset="
    ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
    ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
    ; variables_order
    ; Default Value: "EGPCS"
    ; Development Value: "GPCS"
    ; Production Value: "GPCS"
    ; php.ini Options ;
    ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
    ;user_ini.filename = ".user.ini"
    ; To disable this feature set this option to empty value
    ;user_ini.filename =
    ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes)
    ;user_ini.cache_ttl = 300
    ; Language Options ;
    ; Enable the PHP scripting language engine under Apache.
    ; http://php.net/engine
    engine = On
    ; This directive determines whether or not PHP will recognize code between
    ; <? and ?> tags as PHP source which should be processed as such. It's been
    ; recommended for several years that you not use the short tag "short cut" and
    ; instead to use the full <?php and ?> tag combination. With the wide spread use
    ; of XML and use of these tags by other languages, the server can become easily
    ; confused and end up parsing the wrong code in the wrong context. But because
    ; this short cut has been a feature for such a long time, it's currently still
    ; supported for backwards compatibility, but we recommend you don't use them.
    ; Default Value: On
    ; Development Value: Off
    ; Production Value: Off
    ; http://php.net/short-open-tag
    short_open_tag = On
    ; Allow ASP-style <% %> tags.
    ; http://php.net/asp-tags
    asp_tags = Off
    ; The number of significant digits displayed in floating point numbers.
    ; http://php.net/precision
    precision = 14
    ; Output buffering is a mechanism for controlling how much output data
    ; (excluding headers and cookies) PHP should keep internally before pushing that
    ; data to the client. If your application's output exceeds this setting, PHP
    ; will send that data in chunks of roughly the size you specify.
    ; Turning on this setting and managing its maximum buffer size can yield some
    ; interesting side-effects depending on your application and web server.
    ; You may be able to send headers and cookies after you've already sent output
    ; through print or echo. You also may see performance benefits if your server is
    ; emitting less packets due to buffered output versus PHP streaming the output
    ; as it gets it. On production servers, 4096 bytes is a good setting for performance
    ; reasons.
    ; Note: Output buffering can also be controlled via Output Buffering Control
    ; functions.
    ; Possible Values:
    ; On = Enabled and buffer is unlimited. (Use with caution)
    ; Off = Disabled
    ; Integer = Enables the buffer and sets its maximum size in bytes.
    ; Note: This directive is hardcoded to Off for the CLI SAPI
    ; Default Value: Off
    ; Development Value: 4096
    ; Production Value: 4096
    ; http://php.net/output-buffering
    output_buffering = 4096
    ; You can redirect all of the output of your scripts to a function. For
    ; example, if you set output_handler to "mb_output_handler", character
    ; encoding will be transparently converted to the specified encoding.
    ; Setting any output handler automatically turns on output buffering.
    ; Note: People who wrote portable scripts should not depend on this ini
    ; directive. Instead, explicitly set the output handler using ob_start().
    ; Using this ini directive may cause problems unless you know what script
    ; is doing.
    ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
    ; and you cannot use both "ob_gzhandler" and "zlib.output_compression".
    ; Note: output_handler must be empty if this is set 'On' !!!!
    ; Instead you must use zlib.output_handler.
    ; http://php.net/output-handler
    ;output_handler =
    ; Transparent output compression using the zlib library
    ; Valid values for this option are 'off', 'on', or a specific buffer size
    ; to be used for compression (default is 4KB)
    ; Note: Resulting chunk size may vary due to nature of compression. PHP
    ; outputs chunks that are few hundreds bytes each as a result of
    ; compression. If you prefer a larger chunk size for better
    ; performance, enable output_buffering in addition.
    ; Note: You need to use zlib.output_handler instead of the standard
    ; output_handler, or otherwise the output will be corrupted.
    ; http://php.net/zlib.output-compression
    zlib.output_compression = Off
    ; http://php.net/zlib.output-compression-level
    ;zlib.output_compression_level = -1
    ; You cannot specify additional output handlers if zlib.output_compression
    ; is activated here. This setting does the same as output_handler but in
    ; a different order.
    ; http://php.net/zlib.output-handler
    ;zlib.output_handler =
    ; Implicit flush tells PHP to tell the output layer to flush itself
    ; automatically after every output block. This is equivalent to calling the
    ; PHP function flush() after each and every call to print() or echo() and each
    ; and every HTML block. Turning this option on has serious performance
    ; implications and is generally recommended for debugging purposes only.
    ; http://php.net/implicit-flush
    ; Note: This directive is hardcoded to On for the CLI SAPI
    implicit_flush = Off
    ; The unserialize callback function will be called (with the undefined class'
    ; name as parameter), if the unserializer finds an undefined class
    ; which should be instantiated. A warning appears if the specified function is
    ; not defined, or if the function doesn't include/implement the missing class.
    ; So only set this entry, if you really want to implement such a
    ; callback-function.
    unserialize_callback_func =
    ; When floats & doubles are serialized store serialize_precision significant
    ; digits after the floating point. The default value ensures that when floats
    ; are decoded with unserialize, the data will remain the same.
    serialize_precision = 17
    ; open_basedir, if set, limits all file operations to the defined directory
    ; and below. This directive makes most sense if used in a per-directory
    ; or per-virtualhost web server configuration file. This directive is
    ; *NOT* affected by whether Safe Mode is turned On or Off.
    ; http://php.net/open-basedir
    open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/
    ; This directive allows you to disable certain functions for security reasons.
    ; It receives a comma-delimited list of function names. This directive is
    ; *NOT* affected by whether Safe Mode is turned On or Off.
    ; http://php.net/disable-functions
    disable_functions =
    ; This directive allows you to disable certain classes for security reasons.
    ; It receives a comma-delimited list of class names. This directive is
    ; *NOT* affected by whether Safe Mode is turned On or Off.
    ; http://php.net/disable-classes
    disable_classes =
    ; Colors for Syntax Highlighting mode. Anything that's acceptable in
    ; <span style="color: ???????"> would work.
    ; http://php.net/syntax-highlighting
    ;highlight.string = #DD0000
    ;highlight.comment = #FF9900
    ;highlight.keyword = #007700
    ;highlight.default = #0000BB
    ;highlight.html = #000000
    ; If enabled, the request will be allowed to complete even if the user aborts
    ; the request. Consider enabling it if executing long requests, which may end up
    ; being interrupted by the user or a browser timing out. PHP's default behavior
    ; is to disable this feature.
    ; http://php.net/ignore-user-abort
    ;ignore_user_abort = On
    ; Determines the size of the realpath cache to be used by PHP. This value should
    ; be increased on systems where PHP opens many files to reflect the quantity of
    ; the file operations performed.
    ; http://php.net/realpath-cache-size
    ;realpath_cache_size = 16k
    ; Duration of time, in seconds for which to cache realpath information for a given
    ; file or directory. For systems with rarely changing files, consider increasing this
    ; value.
    ; http://php.net/realpath-cache-ttl
    ;realpath_cache_ttl = 120
    ; Enables or disables the circular reference collector.
    ; http://php.net/zend.enable-gc
    zend.enable_gc = On
    ; If enabled, scripts may be written in encodings that are incompatible with
    ; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such
    ; encodings. To use this feature, mbstring extension must be enabled.
    ; Default: Off
    ;zend.multibyte = Off
    ; Allows to set the default encoding for the scripts. This value will be used
    ; unless "declare(encoding=...)" directive appears at the top of the script.
    ; Only affects if zend.multibyte is set.
    ; Default: ""
    ;zend.script_encoding =
    ; Miscellaneous ;
    ; Decides whether PHP may expose the fact that it is installed on the server
    ; (e.g. by adding its signature to the Web server header). It is no security
    ; threat in any way, but it makes it possible to determine whether you use PHP
    ; on your server or not.
    ; http://php.net/expose-php
    expose_php = On
    ; Resource Limits ;
    ; Maximum execution time of each script, in seconds
    ; http://php.net/max-execution-time
    ; Note: This directive is hardcoded to 0 for the CLI SAPI
    max_execution_time = 30
    ; Maximum amount of time each script may spend parsing request data. It's a good
    ; idea to limit this time on productions servers in order to eliminate unexpectedly
    ; long running scripts.
    ; Note: This directive is hardcoded to -1 for the CLI SAPI
    ; Default Value: -1 (Unlimited)
    ; Development Value: 60 (60 seconds)
    ; Production Value: 60 (60 seconds)
    ; http://php.net/max-input-time
    max_input_time = 60
    ; Maximum input variable nesting level
    ; http://php.net/max-input-nesting-level
    ;max_input_nesting_level = 64
    ; How many GET/POST/COOKIE input variables may be accepted
    ; max_input_vars = 1000
    ; Maximum amount of memory a script may consume (128MB)
    ; http://php.net/memory-limit
    memory_limit = 128M
    ; Error handling and logging ;
    ; This directive informs PHP of which errors, warnings and notices you would like
    ; it to take action for. The recommended way of setting values for this
    ; directive is through the use of the error level constants and bitwise
    ; operators. The error level constants are below here for convenience as well as
    ; some common settings and their meanings.
    ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
    ; those related to E_NOTICE and E_STRICT, which together cover best practices and
    ; recommended coding standards in PHP. For performance reasons, this is the
    ; recommend error reporting setting. Your production server shouldn't be wasting
    ; resources complaining about best practices and coding standards. That's what
    ; development servers and development settings are for.
    ; Note: The php.ini-development file has this setting as E_ALL. This
    ; means it pretty much reports everything which is exactly what you want during
    ; development and early testing.
    ; Error Level Constants:
    ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
    ; E_ERROR - fatal run-time errors
    ; E_RECOVERABLE_ERROR - almost fatal run-time errors
    ; E_WARNING - run-time warnings (non-fatal errors)
    ; E_PARSE - compile-time parse errors
    ; E_NOTICE - run-time notices (these are warnings which often result
    ; from a bug in your code, but it's possible that it was
    ; intentional (e.g., using an uninitialized variable and
    ; relying on the fact it's automatically initialized to an
    ; empty string)
    ; E_STRICT - run-time notices, enable to have PHP suggest changes
    ; to your code which will ensure the best interoperability
    ; and forward compatibility of your code
    ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
    ; initial startup
    ; E_COMPILE_ERROR - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR - user-generated error message
    ; E_USER_WARNING - user-generated warning message
    ; E_USER_NOTICE - user-generated notice message
    ; E_DEPRECATED - warn about code that will not work in future versions
    ; of PHP
    ; E_USER_DEPRECATED - user-generated deprecation warnings
    ; Common Values:
    ; E_ALL (Show all errors, warnings and notices including coding standards.)
    ; E_ALL & ~E_NOTICE (Show all errors, except for notices)
    ; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.)
    ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
    ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
    ; Development Value: E_ALL
    ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
    ; http://php.net/error-reporting
    error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
    ; This directive controls whether or not and where PHP will output errors,
    ; notices and warnings too. Error output is very useful during development, but
    ; it could be very dangerous in production environments. Depending on the code
    ; which is triggering the error, sensitive information could potentially leak
    ; out of your application such as database usernames and passwords or worse.
    ; It's recommended that errors be logged on production servers rather than
    ; having the errors sent to STDOUT.
    ; Possible Values:
    ; Off = Do not display any errors
    ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
    ; On or stdout = Display errors to STDOUT
    ; Default Value: On
    ; Development Value: On
    ; Production Value: Off
    ; http://php.net/display-errors
    display_errors = Off
    ; The display of errors which occur during PHP's startup sequence are handled
    ; separately from display_errors. PHP's default behavior is to suppress those
    ; errors from clients. Turning the display of startup errors on can be useful in
    ; debugging configuration problems. But, it's strongly recommended that you
    ; leave this setting off on production servers.
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: Off
    ; http://php.net/display-startup-errors
    display_startup_errors = Off
    ; Besides displaying errors, PHP can also log errors to locations such as a
    ; server-specific log, STDERR, or a location specified by the error_log
    ; directive found below. While errors should not be displayed on productions
    ; servers they should still be monitored and logging is a great way to do that.
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: On
    ; http://php.net/log-errors
    log_errors = On
    ; Set maximum length of log_errors. In error_log information about the source is
    ; added. The default is 1024 and 0 allows to not apply any maximum length at all.
    ; http://php.net/log-errors-max-len
    log_errors_max_len = 1024
    ; Do not log repeated messages. Repeated errors must occur in same file on same
    ; line unless ignore_repeated_source is set true.
    ; http://php.net/ignore-repeated-errors
    ignore_repeated_errors = Off
    ; Ignore source of message when ignoring repeated messages. When this setting
    ; is On you will not log errors with repeated messages from different files or
    ; source lines.
    ; http://php.net/ignore-repeated-source
    ignore_repeated_source = Off
    ; If this parameter is set to Off, then memory leaks will not be shown (on
    ; stdout or in the log). This has only effect in a debug compile, and if
    ; error reporting includes E_WARNING in the allowed list
    ; http://php.net/report-memleaks
    report_memleaks = On
    ; This setting is on by default.
    ;report_zend_debug = 0
    ; Store the last error/warning message in $php_errormsg (boolean). Setting this value
    ; to On can assist in debugging and is appropriate for development servers. It should
    ; however be disabled on production servers.
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: Off
    ; http://php.net/track-errors
    track_errors = Off
    ; Turn off normal error reporting and emit XML-RPC error XML
    ; http://php.net/xmlrpc-errors
    ;xmlrpc_errors = 0
    ; An XML-RPC faultCode
    ;xmlrpc_error_number = 0
    ; When PHP displays or logs an error, it has the capability of formatting the
    ; error message as HTML for easier reading. This directive controls whether
    ; the error message is formatted as HTML or not.
    ; Note: This directive is hardcoded to Off for the CLI SAPI
    ; Default Value: On
    ; Development Value: On
    ; Production value: On
    ; http://php.net/html-errors
    html_errors = On
    ; If html_errors is set to On *and* docref_root is not empty, then PHP
    ; produces clickable error messages that direct to a page describing the error
    ; or function causing the error in detail.
    ; You can download a copy of the PHP manual from http://php.net/docs
    ; and change docref_root to the base URL of your local copy including the
    ; leading '/'. You must also specify the file extension being used including
    ; the dot. PHP's default behavior is to leave these settings empty, in which
    ; case no links to documentation are generated.
    ; Note: Never use this feature for production boxes.
    ; http://php.net/docref-root
    ; Examples
    ;docref_root = "/phpmanual/"
    ; http://php.net/docref-ext
    ;docref_ext = .html
    ; String to output before an error message. PHP's default behavior is to leave
    ; this setting blank.
    ; http://php.net/error-prepend-string
    ; Example:
    ;error_prepend_string = "<span style='color: #ff0000'>"
    ; String to output after an error message. PHP's default behavior is to leave
    ; this setting blank.
    ; http://php.net/error-append-string
    ; Example:
    ;error_append_string = "</span>"
    ; Log errors to specified file. PHP's default behavior is to leave this value
    ; empty.
    ; http://php.net/error-log
    ; Example:
    ;error_log = php_errors.log
    ; Log errors to syslog (Event Log on NT, not valid in Windows 95).
    ;error_log = syslog
    ;windows.show_crt_warning
    ; Default value: 0
    ; Development value: 0
    ; Production value: 0
    ; Data Handling ;
    ; The separator used in PHP generated URLs to separate arguments.
    ; PHP's default setting is "&".
    ; http://php.net/arg-separator.output
    ; Example:
    ;arg_separator.output = "&amp;"
    ; List of separator(s) used by PHP to parse input URLs into variables.
    ; PHP's default setting is "&".
    ; NOTE: Every character in this directive is considered as separator!
    ; http://php.net/arg-separator.input
    ; Example:
    ;arg_separator.input = ";&"
    ; This directive determines which super global arrays are registered when PHP
    ; starts up. G,P,C,E & S are abbreviations for the following respective super
    ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty
    ; paid for the registration of these arrays and because ENV is not as commonly
    ; used as the others, ENV is not recommended on productions servers. You
    ; can still get access to the environment variables through getenv() should you
    ; need to.
    ; Default Value: "EGPCS"
    ; Development Value: "GPCS"
    ; Production Value: "GPCS";
    ; http://php.net/variables-order
    variables_order = "GPCS"
    ; This directive determines which super global data (G,P,C,E & S) should
    ; be registered into the super global array REQUEST. If so, it also determines
    ; the order in which that data is registered. The values for this directive are
    ; specified in the same manner as the variables_order directive, EXCEPT one.
    ; Leaving this value empty will cause PHP to use the value set in the
    ; variables_order directive. It does not mean it will leave the super globals
    ; array REQUEST empty.
    ; Default Value: None
    ; Development Value: "GP"
    ; Production Value: "GP"
    ; http://php.net/request-order
    request_order = "GP"
    ; This directive determines whether PHP registers $argv & $argc each time it
    ; runs. $argv contains an array of all the arguments passed to PHP when a script
    ; is invoked. $argc contains an integer representing the number of arguments
    ; that were passed when the script was invoked. These arrays are extremely
    ; useful when running scripts from the command line. When this directive is
    ; enabled, registering these variables consumes CPU cycles and memory each time
    ; a script is executed. For performance reasons, this feature should be disabled
    ; on production servers.
    ; Note: This directive is hardcoded to On for the CLI SAPI
    ; Default Value: On
    ; Development Value: Off
    ; Production Value: Off
    ; http://php.net/register-argc-argv
    register_argc_argv = Off
    ; When enabled, the ENV, REQUEST and SERVER variables are created when they're
    ; first used (Just In Time) instead of when the script starts. If these
    ; variables are not used within a script, having this directive on will result
    ; in a performance gain. The PHP directive register_argc_argv must be disabled
    ; for this directive to have any affect.
    ; http://php.net/auto-globals-jit
    auto_globals_jit = On
    ; Whether PHP will read the POST data.
    ; This option is enabled by default.
    ; Most likely, you won't want to disable this option globally. It causes $_POST
    ; and $_FILES to always be empty; the only way you will be able to read the
    ; POST data will be through the php://input stream wrapper. This can be useful
    ; to proxy requests or to process the POST data in a memory efficient fashion.
    ; http://php.net/enable-post-data-reading
    ;enable_post_data_reading = Off
    ; Maximum size of POST data that PHP will accept.
    ; Its value may be 0 to disable the limit. It is ignored if POST data reading
    ; is disabled through enable_post_data_reading.
    ; http://php.net/post-max-size
    post_max_size = 8M
    ; Automatically add files before PHP document.
    ; http://php.net/auto-prepend-file
    auto_prepend_file =
    ; Automatically add files after PHP document.
    ; http://php.net/auto-append-file
    auto_append_file =
    ; By default, PHP will output a character encoding using
    ; the Content-type: header. To disable sending of the charset, simply
    ; set it to be empty.
    ; PHP's built-in default is text/html
    ; http://php.net/default-mimetype
    default_mimetype = "text/html"
    ; PHP's default character set is set to empty.
    ; http://php.net/default-charset
    ;default_charset = "UTF-8"
    ; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
    ; to disable this feature. If post reading is disabled through
    ; enable_post_data_reading, $HTTP_RAW_POST_DATA is *NOT* populated.
    ; http://php.net/always-populate-raw-post-data
    ;always_populate_raw_post_data = On
    ; Paths and Directories ;
    ; UNIX: "/path1:/path2"
    include_path = ".:/usr/share/pear"
    ; Windows: "\path1;\path2"
    ;include_path = ".;c:\php\includes"
    ; PHP's default setting for include_path is ".;/path/to/php/pear"
    ; http://php.net/include-path
    ; The root of the PHP pages, used only if nonempty.
    ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
    ; if you are running php as a CGI under any web server (other than IIS)
    ; see documentation for security issues. The alternate is to use the
    ; cgi.force_redirect configuration below
    ; http://php.net/doc-root
    doc_root =
    ; The directory under which PHP opens the script using /~username used only
    ; if nonempty.
    ; http://php.net/user-dir
    user_dir =
    ; Directory in which the loadable extensions (modules) reside.
    ; http://php.net/extension-dir
    extension_dir = "/usr/lib/php/modules/"
    ; On windows:
    ; extension_dir = "ext"
    ; Whether or not to enable the dl() function. The dl() function does NOT work
    ; properly in multithreaded servers, such as IIS or Zeus, and is automatically
    ; disabled on them.
    ; http://php.net/enable-dl
    enable_dl = Off
    ; cgi.force_redirect is necessary to provide security running PHP as a CGI under
    ; most web servers. Left undefined, PHP turns this on by default. You can
    ; turn it off here AT YOUR OWN RISK
    ; **You CAN safely turn this off for IIS, in fact, you MUST.**
    ; http://php.net/cgi.force-redirect
    ;cgi.force_redirect = 1
    ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
    ; every request. PHP's default behavior is to disable this feature.
    ;cgi.nph = 1
    ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
    ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
    ; will look for to know it is OK to continue execution. Setting this variable MAY
    ; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
    ; http://php.net/cgi.redirect-status-env
    ;cgi.redirect_status_env =
    ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
    ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
    ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
    ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting
    ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
    ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
    ; http://php.net/cgi.fix-pathinfo
    ;cgi.fix_pathinfo=1
    ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
    ; security tokens of the calling client. This allows IIS to define the
    ; security context that the request runs under. mod_fastcgi under Apache
    ; does not currently support this feature (03/17/2002)
    ; Set to 1 if running under IIS. Default is zero.
    ; http://php.net/fastcgi.impersonate
    ;fastcgi.impersonate = 1
    ; Disable logging through FastCGI connection. PHP's default behavior is to enable
    ; this feature.
    ;fastcgi.logging = 0
    ; cgi.rfc2616_headers configuration option tells PHP what type of headers to
    ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
    ; is supported by Apache. When this option is set to 1 PHP will send
    ; RFC2616 compliant header.
    ; Default is zero.
    ; http://php.net/cgi.rfc2616-headers
    ;cgi.rfc2616_headers = 0
    ; File Uploads ;
    ; Whether to allow HTTP file uploads.
    ; http://php.net/file-uploads
    file_uploads = On
    ; Temporary directory for HTTP uploaded files (will use system default if not
    ; specified).
    ; http://php.net/upload-tmp-dir
    ;upload_tmp_dir =
    ; Maximum allowed size for uploaded files.
    ; http://php.net/upload-max-filesize
    upload_max_filesize = 2M
    ; Maximum number of files that can be uploaded via a single request
    max_file_uploads = 20
    ; Fopen wrappers ;
    ; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
    ; http://php.net/allow-url-fopen
    allow_url_fopen = On
    ; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
    ; http://php.net/allow-url-include
    allow_url_include = Off
    ; Define the anonymous ftp password (your email address). PHP's default setting
    ; for this is empty.
    ; http://php.net/from
    ;from="[email protected]"
    ; Define the User-Agent string. PHP's default setting for this is empty.
    ; http://php.net/user-agent
    ;user_agent="PHP"
    ; Default timeout for socket based streams (seconds)
    ; http://php.net/default-socket-timeout
    default_socket_timeout = 60
    ; If your scripts have to deal with files from Macintosh systems,
    ; or you are running on a Mac and need to deal with files from
    ; unix or win32 systems, setting this flag will cause PHP to
    ; automatically detect the EOL character in those files so that
    ; fgets() and file() will work regardless of the source of the file.
    ; http://php.net/auto-detect-line-endings
    ;auto_detect_line_endings = Off
    ; Dynamic Extensions ;
    ; If you wish to have an extension loaded automatically, use the following
    ; syntax:
    ; extension=modulename.extension
    ; For example, on Windows:
    ; extension=msql.dll
    ; ... or under UNIX:
    ; extension=msql.so
    ; ... or with a path:
    ; extension=/path/to/extension/msql.so
    ; If you only provide the name of the extension, PHP will look for it in its
    ; default extension directory.
    ;extension=bcmath.so
    ;extension=bz2.so
    ;extension=calendar.so
    extension=curl.so
    ;extension=dba.so
    ;extension=enchant.so
    ;extension=exif.so
    ;extension=ftp.so
    ;extension=gd.so
    extension=gettext.so
    ;extension=gmp.so
    ;extension=iconv.so
    ;extension=imap.so
    ;extension=intl.so
    ;extension=ldap.so
    ;extension=mcrypt.so
    ;extension=mssql.so
    ;extension=mysqli.so
    ;extension=mysql.so
    ;extension=odbc.so
    ;extension=openssl.so
    ;extension=pdo_mysql.so
    ;extension=pdo_odbc.so
    ;extension=pdo_pgsql.so
    ;extension=pdo_sqlite.so
    ;extension=pgsql.so
    ;extension=phar.so
    ;extension=posix.so
    ;extension=pspell.so
    ;extension=shmop.so
    ;extension=snmp.so
    ;extension=soap.so
    ;extension=sockets.so
    ;extension=sqlite3.so
    ;extension=sysvmsg.so
    ;extension=sysvsem.so
    ;extension=sysvshm.so
    ;extension=tidy.so
    ;extension=xmlrpc.so
    ;extension=xsl.so
    ;extension=zip.so
    ; Module Settings ;
    [CLI Server]
    ; Whether the CLI web server uses ANSI color coding in its terminal output.
    cli_server.color = On
    [Date]
    ; Defines the default timezone used by the date functions
    ; http://php.net/date.timezone
    ;date.timezone =
    ; http://php.net/date.default-latitude
    ;date.default_latitude = 31.7667
    ; http://php.net/date.default-longitude
    ;date.default_longitude = 35.2333
    ; http://php.net/date.sunrise-zenith
    ;date.sunrise_zenith = 90.583333
    ; http://php.net/date.sunset-zenith
    ;date.sunset_zenith = 90.583333
    [filter]
    ; http://php.net/filter.default
    ;filter.default = unsafe_raw
    ; http://php.net/filter.default-flags
    ;filter.default_flags =
    [iconv]
    ;iconv.input_encoding = ISO-8859-1
    ;iconv.internal_encoding = ISO-8859-1
    ;iconv.output_encoding = ISO-8859-1
    [intl]
    ;intl.default_locale =
    ; This directive allows you to produce PHP errors when some error
    ; happens within intl functions. The value is the level of the error produced.
    ; Default is 0, which does not produce any errors.
    ;intl.error_level = E_WARNING
    [sqlite]
    ; http://php.net/sqlite.assoc-case
    ;sqlite.assoc_case = 0
    [sqlite3]
    ;sqlite3.extension_dir =
    [Pcre]
    ;PCRE library backtracking limit.
    ; http://php.net/pcre.backtrack-limit
    ;pcre.backtrack_limit=100000
    ;PCRE library recursion limit.
    ;Please note that if you set this value to a high number you may consume all
    ;the available process stack and eventually crash PHP (due to reaching the
    ;stack size limit imposed by the Operating System).
    ; http://php.net/pcre.recursion-limit
    ;pcre.recursion_limit=100000
    [Pdo]
    ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
    ; http://php.net/pdo-odbc.connection-pooling
    ;pdo_odbc.connection_pooling=strict
    ;pdo_odbc.db2_instance_name
    [Pdo_mysql]
    ; If mysqlnd is used: Number of cache slots for the internal result set cache
    ; http://php.net/pdo_mysql.cache_size
    pdo_mysql.cache_size = 2000
    ; Default socket name for local MySQL connects. If empty, uses the built-in
    ; MySQL defaults.
    ; http://php.net/pdo_mysql.default-socket
    pdo_mysql.default_socket=
    [Phar]
    ; http://php.net/phar.readonly
    ;phar.readonly = On
    ; http://php.net/phar.require-hash
    ;phar.require_hash = On
    ;phar.cache_list =
    [mail function]
    ; For Win32 only.
    ; http://php.net/smtp
    SMTP = localhost
    ; http://php.net/smtp-port
    smtp_port = 25
    ; For Win32 only.
    ; http://php.net/sendmail-from
    ;sendmail_from = [email protected]
    ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
    ; http://php.net/sendmail-path
    ;sendmail_path =
    ; Force the addition of the specified parameters to be passed as extra parameters
    ; to the sendmail binary. These parameters will always replace the value of
    ; the 5th parameter to mail(), even in safe mode.
    ;mail.force_extra_parameters =
    ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
    mail.add_x_header = On
    ; The path to a log file that will log all mail() calls. Log entries include
    ; the full path of the script, line number, To address and headers.
    ;mail.log =
    ; Log mail to syslog (Event Log on NT, not valid in Windows 95).
    ;mail.log = syslog
    [SQL]
    ; http://php.net/sql.safe-mode
    sql.safe_mode = Off
    [ODBC]
    ; http://php.net/odbc.default-db
    ;odbc.default_db = Not yet implemented
    ; http://php.net/odbc.default-user
    ;odbc.default_user = Not yet implemented
    ; http://php.net/odbc.default-pw
    ;odbc.default_pw = Not yet implemented
    ; Controls the ODBC cursor model.
    ; Default: SQL_CURSOR_STATIC (default).
    ;odbc.default_cursortype
    ; Allow or prevent persistent links.
    ; http://php.net/odbc.allow-persistent
    odbc.allow_persistent = On
    ; Check that a connection is still valid before reuse.
    ; http://php.net/odbc.check-persistent
    odbc.check_persistent = On
    ; Maximum number of persistent links. -1 means no limit.
    ; http://php.net/odbc.max-persistent
    odbc.max_persistent = -1
    ; Maximum number of links (persistent + non-persistent). -1 means no limit.
    ; http://php.net/odbc.max-links
    odbc.max_links = -1
    ; Handling of LONG fields. Returns number of bytes to variables. 0 means
    ; passthru.
    ; http://php.net/odbc.defaultlrl
    odbc.defaultlrl = 4096
    ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char.
    ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
    ; of odbc.defaultlrl and odbc.defaultbinmode
    ; http://php.net/odbc.defaultbinmode
    odbc.defaultbinmode = 1
    ;birdstep.max_links = -1
    [Interbase]
    ; Allow or prevent persistent links.
    ibase.allow_persistent = 1
    ; Maximum number of persistent links. -1 means no limit.

    rune0077 wrote:
    Try this solution:
    https://wiki.archlinux.org/index.php/Ng … gh_FastCGI
    That isn't exactly my problem. The server responds with no body (so no blank html document)
    root@server ~# curl -vH "Host: ███████" localhost/test.php
    * Hostname was NOT found in DNS cache
    * Trying ::1...
    * connect to ::1 port 80 failed: Connection refused
    * Trying 127.0.0.1...
    * Connected to localhost (127.0.0.1) port 80 (#0)
    > GET /test.php HTTP/1.1
    > User-Agent: curl/7.36.0
    > Accept: */*
    > Host: ███████████
    >
    < HTTP/1.1 200 OK
    * Server nginx/1.6.0 is not blacklisted
    < Server: nginx/1.6.0
    < Date: Tue, 20 May 2014 20:11:02 GMT
    < Content-Type: text/html
    < Transfer-Encoding: chunked
    < Connection: keep-alive
    < Vary: Accept-Encoding
    <
    * Connection #0 to host localhost left intact
    When I do set SCRIPT_FILENAME to $document_root$fastcgi_script_name, it responds with "No input file specified."
    Spider.007 wrote:If there are no errors; tell us what your access-logs tell. Enable them in fpm and tell us if the request ends up there. Also; nginx can also log the upstream ip-address; if you add that to the access-logs you'll at least know if the problem is nginx, or fpm
    The nginx log message:
    127.0.0.1 - - [20/May/2014:14:15:50 -0600] "GET /test.php HTTP/1.1" 200 5 "-" "curl/7.36.0"
    I'll try to find a way to make php-fpm more verbose and I'll edit this post with the error when I do. At the moment it's only logging startups/shutdowns.
    Last edited by phillips1012 (2014-05-20 20:23:40)

  • Var Request Works Locally but not when Placed Online

    When I run this code on machine locally, it works perfect, however when I put it online it no longer works, can anybody help?
    Additionally the only the reason i placed the var request in a function was because I have another var request earlier in the code as was not sure how to run it without a duplicate entry error.
    goresult();
    function goresult() {
         var request:URLRequest=new URLRequest("http://www.whichpartyshouldivotefor.co.uk/wp-content/themes/test/leadingparty.php");
         request.method=URLRequestMethod.GET;
         var getresult:URLLoader = new URLLoader();
         getresult.dataFormat=URLLoaderDataFormat.VARIABLES;
         getresult.addEventListener(Event.COMPLETE, completeHandler);
         getresult.load(request);
    function completeHandler(evt:Event) {
         var conservativeresult=evt.target.data.conservative;
         var libdemresult=evt.target.data.libdem;
         var labourresult=evt.target.data.labour;
         trace (conservativeresult);
         vote.text = conservativeresult;

    My best guess is that you are coming across a security sandbox violation - AKA a crossdomain scripting error.
    This means that you need a crossdomain.xml on the root of your web-host that allows "whichpartyshouldivotefor.co.uk"

  • Session arrays in php

    hello -
    im still having a problem. this array will set but only shows one record from the array. when there are 3 demo data sets.
    thanks in advance for your help.
    i want to store the variable id in an array and access that array through session id hyper link on the same page. so that when that hyper link is clicked the session id is passed to the next page.
    here is the page code:
    <?php
    if (!isset($_SESSION)) {
      session_start();
    ?>
    <?php require_once('conn.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $Id = $_SESSION['Id']; //get users id to pass to record
    $Name = $_SESSION['name']; // display users name
    $Group = $_SESSION['Group']; // access control group for moderators, members, users
    $maxRows_List = 10;
    $pageNum_List = 0;
    if (isset($_GET['pageNum_List'])) {
      $pageNum_List = $_GET['pageNum_List'];
    $startRow_List = $pageNum_List * $maxRows_List;
    mysql_select_db($database_List, $List);
    $query_List = "SELECT * WHERE b.UId1='$UserId'";
    $query_limit_List = sprintf("%s LIMIT %d, %d", $query_List, $startRow_List, $maxRows_List);
    $List = mysql_query($query_limit_List, $List) or die(mysql_error());
    $row_List = mysql_fetch_assoc($List);
    $List_Array = array();
    while ($row = mysql_fetch_array($List))
    foreach($row['Id'] as $i=>$val)
    $List_Array = $val;
    //return $List_Array;
    $_SESSION['Id'] = $List_Array;
    $myList_Array = $_SESSION['Id'];
    if (isset($_GET['totalRows_List'])) {
      $totalRows_List = $_GET['totalRows_List'];
    } else {
      $all_List = mysql_query($query_List);
      $totalRows_List = mysql_num_rows($all_List);
    $totalPages_List = ceil($totalRows_List/$maxRows_List)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body  {
       font: 100% Verdana, Arial, Helvetica, sans-serif;
       background: #666666;
       margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
       padding: 0;
       text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
       color: #000000;
       background-color: #0E03D6;
    .thrColLiqHdr #container {
       width: 80%;  /* this will create a container 80% of the browser width */
       background: #FFFFFF;
       margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
       border: 1px solid #000000;
       text-align: left; /* this overrides the text-align: center on the body element. */
    .thrColLiqHdr #header {
       background: #FFFFFF;
       padding: 0 10px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
    .thrColLiqHdr #header h1 {
       margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
       padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
    /* Tips for sidebars:
    1. Since we are working in percentages, it's best not to use side padding on the sidebars. It will be added to the width for standards compliant browsers creating an unknown actual width.
    2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".thrColLiqHdr #sidebar1 p" rule.
    3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
    .thrColLiqHdr #sidebar1 {
       float: left; /* this element must precede in the source order any element you would like it be positioned next to */
       width: 22%; /* since this element is floated, a width must be given */
       background: #FFFFFF; /* the background color will be displayed for the length of the content in the column, but no further */
       padding: 15px 0; /* top and bottom padding create visual space within this div  */
    .thrColLiqHdr #sidebar2 {
       float: right; /* this element must precede in the source order any element you would like it be positioned next to */
       width: 23%; /* since this element is floated, a width must be given */
       background: #FFFFFF; /* the background color will be displayed for the length of the content in the column, but no further */
       padding: 15px 0; /* top and bottom padding create visual space within this div */
    .thrColLiqHdr #sidebar1 p, .thrColLiqHdr #sidebar1 h3, .thrColLiqHdr #sidebar2 p, .thrColLiqHdr #sidebar2 h3 {
       margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
       margin-right: 10px;
    /* Tips for mainContent:
    1. the space between the mainContent and sidebars is created with the left and right margins on the mainContent div.
    2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 300px or smaller (this includes images).
    3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
    .thrColLiqHdr #mainContent {
       margin: 0 24% 0 23.5%; /* the right and left margins on this div element creates the two outer columns on the sides of the page. No matter how much content the sidebar divs contain, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the sidebar spaces when the content in each sidebar ends. */
    .thrColLiqHdr #footer {
       padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
       background:#FFFFFF;
    .thrColLiqHdr #footer p {
       margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
       padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    /* Miscellaneous classes for reuse */
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
       float: right;
       margin-left: 8px;
    .fltlft { /* this class can be used to float an element left in your page The floated element must precede the element it should be next to on the page. */
       float: left;
       margin-right: 8px;
    .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain its child floats */
       clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    #apDiv1 {
       position:absolute;
       left:206px;
       top:83px;
       width:151px;
       height:34px;
       z-index:1;
    #apDiv2 {
       position:absolute;
       left:363px;
       top:84px;
       width:519px;
       height:37px;
       z-index:2;
    -->
    </style><!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .thrColLiqHdr #sidebar2, .thrColLiqHdr #sidebar1 { padding-top: 30px; }
    .thrColLiqHdr #mainContent { zoom: 1; padding-top: 15px; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]-->
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="thrColLiqHdr">
    <div id="container">
    <div id="header">
        <h1> </h1>
        <p> </p>
        <p> </p>
      <!-- end #header --></div>
      <div id="sidebar1">
      <h3>    </h3>
      <!-- show users ratings overall and per list -->
      <!-- end #sidebar1 --></div>
      <div id="sidebar2">
        <h3> </h3>
      <!-- display current viewers of user list in space and show count of number of views -->
      <!-- end #sidebar2 --></div>
      <div id="mainContent">
        <h1> </h1>
        <blockquote>
          <table border="1" cellpadding="1" cellspacing="1">
            <tr></tr>
            <caption align="center">
              List  Click to Edit
            </caption>
            <?php do { ?>
            <tr>
              <td><a href="list.php"><?php echo $myList_Array['Id']; ?></a></td> <-- this is the column that i want to have access the session id -->
              <td><?php echo $row_List['Subject'];?></td>
              <td><?php echo $row_List['Date']; ?></td>
            </tr>
            <?php } while($row_List = mysql_fetch_assoc($List));
          ?>
          </table>
          <h2> </h2>
          <p> </p>
        </blockquote>
    <!-- end #mainContent --></div>
       <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
      <div id="footer">
        <p>Footer</p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    </body>
    </html>
    <?php
    mysql_free_result($List);
    ?>

    thnks a lot!
    Michael Fesser wrote:
    > .oO(John Doe)
    >
    >
    >>wich is the <%Session.Timeout=n%> equivalent in
    PHP to increase the time
    >>specified in session.gc_maxlifetime?
    >
    >
    >
    http://www.php.net/ini_set
    >
    > Micha

  • Archlinux server status script in PHP

    Screenshot: http://www.barrucadu.co.uk/server/serverstatus.png
    This script shows system information (you'll have to tweak the commands using sensors for your system), and daemons. Also displays a notice if a daemon isn't running. I've divided its display of daemons into three parts - all, services, and utilities. I've called a daemon a service if the outside world benefits directly from it, and a utility if it's more of an internal thing. For example, samba would be a service and crond a utility.
    PHP script:
    <?php
    function daemon_running($daemon)
    $checkpath = '/var/run/daemons';
    return exec("ls -l {$checkpath} | grep {$daemon}");
    $name = 'Eihort';
    $statuses = array('Northbridge fan speed' => array('', 'sensors | grep fan1 | sed -e "s/fan1:\s*\([0-9]*\).*/\\1/"', ' RPM'),
    'CPU temperature' => array('', 'sensors | grep temp3 | sed -e "s/temp3:\s*+\([0-9]*\).*/\\1/"', '°C'),
    'HDD temperature' => array('', 'sudo hddtemp -n /dev/sda', '°C'),
    'Memory usage' => array('', 'free -m | grep "buffers/cache" | sed -e "s/-\/+ buffers\/cache:\s*\([0-9]*\)\s*\([0-9]*\).*/\\1 \/ \\2/"', ' MB'),
    'Load averages' => array('', 'uptime | sed "s/.*load average: \(.*\)/\\1/"', ''),
    'Uptime' => array('', 'uptime | sed "s/.*up\s*\([0-9\:]*\).*/\\1/"', ''),
    'Package updates' => array('', '/usr/local/bin/updates', ''),
    'Logged in users' => array('', '/usr/local/bin/userson', ''));
    $services = array('bitlbee' => 'Instant messaging gateway.',
    'httpd' => 'The Apache web server.',
    'mysqld' => 'MySQL Database server.',
    'named' => 'BIND9 DNS server.',
    'openntpd' => 'Network time server.',
    'rtorrent' => 'Torrent client,',
    'samba' => 'File-sharing system.',
    'sshd' => 'Secure Shell',
    'vsftpd' => 'Very Secure FTP Daemon.');
    $utilities = array('ivman' => 'Volume manager.',
    'sensors' => 'Hardware monitor.',
    'net-profiles' => 'Network manager.',
    'crond' => 'Task scheduler.',
    'hal' => 'Hardware Abstraction Layer.',
    'dbus' => 'IPC Bus.',
    'syslog-ng' => 'System monitor.',
    'uptimed' => 'Uptime recorder.');
    $output = array('status' => array(),
    'services' => array(),
    'utilities' => array());
    foreach($statuses as $status => $details)
    $output['status'][] = array($status, $details[0] . shell_exec($details[1]) . $details[2]);
    foreach($services as $service => $description)
    $output['services'][] = array($service, daemon_running($service) ? "On" : "Off");
    foreach($utilities as $utility => $description)
    $output['utilities'][] = array($utility, daemon_running($utility) ? "On" : "Off");
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
    <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf8"/>
    <meta name="author" content="Michael Walker"/>
    <meta name="robots" content="FOLLOW,INDEX"/>
    <title><?php echo $name; ?> Status</title>
    <link rel="stylesheet" href="style.css" type="text/css" />
    </head>
    <body>
    <div id="header">
    <h1><?php echo $name; ?></h1>
    <table>
    <?php
    $half = count($output['status']) / 2;
    for($i = 0; $i < count($output['status']); $i ++)
    if($i == $half) echo '</table><table>';
    $j = ($i < $half) ? $i + $half : $i - $half;
    echo '<tr>';
    echo "<td class=\"head\">{$output['status'][$j][0]}</td>";
    echo "<td>{$output['status'][$j][1]}</td>";
    echo '</tr>';
    ?>
    </table>
    </div>
    <ul id="tabs">
    <li><a href="/">All</a></li>
    <li><a href="/?type=services">Services</a></li>
    <li><a href="/?type=utilities">Utilities</a></li>
    </ul>
    <div id="content">
    <table>
    <?php
    $pool = array_merge($output['services'], $output['utilities']);
    if(isset($_GET['type']) && isset($output[$_GET['type']])) {
    $pool = $output[$_GET['type']];
    $odd = True;
    foreach($pool as $info)
    $summary = (isset($services[$info[0]])) ? $services[$info[0]] : $utilities[$info[0]];
    echo ($odd) ?'<tr class="odd">' : '<tr>';
    echo "<td class=\"head\">{$info[0]}<br/><span class=\"summary\">{$summary}</span></td>";
    echo ($info[1] == "On") ? '<td class="good">Up</td>' : '<td class="bad">Down</td>';
    echo '</tr>';
    $odd = !$odd;
    ?>
    </table>
    </div>
    </body>
    </html>
    This is configured for my server, but I'm sure you can figure out what you need to change.
    The CSS file:
    body
    background-color:#E2E5B4;
    font-family:Liberation Sans, DejaVu Sans, Verdana, Arial, sans-serif;
    font-size:13px;
    color:#474750;
    padding:0px 0px 10px 0px;
    margin:0px;
    div#header
    border-bottom:3px solid #C8A654;
    padding:16px;
    background-color:#313D40;
    div#header h1
    display:inline;
    font-size:7em;
    color:#74B331 ;
    div#header table
    position:relative;
    right:64px;
    margin:0px 16px 0px 16px;
    float:right;
    color:#93FF20;
    border:1px solid #;
    div#header table td
    padding:3px;
    div#header table td.head
    width:200px;
    font-weight:bold;
    ul#tabs
    list-style:none;
    position:relative;
    top:-3px;
    padding:0px;
    margin:0px;
    ul#tabs li {
    float:left;
    margin:0px 16px 0px 16px;
    width:100px;
    border-left:3px solid #C8A654;
    border-right:3px solid #C8A654;
    border-bottom:3px solid #C8A654;
    background-color:#313D40;
    text-align:center;
    ul#tabs li a
    color:#FF3709;
    font-weight:bold;
    font-size:10px;
    text-decoration:none;
    ul#tabs li a:hover
    font-weight:normal;
    div#content
    clear:both;
    padding:24px 128px 0px 128px;
    margin:0px;
    div#content table
    border-spacing:0px;
    border:3px solid #C8A654;
    color:#FDFED2;
    width:100%;
    div#content td.head
    font-weight:bold;
    width:95%;
    div#content tr td
    background-color:#3E4147;
    padding:10px;
    div#content tr.odd td
    background-color:#27333A;
    div#content span.summary
    font-weight:normal;
    font-size:10px;
    div#content td.good
    color:#A4D933;
    div#content td.bad
    color:#FF3709;
    Note: in the services and utilities array it's not the name of the daemon, but the name of the file it creates in /var/run/daemons/.
    Note 2: The /usr/local/bin/updates is just a script to grab the number of updates from pacman.
    Last edited by Barrucadu (2009-07-26 14:54:28)

    I like it!
    I'll give this a crack when I get home tonight.

  • I have created a working php contact file but I do not know how get it onto my website properly

    Hi,
    I don't know if this a big job or too complicated for me, but I thought I would ask anyway.
    I have a contact page www.bristolequestrianservices.co.uk/contactus.html which has never ever actually worked.  I have now spend ages and ages doing a new contact page, contact.php, and this one now works perfectly.
    My problem is now I don't know how to put it all together if that makes sense.  My contactus.html has all my other things ie, header, topnav and everything like that but the contact php is just a contact page.
    Hope all of this makes sense and don't know if anyone has the time to help me with this as I think it's most probably too much!  I'm so close but so far!
    Thanks in anticipation

    Below is the entire contact.php page. Just reinstate your email address where the XXXXXXXXXX are (I don't post email address in the forum because of spam issues.)
    I have not had chance to entirely style the form but it's near. The form css is in the page. You can move it out and into its own stylesheet. You will now have to change your contact page links in your other pages from contact.html to contact.php
    Its a lot of <divs> for a simple form. This all could have been produced with 50% less code.
    <?php
    // Set email variables
    $email_to = '[email protected]';
    $email_subject = 'Form submission';
    // Set required fields
    $required_fields = array('fullname','email','comment');
    // set error messages
    $error_messages = array(
    'fullname' => 'Please enter a Name to proceed.',
    'email' => 'Please enter a valid Email Address to continue.',
    'comment' => 'Please enter your Message to continue.'
    // Set form status
    $form_complete = FALSE;
    // configure validation array
    $validation = array();
    // check form submittal
    if(!empty($_POST)) {
    // Sanitise POST array
    foreach($_POST as $key => $value) $_POST[$key] = remove_email_injection(trim($value));
    // Loop into required fields and make sure they match our needs
    foreach($required_fields as $field) {
    // the field has been submitted?
    if(!array_key_exists($field, $_POST)) array_push($validation, $field);
    // check there is information in the field?
    if($_POST[$field] == '') array_push($validation, $field);
    // validate the email address supplied
    if($field == 'email') if(!validate_email_address($_POST[$field])) array_push($validation, $field);
    // basic validation result
    if(count($validation) == 0) {
    // Prepare our content string
    $email_content = 'New Website Comment: ' . "\n\n";
    // simple email content
    foreach($_POST as $key => $value) {
    if($key != 'submit') $email_content .= $key . ': ' . $value . "\n";
    // if validation passed ok then send the email
    mail($email_to, $email_subject, $email_content);
    // Update form switch
    $form_complete = TRUE;
    function validate_email_address($email = FALSE) {
    return (preg_match('/^[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i', $email))? TRUE : FALSE;
    function remove_email_injection($field = FALSE) {
    return (str_ireplace(array("\r", "\n", "%0a", "%0d", "Content-Type:", "bcc:","to:","cc:"), '', $field));
    ?>
    <!DOCTYPE HTML>
    <html>
    <head>
    <script type="text/javascript" src="http://www.bristolequestrianservices.co.uk/js/jquery.js"></script>
    <script type="text/javascript" src="http://www.bristolequestrianservices.co.uk/js/timothy.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
    <script type="text/javascript"  src="http://www.bristolequestrianservices.co.uk/contact/validation/validation.js"></script>
    <script type="text/javascript">
    var nameError = '<?php echo $error_messages['fullname']; ?>';
    var emailError = '<?php echo $error_messages['email']; ?>';
    var commentError = '<?php echo $error_messages['comment']; ?>';
    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    </script>
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    ga('create', 'UA-47829305-1', 'bristolequestrianservices.co.uk');
    ga('send', 'pageview');
    </script>
    <link href="http://www.bristolequestrianservices.co.uk/css/styles.css" rel="stylesheet" type="text/css" media="screen">
    <link href="http://www.bristolequestrianservices.co.uk/css/print.css" rel="stylesheet" type="text/css" media="print">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Type" content="cache" />
    <meta name="robots" content="INDEX,FOLLOW" />
    <meta name="keywords" content="mobile field shelter,mobile stables,good quality,prices,cheap,shelters, shelter, stables, stables, mobile filed shelters, mobile stable, " />
    <meta name="description" content="Quality mobile stables and field shelters, we will not be beaten on price for this quality" />
    <title>Mobile Field Shelters | Mobile Stables | Bristol Equestrian Services</title>
    <!-- Google Analytics Code Goes Below Here -->
    <meta name="google-site-verification" content="zUg_yn4KVoI6Xy8LLvw0PjtwgXPmlQVNKb3tY001yp4" />
    <!-- End Google Analytics Code -->
    <style>
    #formWrap {
        width:648px;
        margin-top: 0px;
        margin-left: 0px;
        background:#fff;
        border:1px solid #F1F1F1;
        -moz-border-radius:20px;
        -moz-box-shadow:2px 2px 5px #999;
        -webkit-border-radius:20px;
        -webkit-box-shadow:2px 2px 5px #999;
        padding: 0;
    #formWrap #form {
        border-top:1px solid #EEE;
        width:648px;
    #formWrap #form .row {
        border-bottom:1px dotted #EEE;
        display:block;
        line-height:38px;
        overflow:auto;
        padding: 10px 0px;
        width:100%;  
    #form .row .label {
        font-size:16px;
        font-weight:bold;
        font-family:Arial, Helvetica, sans-serif;
        width:180px;
        padding-right:10px;
        margin-right:10px;
    #form .row .input {
        float:left;
        margin-right:10px;
        width:auto;
    /* width:auto;*/
    width: 455px;
    #form .row .input2 {
        float:left;
        margin-right:10px;
        width:auto;
    /* width:auto;*/
    width:455px;
    .detail {
        width:455px;
        font-family:Arial, Helvetica, sans-serif;
        font-size: 14px;
        padding: 10px 8px;
        margin:0px;
        display:block;
        border-radius:5px 5px 5px 5px;
        background:#e9e9e9;
        border:1px solid #ccc;
    .mess {
        width:455px;
        max-width:450px;
        height:280px;
        overflow:auto;
        font-family:Arial, Helvetica, sans-serif;
        font-size:14px;
        padding:7px 8px;
        line-height:1em;
        margin:0px;
        display:block;
        border-radius:5px 5px 5px 5px;
        background:#e9e9e9;
        border:1px solid #ccc;
    .detail:focus {
        background-color:#fff;
        border:1px solid #999;
        outline:none;
    .detail:mess {
        background-color:#fff;
        border:1px solid #999;
        outline:none;
    #form .row .context {
        color:#999;
        font-size:11px;
        font-style:italic;
        line-height:14px;
        font-family:Arial, Helvetica, sans-serif;
        width:200px;
        float:left;
    #form #submit {
        font-family:Arial, Helvetica, sans-serif;
        margin: 25px 0 0 0;
        color:#000;
        font-size:16px;
        text-shadow:1px 1px 1px #999;
        padding:10px;
    span.error{
        color:#000;  
        display:block;
        font-family:Arial, Helvetica, sans-serif;
        font-size:12px;
        background-image:url(http://www.bristolequestrianservices.co.uk/contact/images/x.png);
        background-repeat:no-repeat;
        background-position: 10px center;
        padding-left: 10%;
        width: 90%;
    #formWrap h2 {
        font-family:Arial, Helvetica, sans-serif;
        font-size: 26px;
        font-weight: normal;
        color:#255e67;
        margin: 25px 0 0 20px;
    </style>
    </head>
    <body>
    <div id="outer">
    <div id="wrapper">
    <div id="header">
    <div id="companyLogo">
    <img src="http://www.bristolequestrianservices.co.uk/images/logo4.jpg" alt="americanbarn" width="182" height="110" /><img src="http://www.bristolequestrianservices.co.uk/images/banner1.jpg" alt="horsebanner" width="302" height="84" />
    </div> <!-- end logo-->
    <div id="contact">
    <span class="phone">Tel: 07800538607 | 07920408396<br></span>
    <span class="email">Email: [email protected]</span>
    </div>
    </div>
    <!-- end header -->    
    <div id="topnav">
    <ul>
    <li><a href="index.html">Home</a></li>
    <li><a href="stables.html">Stables</a></li>
    <li><a href="shelters.html">Shelters</a></li>
    <li><a href="gallery.html">Gallery</a></li>
    <li><a href="pricelist.html">Price List</a></li>
    <li><a href="usefullinks.html">Useful Links</a></li>
    <li><a href="contactus.php">Contact Us</a></li>
    </ul>      
    </div>
    <img src="http://www.bristolequestrianservices.co.uk/images/photos/lisa1.jpg">
    <img src="http://www.bristolequestrianservices.co.uk/images/photos/me.jpg">       
    <div id="content">
    <h1>Contact Us</h1>
    <p><span class="big-blue">DUE TO A TECHNICAL ISSUE WITH THE CONTACT FORM PLEASE CONTACT US ON [email protected]</span><p>When contacting us please give us as much details as you can. If you want a quote for delivery please submit your post code. We will endeavour to respond to all emails within a few hours.</p>
    <p>Office opening hours: Monday to Friday 7.30am-6pm</p>
    <p>Saturday 8am-5pm</p>
    <p>Sunday CLOSED</p>
    <div id="formWrap">
    <h2>We Appreciate Your Feedback</h2>
    <div id="form">
    <?php if($form_complete === FALSE): ?>
    <form action="contact.php" method="post" id="comments_form">
    <div class="row">
    <div class="label">Your Name</div> <!--end .label -->
    <div class="input">
    <input type="text" id="fullname" class="detail" name="fullname" value="<?php echo isset($_POST['fullname'])? $_POST['fullname'] : ''; ?>" /><?php if(in_array('fullname', $validation)): ?><span class="error"><?php echo $error_messages['fullname']; ?></span><?php endif; ?>
    </div><!-- end .input -->
    </div><!-- end .row -->
    <div class="row">
    <div class="label">Your Email Address</div> <!--end .label -->
    <div class="input">
    <input type="text" id="email" class="detail" name="email" value="<?php echo isset($_POST['email'])? $_POST['email'] : ''; ?>" /><?php if(in_array('email', $validation)): ?><span class="error"><?php echo $error_messages['email']; ?></span><?php endif; ?>
    </div><!-- end .input -->
    </div><!-- end .row -->
    <div class="row">
    <div class="label">Your Message</div> <!--end .label -->
    <div class="input2">
    <textarea id="comment" name="comment"  class="mess"><?php echo isset($_POST['comment'])? $_POST['comment'] : ''; ?>
    </textarea><?php if(in_array('comment', $validation)): ?><span class="error"><?php echo $error_messages['comment']; ?></span><?php endif; ?>
    </div><!-- end .input -->
    </div><!-- end .row -->
    <input type="submit" id="submit" name="submit" value="Send Message" />
    </form>
    <?php else: ?>
    <p style="font-size:35px; font-family:Arial, Helvetica, sans-serif; color:#255e67; margin-left:25px;">Thank you for your Message!</p>
    <script type="text/javascript">
    setTimeout('ourRedirect()', 5000)
    function ourRedirect () {
    location.href='index.html'
    </script>
    <?php endif; ?></div><!-- end #form-->
    </div><!-- end formWrap div -->
    </div>
    <div id="rightside">
    <h2>Latest News</h2>
    <p><a href="latestdesign.html">Our Latest Design</a></p>
    <p><a href="newpictures.html">New Pictures Added</a></p>
    <p><a href="testimonials.html">New Testimonials</a></p><br>
    <h4>View Gallery</h4><br>
    <img src="http://www.bristolequestrianservices.co.uk/images/buttons/viewgallery.jpg" /><br>
    <br><h4>Follow Us</h4><br>
    <div id="social-media-icons2">
    <ul>
    <li><a href="https://www.facebook.com/groups/150449201771804/"><img src="http://www.bristolequestrianservices.co.uk/images/icons/facebook.jpg" /></a></li>
    <li><a href="£"><img src="http://www.bristolequestrianservices.co.uk/images/icons/rss.jpg" /></a></li>
    <li><a href="http://www.twitter.com"><img src="http://www.bristolequestrianservices.co.uk/images/icons/twitter.jpg" /></a></li>
    <li><img src="http://www.bristolequestrianservices.co.uk/images/icons/youtube.jpg" /></li>
    </ul>
    </div>
    </div>
    <div id="rightside-bottom">
    <div id="footer">
    <p class="footer-text">Copyright 2014 Bristol Equestrian Services</p>
    </div>
    </div>
    </body>
    </html>

  • Sending variable value from php to flash to load an xml file

    I would like to load an XML file from the location locally or on the server being unaware of the name of the file. I am using PHP for sending the filename to Flash.
    The below is the PHP code:
    <?php
    filesInDir('C:\Documents and Settings\457305\My Documents\shrikant\Flash Tutorials\webassist');
    function filesInDir($tdir)
            $dirs = scandir($tdir);
            foreach($dirs as $file)
                    if (($file == '.')||($file == '..'))
                    elseif (is_dir($tdir.'/'.$file))
                            filesInDir($tdir.'/'.$file);
                    else
                            echo "fileName=$file";
    ?>
    And below is the loading Actionscript code:
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.net.URLVariables;
    stop();
    // Define the PHP file to be loaded
    var phpFile:String = "http://localhost/webassist/test.php";
    var cons_xml:XML;
    var xmlLoader:URLLoader = new URLLoader();
    // Specify dataFormat property of the URLLoader to be "VARIABLES"
    // This ensures variables loaded into Flash with same variable names
    xmlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    xmlLoader.load(new URLRequest(phpFile));
    xmlLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(evt:Event):void
              trace(evt.target.data.fileName);
              //cons_xml = new XML(evt.target.data.fileName);
              //gotoAndPlay(2);
    When I trace the evt.target.data it displays "fileName=mainOpenEndedXML%2Exml" and when I trace evt.target.data.fileName the fileName is properly displayed as "mainOpenEndedXML.xml".
    But in the next two lines where the loading occurs it does not load the file i.e the swf file from xml doesn't play.
    I have been searching the Internet for answers but not able to find any solutions.
    The loading works properly if i directly insert the xml file in the code and the swf's in the XML file play propertly. The below is the code for the same:
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.net.URLVariables;
    stop();
    var cons_xml:XML;
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest("mainOpenEndedXML.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(evt:Event):void
              cons_xml = new XML(evt.target.data);
              gotoAndPlay(2);
    Any help on this would be greatly appreciated

    Yes. you already said that, but I guess you don't understand what I said.  You are loading the PHP fle to get the filename, but nowhere are you taking that filename and loading the file that was named. 
    You need to do two loading operations.  The first one to get the filename, and the second to load the file with that name.  Maybe if you name the PHP file loader phpLoader instead of xmlLoader it will start to make more sense to you.  Something like the following...
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.net.URLVariables;
    stop();
    // Define the PHP file to be loaded
    var phpFile:String = "http://localhost/webassist/test.php";
    var phpLoader:URLLoader = new URLLoader();
    // Specify dataFormat property of the URLLoader to be "VARIABLES"
    // This ensures variables loaded into Flash with same variable names
    phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    phpLoader.load(new URLRequest(phpFile));
    phpLoader.addEventListener(Event.COMPLETE, processPHP);
    function processPHP(evt:Event):void
             var xmlLoader:URLLoader = new URLLoader();
             xmlLoader.load(new URLRequest(String(evt.target.data.fileName)));
             xmlLoader.addEventListener(Event.COMPLETE, processXML);
    var cons_xml:XML;
    function processXML(evt:Event):void
              cons_xml = new XML(evt.target.data);
              gotoAndPlay(2);

  • PHP query to XML

    I would really like to use the querytoXML code for a current
    project. My server (co-location) has a php.ini which serves
    text/html and I can't change that setting. I have managed to use a
    .htaccess file to change the mimetype:
    <Files "*_xml.php">
    ForceType text/xml
    </Files>
    BUT!!!!! The php code no longer executes and all I get are
    XML errors in all browsers. Has anyone had any success in a similar
    situation and can they please share the method they used. The code
    on this site works just fine in Firefox and Chrome/Safari (of
    course...) but will not work in IE7.
    TIA
    Tony

    It does that if it is on the first line of the php file...
    The code of the page using the xml dataset:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
    http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type"
    content="application/xhtml+xml; charset=UTF-8" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <?php
    // variables
    if (!isset($rub)) $rub="1";
    if (!isset($cat)) $cat="1";
    if (!isset($lg)) $lg="en";
    if (!isset($numprod)) $numprod="1";
    // includes
    include("styles.php");
    include("fonctions.php");
    include("connexion.php");
    include("jscripts.php");
    ?>
    <script language="javascript">
    var photosDs = new
    Spry.Data.XMLDataSet("photo_prod_xml.php?numprod=1",
    "photos/photo");
    </script>
    Tony

  • Passing variable from php into flash, help please

    Here are what I'm having:
    <?PHP
    $testVal = "This is a test";
    $test = urlencode($testVal);
    $out = "test=". $testVal;
    echo $out;
    ?>
    // and this is my flash file
    function getData() {
    // Prepare request
    var urlReq:URLRequest=new URLRequest("http://localhost/test.php");
    urlReq.method=URLRequestMethod.GET;
    var loader:URLLoader = new URLLoader();
    loader.dataFormat=URLLoaderDataFormat.VARIABLES;
    loader.addEventListener(Event.COMPLETE, completeHandler);
    loader.load(urlReq);
    function completeHandler(evt:Event) {
    var vars:URLVariables = URLVariables(evt.target.data);
    trace(" TEST = ", vars.test);
    trace(" TEST = ", unescape(vars.toString()));
    // and below is the ouput
    TEST = undefined
    TEST = test=This is a test
    I've tried with several different ways to get ONLY the value of the variable - that means I only want to have "This is a test" returned, but I either got "undefined" or the whole thing "test=This is a test", instead.
    I'm new to Flash and PHP. Please help.
    Thanks

    There's no need to write any fake variables out, Flash does not need that. OK, here's a simple PHP script like yours - I called it test.php
    <?PHP
         $testVal = "This is a test";
         $out = "test=". $testVal;
         echo $out;
    ?>
    And the AS to call it:
    var myLoader:URLLoader = new URLLoader();
    myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    myLoader.load(new URLRequest("http://www.mydomain.com/test.php"));
    myLoader.addEventListener(Event.COMPLETE, dataLoaded, false, 0, true);
    function dataLoaded(e:Event){  
        trace( e.target.data.test);
    You will see 'This is a test' traced to the output window.
    HTH

  • Php variable and xml processing

    Hello there,
    I have a problem that is driving me crazy! I have a php file
    which creates an xml string from a sql query. The problem is that I
    need to use a variable from an swf file to create the query. All
    this should happen when i click a button on the swf page. The xml
    file is created no problem but the variable is not used. i am well
    able to use these POST variables in other php files. As you can see
    the php file is called twice in the action script. Is this the
    problem. The line: xmlData.load("get_max_sess.php"); is fine. I
    stuck the other on one in - loadVariablesNum ("get_max_sess.php",
    0, "POST"); after the fact and this doesn't work. is there a
    confilct in calling the same file twice? Is the sendAndLoad
    function an option? Also included below is my php file.
    Thanks so much. I really hope you can help me!
    ****************************************************ACTION
    SCRIPT**********************************
    call_btn.onRelease=function(){
    function processXMLData(success)
    {loadVariablesNum ("get_max_sess.php", 0, "POST");
    if (success)
    var rootNode=this.firstChild;
    var contentNode=findNode(rootNode, "guit_vol");
    guitVol=getValue(contentNode);
    var authorNode=findNode(rootNode, "guit_pan");
    guitPan=getValue(authorNode);
    var contentNode=findNode(rootNode, "guit_vis");
    visGuit=getValue(contentNode);
    _root.guitVis.gotoAndStop(visGuit);
    //assign xml info to musician objects
    _root.guitObj.drag._y=guitVol;
    _root.guitObj.drag._x=guitPan*2;
    else
    content="Today's news is not found";
    function getValue(node)
    if (node && node.firstChild)
    return node.firstChild.nodeValue;
    return "";
    function findNode(node, nodeName)
    if (node.nodeName==nodeName)
    return node;
    for (var i=0; node.childNodes &&
    i<node.childNodes.length; i++)
    var foundNode=findNode(node.childNodes
    , nodeName);
    if (foundNode!=null)
    return foundNode;
    return null;
    var xmlData=new XML();
    xmlData.ignoreWhite=true;
    xmlData.onLoad=processXMLData;//when xml data loads the
    function at the top executes
    xmlData.load("get_max_sess.php"); //loads the xml data from
    this location
    stop();
    ****************************************************PHP
    FILE**********************************
    <?php
    $user_id=$_POST['user_id'];
    // query database for records
    $connection = mysql_connect('localhost', 'm27849_martin',
    'Geraldine1') or die ("Unable
    to connect!");
    mysql_select_db('m27849_liveroom') or die ("Unable to select
    database!");
    $query = "
    SELECT a.guit_sess_id, a.guit_vol, a.guit_pan, a.guit_vis,
    b.bass_sess_id, b.bass_vol, b.bass_pan, b.bass_vis, c.drum_sess_id,
    c.drum_vol, c.drum_pan, c.drum_vis
    FROM guit_info a, bass_info b, drum_info c, users_sessions d
    WHERE d.session_id =(SELECT max(a.session_id) FROM
    users_sessions a WHERE a.user_id = '$user_id')
    AND a.guit_sess_id = d.session_id
    AND b.bass_sess_id =a.guit_sess_id
    AND c.drum_sess_id = b.bass_sess_id
    //(SELECT userid from auth WHERE username ='martin')
    //here a variable could be inserted to call the relevant row
    (session)
    $result = mysql_query($query) or die ("Error in query:
    $query. " .
    mysql_error());
    $doc = new DomDocument('1.0');
    //The first element we create in the XML document is known as
    the root element. Each XML document must have 1, and only 1, root
    element. In this example I have called it 'root', but you can use
    whatever name you like (such as the name of the PHP script which is
    executing). Note that you have to create the element and insert it
    into the document with two functions.
    // create root node
    while($row = mysql_fetch_assoc($result)) {
    $user = $doc->createElement('session');
    $user = $doc->appendChild($user);
    foreach ($row as $fieldname => $fieldvalue) {
    //Note that here I create a new element for the field and
    then insert it as a child to the current database row, as
    identified in $occ.
    $child = $doc->createElement($fieldname);
    $child = $user->appendChild($child);
    //Now I must add the field value as a text node, then insert
    it as a child element to the current field node, as identified in
    $child.
    $value = $doc->createTextNode($fieldvalue);
    $value = $child->appendChild($value);
    //These loops do not terminate until they have processed
    every column of every row which has been retrieved from the
    database.
    } // foreach
    } // while
    echo $doc->saveXML();
    //echo $doc->saveXML($child);
    mysql_close($connection);
    //from:
    http://www.tonymarston.net/php-mysql/dom.html
    ?>

    Hi there,
    I cracked it after a lot of to-ing and fro-ing! Apparently
    you CAN send a variable and then load xml. Thanks so much for your
    advice and interest. I am much obliged.
    Marty Party
    Check out my code below....
    user_id=147;
    submit_button.onRelease=function(){
    function processXMLData(success)
    if(success)
    {_root.status_id="Success"
    var rootNode=this.firstChild;
    var contentNode=findNode(rootNode, "guit_vol");
    guitVol=getValue(contentNode);
    var authorNode=findNode(rootNode, "guit_pan");
    guitPan=getValue(authorNode);
    var contentNode=findNode(rootNode, "guit_vis");
    visGuit=getValue(contentNode);
    status_id=visGuit;
    etc....
    else
    content="Today's news is not found";
    function getValue(node)
    if (node && node.firstChild)
    return node.firstChild.nodeValue;
    return "";
    function findNode(node, nodeName)
    if (node.nodeName==nodeName)
    return node;
    for (var i=0; node.childNodes &&
    i<node.childNodes.length; i++)
    var foundNode=findNode(node.childNodes
    , nodeName);
    if (foundNode!=null)
    return foundNode;
    return null;
    var xmlData=new XML();
    xmlData.ignoreWhite=true;
    xmlData.onLoad=processXMLData;
    //xmlData.load("get_max_sess.php");
    var id:LoadVars = new LoadVars();
    id.user_id = user_id;
    //id.username = _root.username;
    id.sendAndLoad("get_max_sess.php", xmlData, "POST");
    Basic idea from
    http://www.permadi.com/tutorial/flashXMLNewsExample/index.html
    - Thank you!!

  • Passing variables from php to flash and the opposite

    Hi guys, im trying weeks now to solve this problem but nothing yet
    If someone could just tell me how to pass variables from flash to php and the opposite i would be thankful!!! Please help!

    I have recently had to learn this, so this may not be the best way but it worked for me
    I suggest looking at the code below stripping out everything you don't need (e.g. the databse stuff) and just get a simple string going back and forward
    have a go and post any problems here and I'll try and help
    in flash i have
    private function getBalanceAndXP():void
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "getBalance";
              variables.fbid = userID;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.addEventListener(Event.COMPLETE, onBalanceComplete);
              loader.load(request);
    private function onBalanceComplete(e:Event):void
              var loader:URLLoader = e.target as URLLoader;
              loader.removeEventListener(Event.COMPLETE, onBalanceComplete);
              var variables:URLVariables = new URLVariables(loader.data);
              _balance = parseInt(variables.balance); // class variable
              _experience = parseInt(variables.experience); // class variable
    public function setBalanceAndXP(balance:int, experience:int):void
                _balance = balance;
              _experience = experience;
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "setBalance";
              variables.fbid = userID;
              variables.balance = _balance;
              variables.experience = _experience;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.load(request);
    and then I have my php file
    <?php
    $func = $_POST["func"];
    $fbid = $_POST["fbid"];
    $balance = $_POST["balance"];
    $experience = $_POST["experience"];
    $numVariables = 0;
    $link = mysql_connect("localhost","username","password");
    mysql_select_db("databaseName");
    if ($func == "getBalance")
              getBalance($fbid);
    else if ($func == "setBalance")
              setBalance($fbid, $balance, $experience);
    mysql_close($link);
    function getBalance($fbid)
              $query = "SELECT balance, experience FROM tableName WHERE fbid = '".$fbid."'";
              $result = mysql_query($query);
              $row = mysql_fetch_row($result);
              writeVariable("balance", $row[0]);
              writeVariable("experience", $row[1]);
    function setBalance($fbid, $balance, $experience)
              $query = "UPDATE tableName SET balance = ".$balance.", experience = ".$experience." WHERE fbid ='".$fbid."'";
              mysql_query($query);
    function writeVariable( $name, $value )
              global $numVariables;
              if ( $numVariables > 0 )
                        echo "&";
              echo $name . "=" . urlencode($value);
              $numVariables++;
    ?>

  • Password authentification for as3 php upload

    Hi
    I'm making an Air file that uploads and overwrites an XML file.
    So far, the php is very simple:
    $everything = $_POST['saveThisXML'];
      $everything = stripslashes($everything);
       $toSave = $everything; 
       $fp = fopen("settings.xml", "w");
       if(fwrite($fp, $toSave)) echo "writing=Ok";
       else echo "writing=Error";
       fclose($fp);
    I'd like to set up a user name and passowrd that the user enters in the Air app.  Is it then just a matter of sending POST data to the php file, and have it check the user and pass variables?  Is that a reasonably safe way to do it?  If not, can someone please point me in th edirection of a good tutorial that they're used on this topic?
    Thanks again guys.
    Shaun

    OK
    So somewhere along the line, the user is going to have to set up a database.  I can use PHP to do that though, right?  And they'd just have to run the php page once to set it up.
    Thanks kglad.
    Also, I can successfully upload data from a string (myString) in Flash using PHP:
    var myData:URLRequest = new URLRequest("http://www.blah.com/saver.php");
            myData.method = URLRequestMethod.POST;
            var variables:URLVariables = new URLVariables();
            var origEverything:String = myString;
            variables.saveThisXML = origEverything;       
            myData.data = variables;
            var loadData:URLLoader = new URLLoader();
            loadData.dataFormat = URLLoaderDataFormat.VARIABLES;
            loadData.addEventListener(Event.COMPLETE, doneBaby);
            loadData.addEventListener(IOErrorEvent.IO_ERROR, dataLoadError);
            loadData.load(myData);  
    However, when I try to add two variables to send to php, I get a named pairs error.  Here's what I tried adding (in bold):
    var myData:URLRequest = new URLRequest("http://www.blah.com/saver.php");
             myData.method = URLRequestMethod.POST;
             var variables:URLVariables = new URLVariables();
             var origEverything:String = myString;
              var passTest:String = 'testPW';
             variables.saveThisXML = origEverything;     
         variables.saveThisPass = passTest;     
            myData.data = variables;
             var loadData:URLLoader = new URLLoader();
             loadData.dataFormat = URLLoaderDataFormat.VARIABLES;
             loadData.addEventListener(Event.COMPLETE, doneBaby);
             loadData.addEventListener(IOErrorEvent.IO_ERROR, dataLoadError);
             loadData.load(myData);  
    Why would that generate an error?
    Cheers kglad
    Shaun

  • PECL broken in PHP 5.6.7?

    So, I noticed this on a new install and now trying it on an existing install that I've been using for quite a while now and which I know I've used pecl before on is now not working.
    [root@magneto] ~ # pecl channel-update pecl.php.net
    Channel "pecl.php.net" is not responding over http://, failed with message: Connection to `pecl.php.net:443' failed: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
    Trying channel "pecl.php.net" over https:// instead
    Cannot retrieve channel.xml for channel "pecl.php.net" (Connection to `pecl.php.net:443' failed: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)
    Before anybody suggests this, yes, openssl is installed and operating and PHP on the CLI can see it, sockets are enabled and sockets have SSL support according to php -i, I have looked around, unsuccessfully, for a solution.

    Hi.
    I stumbled across the same problem today and i found a pretty neat solution.
    If you are using php > 5.6 the SSL handling is different. You need to define a global cert in the php.ini or....
    Problem when defining in php.ini:
    pecl and pear are calling php with the parameter "-n" this tells php to not use the php.ini and will result in the same error.
    @see -> vi /usr/local/bin/pecl (can be a different location)
    Line: exec $PHP -C -n -q ...
    The best solution (i think):
    Check where PHP try's to read the default cert from. This will give you the insights where PHP try's to find the ca cert file.
    $ php -r "print_r(openssl_get_cert_locations());"
    Example output:
    Array
    [default_cert_file] => /usr/lib/ssl/cert.pem
    [default_cert_file_env] => SSL_CERT_FILE
    [default_cert_dir] => /usr/lib/ssl/certs
    [default_cert_dir_env] => SSL_CERT_DIR
    [default_private_dir] => /usr/lib/ssl/private
    [default_default_cert_area] => /usr/lib/ssl
    [ini_cafile] =>
    [ini_capath] =>
    PHP try's to load it from "/usr/lib/ssl/cert.pem" (in my example). But everything breaks at this point because it is not there.
    SOLUTION:
    I have created a snippet for my dev machines to automatically FIX it.
    It tries to fetch the "default_cert_file" path from the output of the command above and then checks for it's existence.
    If the file and folders don't exist it creates them. Then curl jumps in and fetches the ca cert file from the curl website and writes it into the required file.
    Snippet
    PHP_DEFAULT_CERT=$(php -r "print_r(openssl_get_cert_locations());" | sed -n 's/.*=>\s\/\(.*\.pem\)/\/\1/p')
    if [[ ! -f ${PHP_DEFAULT_CERT} ]];then
    install -Dv /dev/null "${PHP_DEFAULT_CERT}"
    curl http://curl.haxx.se/ca/cacert.pem -o "${PHP_DEFAULT_CERT}" >/dev/null 2>&1
    fi
    When the ca cert is in place - just recall "sudo pecl update-channels"
    I hope it helps
    Last edited by sascha.seewald (2015-04-08 14:30:27)

Maybe you are looking for

  • Some songs not playing on iPod in iPhone

    I've had about 4 iPhones over the past few years and before that i had a second generation iPod nano. Over this period of time, I purchased a lot of music thru iTunes either on my computer or thru the one in iPhone. I then transferred music over from

  • Update ipad2 3G US Version from IOS 4.1.1 to IOS 6.0.1, ipad2 can't activate with itunes or wifi .

    Dear ,        when I update ipad2 3G US Version from IOS 4.1.1 to IOS 6.0.1, ipad2 can't activate with itunes or wifi . A friend of me buy the ipad in USA and bring it to China.        ipad2 NO: DLXFJN74DFJ1. I'm live in China now .        How can i

  • Oracle user can't see all files in a folder. Why?

    I've installed oracle 10g (32 bit) in Oracle EL (32 bit). When I attempt to start the database from the oracle user, it throws the following error: ORA-01078:failure in processing system parameters LRM-00109:could not open parameter file '/u01/app/or

  • PS6 Adjusting the DPI on a group of photos

    We have a large project that we want to try reducing the DPI on the graphics.  I am new to photoshop and wondered how to do it and if you can do it in a batch? Thank you, Susan

  • Error in terminating a string in pageContext.setForwardURL

    based on a condition i need to pass the url back from a package to the CO pageFormRequest in package i have my_string := ' "OA.jsp?page=/oaf/oracle/apps/xx/wf/wflocator/webui/ResultsPG" '; in co i have String paramABCD = am1.invokeMethod("my_test", p