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

[Bug]: Herd can't open files (Kirby CMS) #391

Closed
Werbschaft opened this issue Feb 10, 2024 · 12 comments
Closed

[Bug]: Herd can't open files (Kirby CMS) #391

Werbschaft opened this issue Feb 10, 2024 · 12 comments

Comments

@Werbschaft
Copy link

Operating system version

macOS Sonoma 14.0

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.4.0 Build 20

PHP Version

PHP 8.3

Bug description

I have a lot of PHP files that dynamically output content but with a different header. Example template.css.php

<?php header('Content-type: text/css; charset: UTF-8'); ?>
/* Dynamic generated CSS */

However, this does not work with Laravel Herd. It works with Mamp Pro and also on every server. Only Herd gives me a 404 status. Does anyone know what the problem could be? I would like to switch from Mamp Pro to Laravel Herd.

Steps to reproduce

No response

Relevant log output

No response

@mpociot
Copy link
Member

mpociot commented Feb 10, 2024

Which error do you get?

@Werbschaft
Copy link
Author

That's the strange thing, I only get a 404 error back. Error logs are empty. I somehow can't explain this.

@mpociot
Copy link
Member

mpociot commented Feb 10, 2024

Are you using any framework? You might need to take a look at Herds drivers in order to properly serve your site: https://herd.laravel.com/docs/1/extending-herd/custom-drivers

@Werbschaft
Copy link
Author

Yes, I use Kirby CMS. But already asked there in the Forum and they got no solution

@mpociot
Copy link
Member

mpociot commented Feb 10, 2024

Do you have an example repo that I can reproduce this?

@sschlein
Copy link
Member

@Werbschaft ping

@Werbschaft
Copy link
Author

Sorry for the delay. I created a repo. It's a fork of the original Kirby Starterkit, the only difference is one CSS File, located in assets/css/dynamic.css.php. But this file won't load.

The original Starterkit works like in this Video: https://www.youtube.com/watch?v=Mb_-bo77IPc

https://github.com/Werbschaft/kirby-starterkit-dynamic-css

@sschlein
Copy link
Member

My guess is that this is related to the underlying Laravel Valet component that Herd also uses. Both are using this driver to serve Kirby: https://github.com/laravel/valet/blob/master/cli/Valet/Drivers/Specific/KirbyValetDriver.php.

This driver is also by maintained by 3rd party developers, likely from the Kirby community, so I'd address this problem in their community so that they can fix the driver in Valet and eventually we can do that in Herd as well.

We don't have Kirby experience and rely on others to provide a driver that supports this and so it's not a Herd issue that we can fix.

@sschlein sschlein changed the title [Bug]: Herd can't open files [Bug]: Herd can't open files (Kirby CMS) Feb 16, 2024
@sschlein
Copy link
Member

nginx error for future reference:

2024/02/16 11:40:16 [error] 19811#10597866: *6 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: kirby-css.test, request: "GET /assets/css/dynamic.css.php HTTP/1.1", upstream: "fastcgi://unix:/Users/seb/Library/Application Support/Herd/herd82.sock:", host: "kirby-css.test", referrer: "http://kirby-css.test/"

@Werbschaft
Copy link
Author

Thanks so much. I will ask the Kirby Community for help

@Werbschaft
Copy link
Author

Solution is found, Kirby Valet Driver has a new PR: laravel/valet#1471

@mpociot
Copy link
Member

mpociot commented Mar 11, 2024

Fixed in Herd 1.4.2

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

No branches or pull requests

3 participants