Comments (8)
I don't think Flarum has any relation to the file_get_contents
in your snippet. Can you move that api call above the return []
array and see if the same timeout is generated or not?
from framework.
@luceos Even if I put it in a middleware it has the same problem. I've actually solved this by running fastCGI on a different port for Flarum and the other Laravel app. So it is as I suspected - something to do with conflicting env environments with Flarum and the other Laravel app. Maybe this isn't a problem specific to Flarum, though I think it may help if Flarum had a way of caching the config.
from framework.
See this comment recommending cached config, as that bypasses DotEnv loading during bootstrapping which could resolve this: vlucas/phpdotenv#219 (comment)
Is there any plans to add php flarum config:cache
?
from framework.
See this comment recommending cached config, as that bypasses DotEnv loading during bootstrapping which could resolve this: vlucas/phpdotenv#219 (comment)
Flarum doesn't use DotEnv, nor does it cache the config in that sense so a config:cache command does not make sense here, I believe you are dealing with a different issue on your server, as what you are referring to is a laravel-specific issue.
from framework.
I really fail to understand how this can be a Flarum issue. Are you sure this isn't an opcache issue? Any changes to your files (with opcache enabled) requires an opcache flush.
from framework.
@luceos Your welcome to try it - try to file_get_contents
of a local Laravel app running on same FastCGI host/port if you happen to have one available.
It isn't Opcache (not enabled at all for me on localhost) - it's most likely env problem. See links mentioned above - caching of configs seems to help. If Flarum doesn't use DotEnv I wonder how it sets up the environment? Is that possibly conflicting with the other Laravel apps environment variables? putenv
$_ENV
I'll close this issue. At least there is some visibility for devs if they come across the problem and find the above links useful.
from framework.
What is your environment like? I see you're on Windows, do you use virtualisation @garygreen ?
PS I just tested this on my macbook using a wildcard nginx install with pretty much exactly your code to another laravel app on the same machine and it works.
from framework.
I am indeed on Windows with nginx. Have php-cgi.exe -b 127.0.0.1:9000
running and use nginx config setup so that both Flarum and other Laravel app use same fastcgi_pass
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Btw thank you so much for taking a look at it. It might be a Windows specific problem. Changing FastCGI to run on different ports for Flarum and the other Laravel app fixes it (of course requires another php-cgi.exe to be listening)
from framework.
Related Issues (20)
- LogInController doesn't handle validation exceptions properly
- Code Splitting
- Flarum ColorInput textbox issues
- Increasing the number of discussions shown per page HOT 6
- `DiscussionTaggedPost` might show "deleted" when tag is secondary
- Forum not working in IE11 HOT 1
- Provide a ForumPage (or something like that) that contains the sidebar can inherit from HOT 7
- bug happens when replying again HOT 1
- Search drivers HOT 2
- typo in js part of sticky plugin HOT 5
- Missing Component Exports
- DispatchEventsTrait causes error when event does not have "actor" attribute due to PHP 8.2 deprecation HOT 4
- Setting permissions on mobile does not display correctly on mobile
- PostRepository::getIndexForNumber() walks 2 time the posts table to get offset HOT 6
- Code blocks are hard to read in dark mode HOT 2
- [1.x] `Conditional` extender instantiates the extenders array even when the conditional is false
- Support Invokable Classes in Console Extender's schedule method
- Akismet False Positives Triggered by Flag Removal
- Empty settings don't return default values HOT 13
- Content max limit is incorrect HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.