Below is a gist of where to find various PHP/Apache related files in ZS9.1 PHP 7.1.3 on IBM i

SELECT SUBSTR(JOB_NAME,1,6) AS JOB_NUMBER,
SUBSTR(JOB_NAME,8,POSSTR(SUBSTR(JOB_NAME,8),'/')1) AS JOB_USER,
SUBSTR(SUBSTR(JOB_NAME,8),POSSTR(SUBSTR(JOB_NAME,8),'/')+1) AS JOB_NAME,
X.*
FROM TABLE (QSYS2.ACTIVE_JOB_INFO('NO','','','')) AS X
WHERE lower(JOB_NAME) like '%zend%' OR lower(SERVER_TYPE) like '%zend%' OR lower(FUNCTION) like '%php%' ;
QZSRLOG is your Apache logging service
QZSRHTTP is Apache thats handling incoming HTTP
QZHBMAIN manages the Apache job and starts all processes for it (CGI, primary HTTP, logging, etc..)
zfcgi is the manager to start the php-cgi jobs via fastcgi unix domain socket
php-cgi.bi is the zendsvr/bin/php-cgi.bin there's multiple of these jobs running so php can respond quickly to a request.
CREATE OR REPLACE VARIABLE THE_JOB1 VARCHAR(30);
SET THE_JOB1='133679/QTMHHTTP/ZENDSVR';
Get Job log of any specific job
select * from table(qsys2.joblog_info(THE_JOB1)) a;
Create a table that contains the stack for all of the threads in a specific job.
CREATE TABLE STACK_DUMP AS (
SELECT * FROM TABLE(QSYS2.STACK_INFO(THE_JOB1, 'ALL')) AS X
) WITH DATA;
SELECT * FROM STACK_DUMP;

## check what php extension modules are loaded
$› /usr/local/zendphp7/bin/php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
ibm_db2
iconv
imap
intl
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
oci8
openssl
pcre
PDO
pdo_ibm
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
pspell
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tidy
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend Code Tracing
Zend Data Cache
Zend Debugger
Zend Job Queue
Zend Monitor
Zend Monitor UI
Zend OPcache
Zend Page Cache
Zend Server Z-Ray
Zend Utils
zip
zlib
Zmail
[Zend Modules]
Zend Code Tracing
Zend Data Cache
Zend Debugger
Zend Extension Manager
Zend Job Queue
Zend Monitor
Zend Monitor UI
Zend OPcache
Zend Page Cache
Zend Server Z-Ray
Zend Utils

view raw
Z output php -m.sh
hosted with ❤ by GitHub

/usr/local/zendphp7/bin/php -v
PHP 7.1.3 (cli) (built: Mar 22 2017 15:23:35) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend Extension Manager v9.1.0, Copyright (c) 2004-2017, by Zend Technologies
– with Zend Data Cache v9.1.0, Copyright (c) 2004-2017, by Zend Technologies [loaded] [licensed] [disabled]
– with Zend Job Queue v9.1.0, Copyright (c) 2004-2017, by Zend Technologies [loaded] [licensed] [enabled]
– with Zend Utils v9.1.0, Copyright (c) 2004-2017, by Zend Technologies [loaded] [licensed] [enabled]
– with Zend OPcache v7.1.3, Copyright (c) 1999-2017, by Zend Technologies [loaded] [licensed] [enabled]
– with Zend Code Tracing v9.1.0, Copyright (c) 2009-2017, by Zend Technologies [loaded] [licensed] [enabled]
– with Zend Server Z-Ray v9.1.0, Copyright (c) 2004-2017, by Zend Technologies [loaded] [licensed] [enabled]
– with Zend Monitor v9.1.0, Copyright (c) 1999-2017, by Zend Technologies [loaded] [licensed] [disabled]
– with Zend Debugger v6.0.0-i5, Copyright (c) 1999-2017, by Zend Technologies [loaded] [licensed] [enabled]
– with Zend Page Cache v9.1.0, Copyright (c) 2004-2017, by Zend Technologies [loaded] [licensed] [disabled]
– with Zend Monitor UI v9.0.0, Copyright (c) 2004-2017, by Zend Technologies [loaded] [licensed] [enabled]

view raw
Z output php -v.sh
hosted with ❤ by GitHub

## What you can do with PHP from cli
/usr/local/zendphp7/bin/php -help
Usage: php.bin [options] [-f] <file> [–] [args…]
php.bin [options] -r <code> [–] [args…]
php.bin [options] [-B <begin_code>] -R <code> [-E <end_code>] [–] [args…]
php.bin [options] [-B <begin_code>] -F <file> [-E <end_code>] [–] [args…]
php.bin [options] -S <addr>:<port> [-t docroot] [router]
php.bin [options] — [args…]
php.bin [options] -a
-a Run interactively
-c <path>|<file> Look for php.ini file in this directory
-n No configuration (ini) files will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse and execute <file>.
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-B <begin_code> Run PHP <begin_code> before processing input lines
-R <code> Run PHP <code> for every input line
-F <file> Parse and execute <file> for every input line
-E <end_code> Run PHP <end_code> after processing all input lines
-H Hide any passed arguments from external tools.
-S <addr>:<port> Run with built-in web server.
-t <docroot> Specify document root <docroot> for built-in web server.
-s Output HTML syntax highlighted source.
-v Version number
-w Output source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
args… Arguments passed to script. Use — args when first argument
starts with – or script is read from stdin
–ini Show configuration file names
–rf <name> Show information about function <name>.
–rc <name> Show information about class <name>.
–re <name> Show information about extension <name>.
–rz <name> Show information about Zend extension <name>.
–ri <name> Show configuration for extension <name>.

view raw
Z php -help.sh
hosted with ❤ by GitHub

/usr/local/zendphp7/bin/php-config
/usr/local/zendphp7/bin/php-config[43]: /usr/local/bin/sed: cannot execute
Usage: /usr/local/zendphp7/bin/php-config [OPTION]
Options:
–prefix [/usr/local/zendphp7]
–includes [-I/usr/local/zendphp7/include/php -I/usr/local/zendphp7/include/php/main -I/usr/local/zendphp7/include/php/TSRM -I/usr/local/zendphp7/include/php/Zend -I/usr/local/zendphp7/include/php/ext -I/usr/local/zendphp7/include/php/ext/date/lib]
–ldflags [ -L/usr/local/libxml2-2.9.1/lib -L/usr/local/curl-7.35.0/lib]
–libs [ -lcrypto -lssl -lcrypto -lstdc++ -lstdc++ -lcrypto -lssl -lcrypto -lcurl -lz -lcrypto -lssl -lcrypto -lm -lxml2 -liconv -lm -lcurl -lssh2 -lssh2 -lssl -lcrypto -lz -lxml2 -liconv -lm -lxml2 -liconv -lm -lxml2 -liconv -lm -lxml2 -liconv -lm -lxml2 -liconv -lm ]
–extension-dir [/usr/local/zendphp7/lib/php/20160303]
–include-dir [/usr/local/zendphp7/include/php]
–man-dir [/usr/local/zendphp7/share/man]
–php-binary [/usr/local/zendphp7/bin/php]
–php-sapis [ cli cgi]
–configure-options []
–version [7.1.3]
–vernum [70103]

view raw
Z phpconfig.sh
hosted with ❤ by GitHub