Coder Social home page Coder Social logo

Comments (7)

NoiseByNorthwest avatar NoiseByNorthwest commented on July 19, 2024 1

Got it. It is not supposed to be exposed in this way, but rather served by PHP. Indeed the extension will intercept normal PHP execution for its routes (i.e. those prefixed with _spx).

So what you need is simply to configure your vhost so that PHP is triggered for /_spx* URLs which is already the case for a classic "url rewriting" setup (e.g. a vhost configured for Symfony) where any non existing file is served by PHP.

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on July 19, 2024 1

For security reasons SPX does not intercept normal execution by default, you need to be authenticated (both ip & key in query string / header / cookie).

If your ip is properly set, simply go to: http://<your host>/_spx/?SPX_KEY=dev

You can also check your PHP log, SPX outputs some NOTICE messages.

from php-spx.

jrgilman avatar jrgilman commented on July 19, 2024 1

Ah! It's the IP because I'm running it in docker. I understand now. All is working well. Thanks for indulging me being a bit stupid here. I think I'll make a fork and pull request an update to the installation instructions to make all of this clear for slower people like me 😅.

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on July 19, 2024

"Command line prefix" is a recent feature, not documented yet.
Which browser ? I guess the "/_spx/data/metrics" endpoint does not work, can you confirm it with the network pane of the debug console ?

from php-spx.

jrgilman avatar jrgilman commented on July 19, 2024

Confirming that /_spx/data/metrics does not work: https://imgur.com/a/810MoBX

The browser is Google Chrome Version 64.0.3282.186 (Official Build) (64-bit)

Maybe I'm not setting this up correctly? All I did really was make a symbolic link between the WebUI folder and /var/www/html.

EDIT: Thanks for the quick response!

from php-spx.

jrgilman avatar jrgilman commented on July 19, 2024

Okay, set-up a simple rewrite rule:

<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	Options +FollowSymLinks
	
	RewriteEngine On

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule /_spx* /index.php
</VirtualHost>

Based on your last message, my understanding is that SPX should intercept the execution of index.php, and run the website instead, but I am still getting the phpinfo() page (I set index.php to it). It is reporting that the SPX extension is active though: https://imgur.com/a/5DhY7Tl

from php-spx.

NoiseByNorthwest avatar NoiseByNorthwest commented on July 19, 2024

Your welcome, thanks for your feedback!
And yes feel free to make a PR to improve the doc (#54).

from php-spx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.