Shero Support

How can we help?

Follow

Server Stats and Info

Here is a little set of server info tools I occasionally install on dev.

 

Please note: 

  1. modify the .htaccess files if you need to add another ip address to the list.  Do NOT remove the restrictions.
  2. Only install on dev, never staging or live!!!
  3. Create a directory[I use info] and extract the files there

Once installed, you can browse to http://dev.sitedomain/info and you will have a list of directories, one for each tool.  If you don't know what a tool does, you don't need it.

info/srvinfo

invokes the apache mod_info function.  Occassionaly useful to see how the server is configured.   If you don't understand it, you don't need it.

 

info/status: 

invokes the apache_modinfo status function.  The main thing to look at here is the big block of letters and dots.  These represent every potential client connection the server can handle simultaneously.  Lots of dots is good, that means their idle and can handle new requests.  Few dots is bad.

info/php : shows phpinfo() 

Things to check here: 

PHP Version: at top of page

Little known php feature:

 

 

In the section labeled "Core"

 

realpath_cache_ttl

All the various file 'stat' functions are cached and that cache persists from connection to connection.  A stat function things like whether the file exists, the last time it was updated, etc.   It is possible to clear the stats by clearstat using http://php.net/manual/en/function.clearstatcache.php

 

disabled_functions:  defaults to

eval,shell_exec,system,openlog,syslog,closelog,apache_child_terminate,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_request_headers,apache_reset_timeout,apache_note,apache_setenv,virtual,ini_alter,dl,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_setpriority,posix_access,posix_kil,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,apc_cache_info,apc_clear_cache,apc_sma_info,apc_store,apc_fetch,apc_delete,apc_delete_file,apc_define_constants,apc_load_constants,apc_compile_file,apc_add,apc_inc,apc_dec,apc_cas,apc_bin_dump,apc_bin_load,apc_bin_dumpfile,apc_bin_loadfile,apc_exists

 

The biggies that screw things up are eval and shell_exec [ also sometimes called just exec ] 

Disabled functions generally just fail silently, no log message, often it won't even result in a white screen, it just doesn't do what you expect it to.

exec is used by some extensions in order to clean their cache, so when you clear the cache through the admin it reports success while doing nothing for that extension.

Despite this, do not ask nexcess to remove one of these functions without checking!  These functions are disabled because they are security risks.

What I do when I need one of these functions is execute my script through ssh.  If you do so with php <filename> it will still not work.  You have to check phpinfo for the line 'Loaded configuration file'

Then on the server copy that file to a subfolder in the home directory.  Edit the copy and remove the functions you need from disabled_functions

Now you can call php and tell it to use your custom php.ini

php -c [inipath]/[inifilename]  [scriptname]

 

Comments