-
Notifications
You must be signed in to change notification settings - Fork 75
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
Web UI on nginx + php-fpm #22
Comments
Thanks for reporting this issue. There is no need to specify However can you check the content and permission bits (rx on directories and r on regular files) of I will try your dockerfile in the evening, and also add some logs to simplify debugging. |
Permissions look fine to me: /usr/share/misc/php-spx/assets/web-ui # ls -lha
total 40
drwxr-xr-x 4 root root 4.0K Mar 12 14:53 .
drwxr-xr-x 3 root root 4.0K Mar 12 14:53 ..
drwxr-xr-x 2 root root 4.0K Mar 12 14:53 css
-rw-r--r-- 1 root root 12.0K Mar 12 14:53 index.html
drwxr-xr-x 2 root root 4.0K Mar 12 14:53 js
-rw-r--r-- 1 root root 8.2K Mar 12 14:53 report.html |
Is fpm running as root ? The permissions are granted to root only. EDIT: in other words you might add something like a chgrp on this directory in the install process. |
|
IMHO this is on SPX side, I will add some logs this evening. SPX is supposed to intercept and serve any url starting with its prefix (_spx by default), this appears to be not the case in your setup. |
var_dump($_SERVER['REMOTE_ADDR']); looks alright: I just looked at the source code and you are right. It should intercept the url, which is correct according the var_dump. I'm testing the permissions now. |
FWIW, I also experienced the same thing under similar circumstances, php-fpm in a container. Looking forward to giving this a spin, it looks awesome. :) |
Turns out php-fpm is running as www-data in my container. Changing permissions with So yes, some debug output would be helpful :) |
@xtreamwayz done, just checkout |
@NoiseByNorthwest Where should it save the logs? I tried with the settings I posted before and it's downloading the empty file. Can't find any logs. I also tried the basics settings which result in a 404 and also no logs: extension=spx.so
spx.http_enabled=1 |
I use zend_error with E_NOTICE level, so on fpm's stderr, down to nginx error log on my setup. |
@xtreamwayz never forget |
|
I’m gonna try this on OSX now. Ran into the same error that the page just loads forever and the request times out. |
@NoiseByNorthwest First of all: AMAZING tool! This is exactly the way I want it and I already prefer this over PhpStorm’s Xdebug profiler snapshot analysis. Back to the issue: With latest master: |
Also seeing the above with the latest build. |
@hacfi @thinkspill @xtreamwayz I've the feeling that there are 2 distinct issues:
is that right ? If so, @hacfi can you please open another issue for the endless request bug ? I will try to make a minimal Dockerfile as a working fpm setup example. |
Enabled some more logging on my setup and I get this message as well: 2018/03/13 09:02:23 [error] 6#6: *1 FastCGI sent in stderr: "PHP message: PHP Notice: spx: access granted: "172.18.0.1" IP with "dev" key in Unknown on line 0" while reading response header from upstream, client: 172.18.0.1, server: _, request: "GET /_spx?SPX_KEY=dev HTTP/1.1", upstream: "fastcgi://172.18.0.6:9000", host: "localhost"
172.18.0.1 - - [13/Mar/2018:09:02:23 +0000] "GET /_spx?SPX_KEY=dev HTTP/1.1" 200 206 "-" "browser data" "-" I'm getting this on the webpage plus the file download:
|
It looks like the ftell here returns -1 as error (which is not handled). -1 is then interpreted as uint64 max value at formatting level. I cannot tell right now why fopen pass and not the ftell. |
@xtreamwayz @thinkspill @hacfi Just for your information it works fine with the trailing slash: However, I will fix the issue with the version without the trailing slash (either not intercept it or 301). |
@NoiseByNorthwest Thanks..that was it - works on macOS with fpm + nginx! |
Brilliant. It's working now after some nginx config changes. |
Sorry for commenting on a close issue. It still renders 404 for me on localhost http://localhost/_spx/?SPX_KEY=dev and my configurations are:
|
@aftabnaveed the 0.0.0.0 does not have any special meaning (like a wildcard...) in SPX context. You have to put your actual IP(s). |
I'm building this inside a docker container. The build is good. Running from the CLI inside the container works fine. However when trying to open the web ui from
http://localhost/_spx?SPX_KEY=dev
it gives me an empty_spx
file download.Am I doing something wrong?
Dockerfile build instructions
# SPX && git clone https://github.com/NoiseByNorthwest/php-spx.git /tmp/spx \ && cd /tmp/spx \ && phpize \ && ./configure \ && make \ && make install \
spx.ini:
Docker build log (located at the end).
The text was updated successfully, but these errors were encountered: