php-apm icon indicating copy to clipboard operation
php-apm copied to clipboard

cant get APM to Log the stuff in PHP7.0 FPM

Open ChrisWesterfield opened this issue 8 years ago • 3 comments

Hi I would like to add APM to my applications But somehow the database tables aren't created during the run of the scripts. I have enabled the opcache of php7 I also have the tideways profiler installed.

heres my php-fpm pool config

[cp] user = ######### group = ########## listen = /home/####################/run/php.sock listen.owner = ############ listen.group = ############## listen.mode = 0660 pm = dynamic pm.max_children = 30 pm.start_servers = 4 pm.min_spare_servers = 4 pm.max_spare_servers = 8 php_flag[display_errors] = off php_admin_value[error_log] = /home/##########/logs/php5-fpm.log php_admin_flag[log_errors] = on php_admin_value[memory_limit] = 512M php_admin_value[opcache.file_cache] = "/home/############" php_admin_value[apm.mysql_enabled]=1 php_admin_value[apm.mysql_error_reporting]=E_ALL|E_STRICT php_admin_value[apm.mysql_host]=localhost php_admin_value[apm.mysql_user]=########### php_admin_value[apm.mysql_pass]=####################### php_admin_value[apm.mysql_db]=########## php_admin_value[apm.socket_path]=/home/##########/run/php-apm.sock php_admin_value[apm.application_id]=##################### php_admin_value[apm.socket_enabled]=0 php_admin_value[apm.sqlite_enabled]=0 php_admin_value[apm.statsd_enabled]=0 php_admin_value[apm.mysql_port]=3306

where is my mistake?

ChrisWesterfield avatar Mar 17 '16 21:03 ChrisWesterfield

Hi,

Can you try without tideways and/or xdebug if activated?

I notice that you defined apm.mysql_error_reporting to E_ALL|E_STRICT. That might be the issue. While configured within PHP (ini_set, php.ini,...), PHP knows what are the values of E_ALL (32767) and E_STRICT (2048) which means that E_ALL|E_STRICT = 32767 (in PHP 7). I am, however, not sure that your web server knows those values and is probably not computing that correctly and tries to pass the string "E_ALL|E_STRICT" which is then received by PHP as the integer value "0" which means => report nothing.

Do you see APM in a page with phpinfo() and does the configuration match your configuration file? You will be able to validate my possible theory looking at the apm.mysql_error_reporting value.

The tables are supposed to be created by APM, but the database should be created in advance. Does the DB user has access to table creation?

You can test this connecting to your DB with:

$ mysql -u<USER> -p<PASSWORD> <DATABASE>
> CREATE TABLE test ( `test` varchar(255) DEFAULT NULL  );
> DROP TABLE test;

Cheers.

patrickallaert avatar Mar 29 '16 11:03 patrickallaert

So this extension works with PHP7 or no?

Lewiscowles1986 avatar May 02 '16 09:05 Lewiscowles1986

@Lewiscowles1986 yes it works

jamesstout avatar Apr 16 '17 15:04 jamesstout