Comments (7)
Hey @Arya-Aniket
Did you tried to add /opt/elastic/apm-agent-php
to realpath_turbo.open_basedir
or open_basedir
?
from apm-agent-php.
I have tried that now I am getting 0 out of know where in admin-ajax.php on wordpress after json
{
"success": true,
"data": {
"count": 1,
"items": "<input type="hidden" name="_wp_http_referer" value="/wp-admin/plugin-install.php?s=woom&tab=search&type=term&pagenow=plugin-install" />\t\t\t<div class="tablenav top">\n\t\t\t\t<div class="alignleft actions">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t
This plugin does not work with your version of PHP. <a href="https://wordpress.org/support/update-php/">Learn more about updating PHP</a>.</p></div>\t\t\t<div class="plugin-card-top">\n\t\t\t\t<div class="name column-name">\n\t\t\t\t\t
\n\t\t\t\t\t\t<a href="https://accessible-ajax-nls4.stagesite.top/wp-admin/plugin-install.php?tab=plugin-information&plugin=wooms&TB_iframe=true&width=600&height=550" class="thickbox open-plugin-details-modal">\n\t\t\t\t\t\tWooMS\t\t\t\t\t\t<img src="https://ps.w.org/wooms/assets/icon-256x256.jpg?rev=2826440" class="plugin-icon" alt="" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</h3>\n\t\t\t\t</div>\n\t\t\t\t<div class="action-links">\n\t\t\t\t\t<ul class="plugin-action-buttons">
MoySklad (moysklad.ru) and WooCommerce - sync, integration, connection</p>\n\t\t\t\t\t<p class="authors"> By <a href="https://wpcraft.ru/">WPCraft</a></cite></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="plugin-card-bottom">\n\t\t\t\t<div class="vers column-rating">\n\t\t\t\t\t<div class="star-rating"><span class="screen-reader-text">4.0 rating based on 22 ratings</span><div class="star star-full" aria-hidden="true"></div><div class="star star-full" aria-hidden="true"></div><div class="star star-full" aria-hidden="true"></div><div class="star star-full" aria-hidden="true"></div><div class="star star-empty" aria-hidden="true"></div></div>\t\t\t\t\t<span class="num-ratings" aria-hidden="true">(22)</span>\n\t\t\t\t</div>\n\t\t\t\t<div class="column-updated">\n\t\t\t\t\tLast Updated:</strong>\n\t\t\t\t\t2 months ago\t\t\t\t</div>\n\t\t\t\t<div class="column-downloaded">\n\t\t\t\t\t700+ Active Installations\t\t\t\t</div>\n\t\t\t\t<div class="column-compatibility">\n\t\t\t\t\t<span class="compatibility-compatible">Compatible</strong> with your version of WordPress</span>\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\t\t</div>\n</div>\n\t\t\t\t\t<div class="tablenav bottom">\n\t\t\t\t
}
}0
this issue coming from this file:
root@zwp-server:~# nano /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php ;
root@zwp-server:~# cat /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php -n
1 <?php
2
3 /*
4 * Licensed to Elasticsearch B.V. under one or more contributor
5 * license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright
7 * ownership. Elasticsearch B.V. licenses this file to you under
8 * the Apache License, Version 2.0 (the "License"); you may
9 * not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 declare(strict_types=1);
23
24 namespace Elastic\Apm\Impl\Util;
25
26 /**
27 * Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
28 *
29 * @internal
30 */
31 final class JsonUtil
32 {
33 use StaticClassTrait;
34
35 /**
36 * @param mixed $data
37 * @param bool $prettyPrint
38 *
39 * @return string
40 *
41 * @throws JsonException
42 */
43 public static function encode($data, bool $prettyPrint = false): string
44 {
45 $options = JSON_INVALID_UTF8_SUBSTITUTE;
46 $options |= $prettyPrint ? JSON_PRETTY_PRINT : 0;
47 $encodedData = json_encode($data, $options);
48 if ($encodedData === false) {
49 throw new JsonException(
50 'json_encode() failed'
51 . '. json_last_error_msg(): ' . json_last_error_msg()
52 . '. dataType: ' . DbgUtil::getType($data)
53 );
54 }
55 return $encodedData;
56 }
57 }
from apm-agent-php.
@intuibase
resolve this by removing : 0
public static function encode($data, bool $prettyPrint = false): string
{
$options = JSON_INVALID_UTF8_SUBSTITUTE;
$options |= $prettyPrint ? JSON_PRETTY_PRINT : {}; // original code => $options |= $prettyPrint ? JSON_PRETTY_PRINT : 0;
$encodedData = json_encode($data, $options);
if ($encodedData === false) {
throw new JsonException(
'json_encode() failed'
. '. json_last_error_msg(): ' . json_last_error_msg()
. '. dataType: ' . DbgUtil::getType($data)
);
}
return $encodedData;
}
from apm-agent-php.
@intuibase @pierrehilbert
/opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php
Can you please help me with this
from apm-agent-php.
Unfortunately I'm not familiar with the APM Agent for PHP.
@intuibase should be able to help you.
from apm-agent-php.
Hi @Arya-Aniket Could you please try the latest agent version. We fixed issue #1120 which is related to JSON encoding done by the agent.
from apm-agent-php.
@SergeyKleyman I tried, but getting error while using page editor.
Receiving 0 at the end of every api response json.
{
"success": true,
"data": {
"count": 67,
"items": ""
}
}0
- Error
Notice: Undefined variable: 2097152 in /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php on line 47
Notice: Undefined variable: 2097152 in /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php on line 47
- Error
runcloud@Test-Elk-Server:~/webapps/app-conroy$ tail -f wp-content/debug.log
#4 /opt/elastic/apm-agent-php/src/ElasticApm/Impl/ExecutionSegment.php(578): Elastic\Apm\Impl\Tracer->sendSpanToApmServer()
#5 /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Span.php(488): Elastic\Apm\Impl\ExecutionSegment->onChildSpanEnded()
#6 /opt/elastic/apm-agent-php/src/ElasticApm/Impl/AutoInstrument/Util/AutoInstrumentationUt in /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php on line 49
[22-Feb-2024 13:52:47 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php:21) in /home/runcloud/webapps/app-conroy/wp-admin/includes/misc.php on line 1431
[22-Feb-2024 13:52:47 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php:21) in /home/runcloud/webapps/app-conroy/wp-includes/functions.php on line 7049
[22-Feb-2024 13:52:47 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php:21) in /home/runcloud/webapps/app-conroy/wp-admin/admin-header.php on line 9
[01-Apr-2024 12:14:43 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/runcloud/webapps/app-conroy/wp-includes/rest-api/class-wp-rest-server.php:556) in /home/runcloud/webapps/app-conroy/wp-includes/pluggable.php on line 1435
[01-Apr-2024 12:14:43 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/runcloud/webapps/app-conroy/wp-includes/rest-api/class-wp-rest-server.php:556) in /home/runcloud/webapps/app-conroy/wp-includes/pluggable.php on line 1438
[01-Apr-2024 12:14:48 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/runcloud/webapps/app-conroy/wp-includes/rest-api/class-wp-rest-server.php:556) in /home/runcloud/webapps/app-conroy/wp-includes/pluggable.php on line 1435
[01-Apr-2024 12:14:48 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/runcloud/webapps/app-conroy/wp-includes/rest-api/class-wp-rest-server.php:556) in /home/runcloud/webapps/app-conroy/wp-includes/pluggable.php on line 1438
from apm-agent-php.
Related Issues (20)
- Research which instrumentation API to use to implement bridge - AST or PHP obs. API
- Test OTel instrumentations (umbrella)
- Infrastructure to test OTel instrumentations
- De-duplication of Elastic vs OTel source of data
- Test OTel instrumentation for HttpAsyncClient
- Test OTel instrumentation for PDO
- Test OTel instrumentation for Laravel
- [META 839] Implement /etc/hostname heuristic for host name capture
- Agent causing crash on Wordpress when running in Apache HOT 2
- Produce root-span ONLY in OLTP format HOT 1
- apm-agent-php versus used extension version. HOT 2
- Is this package still maintained? HOT 2
- APM/Kibana: Redis not shown as a dependency in php agent. HOT 4
- segfault et. al when running on ARM HOT 8
- Please enable Elastic agent for PHP to perform tracking of OCI HOT 1
- Segmentation fault on install HOT 1
- Distributed tracing by CLI scripts
- Elastic APM PHP Agent slows down PDO calls
- BAD SIGNATURE when installing on Alpine Linux HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apm-agent-php.