Skip to content

Commit

Permalink
Fixed link in open_basedir related log message (#1129)
Browse files Browse the repository at this point in the history
* Fixed link in open_basedir related log message

* Fixed link from Troubleshooting to Limitations / open_basedir
  • Loading branch information
SergeyKleyman authored Jan 31, 2024
1 parent 45177c3 commit 9e35092
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
6 changes: 5 additions & 1 deletion agent/native/ext/lifecycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,11 @@ void elasticApmModuleInit( int moduleType, int moduleNumber )
elasticapm::php::Hooking::getInstance().replaceHooks();

if (php_check_open_basedir_ex(config->bootstrapPhpPartFile, false) != 0) {
ELASTIC_APM_LOG_WARNING( "Elastic Agent bootstrap file (%s) is located outside of paths allowed by open_basedir ini setting. Read more details here https://www.elastic.co/guide/en/apm/agent/php/current/setup.html#limitations", config->bootstrapPhpPartFile);
ELASTIC_APM_LOG_WARNING(
"Elastic Agent bootstrap file (%s) is located outside of paths allowed by open_basedir ini setting."
" For more details see https://www.elastic.co/guide/en/apm/agent/php/current/setup.html#limitation-open_basedir"
, config->bootstrapPhpPartFile
);
}

resultCode = resultSuccess;
Expand Down
14 changes: 12 additions & 2 deletions docs/setup.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ So if you would like to build `elastic_apm-*.so` on one machine and
then deploy it on a different machine, you will need to copy both
the built `elastic_apm-*.so` and the downloaded source files.

=== Limitations
[discrete]
[[limitations]]
Please be aware that if the https://www.php.net/manual/en/ini.core.php#ini.open-basedir[open_basedir] option is configured in your php.ini, the installation directory of the agent (by default /opt/elastic/apm-agent-php) must be located within a path included in the https://www.php.net/manual/en/ini.core.php#ini.open-basedir[open_basedir] configuration. Otherwise, the agent will not be loaded correctly.
=== Limitations

[discrete]
[[limitation-open_basedir]]
==== `open_basedir` PHP configuration option
Please be aware that if the https://www.php.net/manual/en/ini.core.php#ini.open-basedir[`open_basedir`]
option is configured in your php.ini,
the installation directory of the agent (by default `/opt/elastic/apm-agent-php`)
must be located within a path included in the
https://www.php.net/manual/en/ini.core.php#ini.open-basedir[`open_basedir`] value.
Otherwise, the agent will not be loaded correctly.
5 changes: 3 additions & 2 deletions docs/troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ Also see <<dev-internal-config-disclaimer>>.
=== Agent is not instrumenting code
[source,bash]

==== open_basedir issue
==== `open_basedir` PHP configuration option

If you see a similar entry in the agent log, this indicates an incorrect open_basedir configuration. Please read the details in the <<limitations, limitations>>
If you see a similar entry in the agent log, this indicates an incorrect open_basedir configuration.
For more details please see <<limitation-open_basedir, the corresponding Limitations sub-section>>.
----
[Elastic APM PHP Tracer] 2023-08-23 14:38:12.223397+02:00 [PID: 268995] [TID: 268995] [WARNING] [Lifecycle] [lifecycle.cpp:558] [elasticApmModuleInit] Elastic Agent bootstrap file (/home/paplo/sources/apm-agent-php/agent/php/bootstrap_php_part.php) is located outside of paths allowed by open_basedir ini setting. Read more details here https://www.elastic.co/guide/en/apm/agent/php/current/setup.html
----
Expand Down

0 comments on commit 9e35092

Please sign in to comment.