Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

realpath() function returns a correct relative path but cannot resolve it in a symlink-based Apache configuration #94

Open
codeKerl opened this issue Nov 11, 2024 · 0 comments

Comments

@codeKerl
Copy link

I am encountering an issue with the realpath() PHP function within a symlink-based Apache configuration. While realpath() returns a correct relative path, it cannot resolve it further, likely due to Apache’s permissions being based on the symlink path.

The visible result of this issue is that the file Main.entry.js cannot be found, impacting application functionality. When omitting realpath() and using direct paths, both the local testing environment (using ddev) and the production environment work as expected without issues.

Classes/Service/ViteService.php -> Line 250

protected function determineAssetIdentifierFromExtensionPath(string $identifier): string
    ...
    $file = PathUtility::basename($absolutePath);
    $dir = realpath(PathUtility::dirname($absolutePath));
    ...

Actual behavior:
The function only returns a relative path, which cannot be further resolved, likely due to restrictions from Apache’s handling of symbolic links.

Please see corresponding pull request:
#93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant