PHP/SRV Server: $_SERVER['PHP_SELF'] should contain protocol |
|
Actual behaviour:
When the script
Expected behaviour: The $_SERVER['PHP_SELF'] variable should contain the protocol:
Possible solution: Encode the protocol in a way so that the URL is a valid RFC URL. Url-encoding it works only partially, and breaks inside the script if the parseurl function is used; i.e.:
|
||||||||||||||||||||||||||
_________________ jorgen*fabeljet,com |
Clumsily put. |
|
It was perhaps not very clearly formulated; while writing the post, I discovered that the core of the problem was not the lacking '/file:' part in PHP_SELF, but the fact that the URLs used by SRV are not valid URLs (according to the RFC mentioned in the first post), and thus cannot be pulled apart and put toghether using the standard PHP functions (parseurl, for instance).
So: My feature request is actually to make the SRV URLs valid in some way, by encoding the first part of the path in a way that doesn't contain ':', and that doesn't get decoded when passed to the PHP script: if the ':' is hidden in the URL but present within the PHP script, nothing is gained. I should of course have written that the first time. |
||||||||||||
_________________ jorgen*fabeljet,com |
Site Admin
|
It's clear that SRV works with filenames instead of regular URLs. It's provided for simplicity. You don't need to change any setting and it will work for you out of the box. On the other hand, such "simplicity" may cause problems when working with filenames/URLs and trying to aquire data from the them. There are two approaches that may get good results: a) avoid parsing URLs. Just create a "config" file that will have a setting with absolute directory for the project. All the rest files should know their location relative to the project root. b) Switch to Apache server.
|
||||||||||||
|
Tha same problem |
|
Hello dmitri, I have the same problem. I prefer the solution (a) but I didn't understand it. Could you explain please how should be look like the config file. Thank you. |
||||||||||||||
|
Site Admin
|
I think we'll follow this suggestion:
The idea with config file is quite strightforward: you can define site root directory and root URL in this file and calculate relative path and URLs if you need them using __FILE__, config file info and funcitons like dirname(). |
||||||||||||||
_________________ The PHP IDE team |
Change CRV to apache |
|
hi
I want to know how can I run my phped project with apache located in my local mashin? If yes,please tell me how? Thanks |
||||||||||||
|
PHP/SRV Server: $_SERVER['PHP_SELF'] should contain protocol |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by