D
D
Danila2015-09-15 18:09:56
PHP
Danila, 2015-09-15 18:09:56

Is using dot as the current folder in paths undesirable?

Routing was refactored in the application, after which a single entry point index.php appeared. The captcha fell off, the code was not drawn. The package was based on GD and did not handle loading the imageloadfont font, the passed path looked like './SomeFont.ttf'. The output of realpath('.') showed an interesting fact: with a single entry point, the dot points to the path to index.php. Does this mean that dots should not be used when defining paths? Is there any Apache directive that allows you to resolve such situations?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2015-09-15
@OnYourLips

Does this mean that dots should not be used when defining paths?

Using relative paths always leads to problems.
You should use absolute paths.

E
Eugene, 2015-09-15
@phpbug

Normal behavior. Dots may or may not be used.
And you just need to figure out the paths in php.
According to Apache, if you access a non-existent file in the depth of a php project, since it lies on a different path, the web server is not your helper.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question