TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

FrankenPHP: Modern PHP App Server

418 点作者 aquova12 个月前

24 条评论

harrisonjackson12 个月前
I haven&#x27;t done any php development in maybe 10 years but this landing page almost got me to spin up a hello world.<p>I like the elephant frankenstein character - goofy and ugly&#x2F;cute. Design, color scheme, copy, and animations are clean :chefkiss:<p>The value prop is well highlighted - at least for someone that&#x27;s been out of php dev for a while. This seems like a nice way to bootstrap something small. Getting started code snippet makes it seem quick and easy.
评论 #40520484 未加载
评论 #40520904 未加载
jslaby12 个月前
Long time C# dev, now I primarily code in PHP8 which is a great language to quickly get things done. This is the kind of direction the language needs to go in, instead of the older LAMP which can require somewhat complex Apache configuration.
评论 #40520067 未加载
评论 #40521120 未加载
评论 #40520159 未加载
评论 #40520486 未加载
评论 #40523235 未加载
评论 #40520788 未加载
sandreas12 个月前
While I often use the PHP integrated webserver during development:<p><pre><code> php -S 0.0.0.0:8000 public&#x2F;index.php </code></pre> it is single threaded, slow and therefore not made for production environments. FrankenPHP looks promising, while the issue with limited Cores &#x2F; Threads[2] seems also to be a problem when using it in production. However, maybe I&#x27;ll give it a go for my pure-todo[1] project and see, if it suffers the same problem. The docker image as base looks really promising. Thanks for sharing.<p>1: <a href="https:&#x2F;&#x2F;github.com&#x2F;sandreas&#x2F;pure-todo">https:&#x2F;&#x2F;github.com&#x2F;sandreas&#x2F;pure-todo</a><p>2: <a href="https:&#x2F;&#x2F;github.com&#x2F;dunglas&#x2F;frankenphp&#x2F;discussions&#x2F;294">https:&#x2F;&#x2F;github.com&#x2F;dunglas&#x2F;frankenphp&#x2F;discussions&#x2F;294</a>
评论 #40521097 未加载
评论 #40521240 未加载
评论 #40524065 未加载
评论 #40520929 未加载
NorwegianDude12 个月前
I tried it and found it to be really slow, not even using my cores properly. Spent some time in the lacking docs and didn&#x27;t figure it out...<p>It says production ready with just a few commands and states 3,5 times the performance of fpm, but it&#x27;s running at like 1 % of the performance of fpm for me. I also tried the executable, same issue. Was expecting at least 200K rps for hello world...
评论 #40520851 未加载
评论 #40520346 未加载
评论 #40520722 未加载
whalesalad12 个月前
Interested to see how this fares on Tech Empower&#x27;s benchmarks: <a href="https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#hw=ph&amp;test=fortune&amp;section=data-r22&amp;l=zik073-cn3" rel="nofollow">https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#hw=ph&amp;test=fortune&amp;s...</a><p>At the moment it is at the bottom as a &quot;did not complete&quot;
dang12 个月前
Related:<p><i>Show HN: FrankenPHP, an app server for PHP written in Go</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33205282">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33205282</a> - Oct 2022 (83 comments)
评论 #40519985 未加载
评论 #40519938 未加载
geenat12 个月前
<a href="https:&#x2F;&#x2F;github.com&#x2F;dunglas&#x2F;frankenphp&#x2F;discussions&#x2F;294">https:&#x2F;&#x2F;github.com&#x2F;dunglas&#x2F;frankenphp&#x2F;discussions&#x2F;294</a><p>Has perf issues. Otherwise it&#x27;s a really promising project.
评论 #40520854 未加载
CoolCold12 个月前
I&#x27;ve tried to do Wordpress benchmark under FrankenPHP and under Apache&#x27;s Mod-PHP - I couldn&#x27;t see evidence of winning for FPHP. Have not dug deep enough though and test was in Docker, not on normal setup. Wordpress was basically in default setup - no heavy themes or anything of this sort, not very realistic case too.<p>Still want to repeat test and understand it better.
评论 #40520905 未加载
评论 #40520431 未加载
mg12 个月前
<p><pre><code> docker run -v $PWD:&#x2F;app&#x2F;public -p 443:443 \ dunglas&#x2F;frankenphp </code></pre> If you want to build a docker container yourself that you can use to serve your app, then running these commands should do the trick to turn a fresh Debian into the container you need:<p><pre><code> apt install -y apache2 libapache2-mod-php cat &lt;&lt; &#x27;EOF&#x27; &gt; &#x2F;etc&#x2F;apache2&#x2F;sites-enabled&#x2F;000-default.conf ServerName mysite.local &lt;Directory &#x2F;app&#x2F;public&gt; AllowOverride All &lt;&#x2F;Directory&gt; &lt;VirtualHost *:80&gt; DocumentRoot &#x2F;app&#x2F;public &lt;&#x2F;VirtualHost&gt; EOF </code></pre> Friends and I maintain a repo which shows how to go from zero to a running web application via popular languages and frameworks here:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;no-gravity&#x2F;web_app_from_scratch">https:&#x2F;&#x2F;github.com&#x2F;no-gravity&#x2F;web_app_from_scratch</a>
评论 #40520632 未加载
评论 #40520603 未加载
pachico12 个月前
I enjoy seeing this in the front page of HN.<p>My feeling is that FPM and its share nothing arquitecture has been both the key of PHPs success many years ago but also its condemnation.
oksteven12 个月前
I have been looking for something like this for a while; it&#x27;s great to see one now. My current approach is to use nginx container as a proxy to another container which run php-fpm, I don&#x27;t think it&#x27;s efficient enough. I&#x27;ll try Frankenphp and see if it can do better.
blixt12 个月前
Reminds me of that time 10 years ago when I tried to make Go more like PHP instead of the other way around: <a href="https:&#x2F;&#x2F;github.com&#x2F;blixt&#x2F;go-pher">https:&#x2F;&#x2F;github.com&#x2F;blixt&#x2F;go-pher</a><p>More seriously, happy to see worker mode in this server. PHP does come with several performance downsides, though I’m sure a lot of them have been worked around in the past decade. I don’t think I’d do PHP again though if I’m being honest.
评论 #40521407 未加载
zmxz12 个月前
There are claims this is faster. It&#x27;s not. I used it, together with other &quot;alternative&quot; runtimes which are just PHP command line interface long running scripts with some sort of task distribution balancer in front. Just like PHP-FPM is.<p>The apparent speedup comes from the fact it&#x27;s not shared-nothing, meaning that objects from previous requests (and variables) are persisted and present in subsequent requests. This makes it work exactly like Node.js, removing the wonderful part of PHP which is that it automatically cleans up all the crap devs created and creates clean slate when next request is to be executed.<p>All of these &quot;alternative&quot; runtimes are false positives, because they&#x27;re quick for first few requests but get slower and slower for the subsequent ones. Then, the workers are killed and restarted (precisely what PHP-FPM does too).<p>Since there&#x27;s no new engine behind executing PHP, the only way FrankenPHP (and others) can yield any performance is when they&#x27;re benchmarked against misconfigured PHP-FPM (opcache off, JIT off, persistent connections off).<p>It&#x27;s not my cup of tea. I like that there are attempts at doing &lt;something&gt; but turning PHP execution model into Node.js execution model isn&#x27;t the way to go.<p>I find it cheaper to throw a few bucks at stronger hardware compared to risking accurate execution to become flaky because shared-nothing is now unavailable.
评论 #40521171 未加载
thomasfromcdnjs12 个月前
It would seem that this is more or less an alternative to Octane but I don&#x27;t understand why there is documentation to also run Octane -&gt; <a href="https:&#x2F;&#x2F;frankenphp.dev&#x2F;docs&#x2F;laravel&#x2F;#laravel-octane&#x2F;" rel="nofollow">https:&#x2F;&#x2F;frankenphp.dev&#x2F;docs&#x2F;laravel&#x2F;#laravel-octane&#x2F;</a><p>Why would you run both?
评论 #40521024 未加载
评论 #40521075 未加载
alberth12 个月前
Is this just Caddy + PHP?
评论 #40519988 未加载
lnxg33k112 个月前
Could you integrate the documentation, or point me where it is explained, how to add php extensions? Like xdebug, opcache, etc? If there is something like docker-php-ext-install? Please, thank you
评论 #40524098 未加载
ThinkBeat12 个月前
Does this still require running Nginx as a reverse proxy in front of it?
评论 #40521143 未加载
评论 #40521146 未加载
samuell12 个月前
&quot;Build standalone, self-executable and dependencies-free binaries for your PHP web applications, and command-line tools.&quot;<p>I&#x27;m sold.
timvdalen12 个月前
What does it mean to get rid of PSR-7 in today&#x27;s age? Do people really miss $_GET and $_POST?
评论 #40521370 未加载
jumperabg12 个月前
Are there any benefits on running WordPress on top of FrankenPHP?
评论 #40521184 未加载
评论 #40521042 未加载
chuckreynolds12 个月前
oooh interesting. been a min since i&#x27;ve needed a php + WP setup but... not bad.
6312 个月前
Interesting for sure. My current setup is your basic nginx, fastcgi, php-fpm. I have some custom ngnix config though and I wouldn&#x27;t want to have to switch web servers. I guess I could still use nginx as a reverse proxy and point it to this but then what&#x27;s the point? I&#x27;ll look into it for future projects where I really just need a simple php deployment, but for my needlessly complex project I&#x27;m already working on, I don&#x27;t think it fits.
ofrzeta12 个月前
Alternatives are:<p>- Roadrunner <a href="https:&#x2F;&#x2F;roadrunner.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;roadrunner.dev&#x2F;</a> (also written in Go)<p>- Swoole <a href="https:&#x2F;&#x2F;www.swoole.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.swoole.com&#x2F;</a> <a href="https:&#x2F;&#x2F;openswoole.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;openswoole.com&#x2F;</a><p>See <a href="https:&#x2F;&#x2F;laravel.com&#x2F;docs&#x2F;11.x&#x2F;octane" rel="nofollow">https:&#x2F;&#x2F;laravel.com&#x2F;docs&#x2F;11.x&#x2F;octane</a> for Laravel specific framework integration.
评论 #40521188 未加载
评论 #40522269 未加载
评论 #40524207 未加载
notpushkin12 个月前
&gt; Copy your PHP files in the document root, that’s all!<p><i>sigh</i>
评论 #40520036 未加载