Troubleshooting
Manual configuration of PHP extension module and whatap-php service
If installation of the PHP extension module and whatap-php service (install.sh) has not been successful, you can install them manually. Use this method when environment information cannot be checked for any reasons such as PHP compile installation.
Creation of whatap.ini
$ cp /usr/whatap/php/template.ini /usr/whatap/php/whatap.ini
$ vi /usr/whatap/php/whatap.ini
# Add this content at the top
; Enable whatap extension module
extension=whatap.so
whatap.license= # Issued access key
whatap.server.host= # Issued server IP
whatap.app_name= # Web server classification: APHP, FPHP (apache: APHP, php-fpm : FPHP)
whatap.app_process_name= # Process name of apache and php-fpm (httpd,php-fpm)
Configuration | Description |
---|---|
whatap.license | The access key issued from Project Menu > Management > Agent Installation can be checked. |
whatap.server.host | You can see the server IP issued from Project Menu > Management > Agent Installation. |
whatap.app_name | APHP is used for the Apache server and FPHP is used for php-fpm. |
whatap.app_process_name | If you enter the exact value as the execution process name of Apache or php-fpm, the memory usage for the process is collected. For example, they are httpd , apache2 , php-fpm , and such. |
Checking the PHP command (CLI)
$ which php
/usr/bin/php
Configuring the environment variables for the whatap-php service
Set the PHP CLI command's path in the $WHATAP_PHP_BIN
environment variable.
$ sudo vi /etc/init.d/whatap-php
export WHATAP_PHP_BIN= # PHP command's location (/usr/bin/php)
Checking the PHP API version
Set the PHP CLI command's path in the $WHATAP_PHP_BIN
environment variable.
$ sudo php -i | grep 'PHP API'
PHP API => 20100412
Checking whether PHP ZTS (Zend Thread Safe) is available
$ sudo apachectl -V | grep MPM
Server MPM: Prefork # ZTS unavailable
Server MPM: Worker # ZTS available
$ sudo php-fpm -i | grep Thread
Thread Safety => disabled # ZTS unavailable
Thread Safety => enabled # ZTS available
Checking and configuring the PHP extension module's path
Checking the PHP extension module's path
$ sudo php -i | grep extension_dir
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules
Configuring the PHP extension module
After checking the PHP API version and PHP ZTS's availability, select a library that meets the environment. In the PHP extension module's path, copy the whatap.so file name.
- In case PHP ZTS is available - whatap_zts_[PHP API version].so
- In case PHP ZTS is unavailable - whatap_[PHP API version].so
# Example in case the PHP ZTS is not supported
$ sudo cp /usr/whatap/php/modules/x64/whatap_20100412.so /usr/lib64/php/modules/whatap.so
Configuring the environment variables for the whatap-php service
$ sudo vi /etc/init.d/whatap-php
export WHATAP_PHP_EXT_HOME= # PHP extension path (/usr/lib64/php/modules)
export WHATAP_PHP_EXT_SRC= # whatap library path and file name
# (/usr/whatap/php/modules/x64/whatap_20100412.so)]
- In the
$WHATAP_PHP_EXT_HOME
environment variable, set the PHP extension module's path. - In the
$WHATAP_PHP_EXT_SRC
environment variable, set the whatap library's full file path.
whatap.ini configuration
-
Check the PHP ini file's path that has been added.
$ sudo php -i | grep '.ini files'
Scan this dir for additional .ini files => /etc/php.d -
Copy whatap.ini and paste it to the path.
$ sudo cp /usr/whatap/php/whatap.ini /etc/php.d/whtap/ini
Cannot check the PHP ini file's path that has been added
This happens if the PHP compile installation option, --with-config-file-scan-dir=PATH
has not been set.
$ sudo php -i | grep '.ini files'
Scan this dir for additional .ini files => (none)
Add the content in whatap.ini at the end of php.ini.
$ php -i | grep 'php.ini'
Loaded Configuration File => /etc/php.ini
$ sudo vi php.ini
# Add at the end of a file
[whatap]
;Enable whatap extension module
extension=whatap.so
whatap.ext.error_enabled=true
whatap.ext.exception_enabled=true
whatap.trace_user_enabled=true
whatap.trace_user_using_ip=false
For other options, use /usr/whatap/php/whatap.ini.
Configuring the whatap-php service's environment variables
In the $WHATAP_CONFIG_HOME
environment variable, set the path for whatap.ini.
If the added PHP's ini path cannot be checked, set the /usr/whatap/php path in which whatap.ini has been created.
$ sudo vi /etc/init.d/whatap-php
export WHATAP_CONFIG_HOME= # whatap.ini path (/etc/php.d)
Restarting the service
- Restart Apache and PHP-FPM services.
- Restart the whatap-php service.
Error: Not found PHP API
This occurs if the PHP command (CLI) cannot be found.
Check the correct PHP command (CLI) location and then proceed with Optional installation of the PHP extension module and whatap-php service.
$ sudo php -i | grep 'PHP API'
PHP API => 20100412
Error: Not found PHP ini directory
This error occurs when the value in Scan this dir for additional.ini files
has not been checked. If the PHP compile installation option, --with-config-file-scan-dir=PATH
has not been installed, the environment information does not exist.
After referring to the following guide, check the correct PHP command (CLI) location and then proceed with Optional installation of the PHP extension module and whatap-php service.
$ sudo php -i | grep '.ini files'
Scan this dir for additional .ini files => (none)
In case transactions do not appear in the response time distribution chart
The CPU and memory graphs appear but the response time distribution chart (hitmap) does not appear in the following cases:
- The agent is connected to the collection server but the tracer is not applied to the PHP extension module.
- Apache and PHP-FPM have not been restarted after configuration.
-
Check whether the PHP extension module has been applied.
$ sudo php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
…
whatap # Check the WhaTap module load
…
[Zend Modules] -
Restart Apache and PHP-FPM services.
-
If the PHP extension module has not been applied, it indicates abnormal installation. Check whether the path of whatap.so or whatap.ini meets the PHP environment.
With referring to the following guide, check the items like PHP command (CLI) path, PHP extension module path, and Additional PHP ini configuration file path.