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

Trying to build-static without docker can only access app with explicit /index.php (especially using Caddyfile) #663

Open
sawirricardo opened this issue Mar 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@sawirricardo
Copy link

sawirricardo commented Mar 15, 2024

What happened?

cd ~ && git clone https://github.com/dunglas/frankenphp
cd ~ && composer create-project laravel/laravel build-static-laravel

Add Caddyfile

{
frankenphp
order php_server before file_server
}

# need to use port other than 80
:81 {
root * /public
encode zstd br gzip
php_server
}

then execute

cd ~/frankenphp && EMBED=~/build-static-laravel ./build-static.sh
./dist/frankenphp-mac-arm64 php-server

Here we have to access explicitly the index.php file like http://localhost:81/index.php instead of http://localhost:81
other explicit files such as http://localhost:81/robots.txt are being served fine

Build Type

Standalone binary

Worker Mode

No

Operating System

macOS

CPU Architecture

Apple Silicon

PHP configuration

none

Relevant log output

No response

@sawirricardo sawirricardo added the bug Something isn't working label Mar 15, 2024
@d8vjork
Copy link

d8vjork commented Mar 15, 2024

Yesterday I was pulling my hair off with this too, didn't manage anything cause files are on an unzipped folder inside /tmp therefore no idea where they were pointing...

To me I was using the latest dev version (which I thing is more or less the same as this repo's master branch?): dunglas/frankenphp-dev:static-builder

Also: I'm using same kind of machine, did you get this UPX thing compressing stuff super slow too?

@d8vjork
Copy link

d8vjork commented Mar 15, 2024

Adding this to the server/location block (no idea how is called in Caddy):

rewrite * /index.php?{query}&p={path}

Made everything work, might be some mistake from any parent/inherited config from FrankenPHP into the static-builder?

@sawirricardo
Copy link
Author

Hm, I'm not sure, may as well need official comment for this @dunglas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants