Local Apache

24 views
Skip to first unread message

Homme, James

unread,
May 23, 2012, 11:37:26 AM5/23/12
to scite-i...@googlegroups.com

Hi,

Is this the command that will cause a file to use an instance of Apache locally on Windows?

command.go.$(file.patterns.web)="http://localhost/$(FileNameExt)"

 

Thanks.

 

Jim

 

Jim Homme,

Usability Services,

Phone: 412-544-1810.

"Our doubts are traitors, And make us lose the good we oft might win, By fearing to attempt." --William Shakespeare

 




This e-mail and any attachments to it are confidential and are intended solely for use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this e-mail without the author's prior permission. The views expressed in this e-mail message do not necessarily represent the views of Highmark Inc., its subsidiaries, or affiliates.

Philippe Lhoste

unread,
May 24, 2012, 3:59:16 AM5/24/12
to scite-i...@googlegroups.com
On 23/05/2012 17:37, Homme, James wrote:
> Is this the command that will cause a file to use an instance of Apache locally on Windows?
>
> command.go.$(file.patterns.web)="http://localhost/$(FileNameExt)"

I suppose you tried, unsuccessfully?
First, it can be Apache or any other Web server, as long as it serves port 80...
Next, this will work only if your file is at the root of the Web server, the www,
public_html or whatever name it is given.
If it is outside of this dir, no hope (but I suppose you know this already).
If it is in a sub-dir, you might need to extract the path (in a Lua script), remove the
path of your root, change \ to / and append to http://localhost/

I just tried your command, with a file in my www folder, and it opened the page in Firefox
(my default browser).

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

Homme, James

unread,
May 24, 2012, 8:57:50 AM5/24/12
to scite-i...@googlegroups.com
Hi,
Thanks for your help.

Then I'm guessing that Windows is associating php files with the extension, because it seems like PHP.exe must be running instead of my web server. If I type http://localhost/file.php into the Run dialog, it works, so something else is preventing it from working. I will continue to research.

Jim Homme,
Usability Services,
Phone: 412-544-1810.
"Our doubts are traitors, And make us lose the good we oft might win, By fearing to attempt." --William Shakespeare

> --
> You received this message because you are subscribed to the Google
> Groups "scite-interest" group.
> To post to this group, send email to scite-i...@googlegroups.com.
> To unsubscribe from this group, send email to scite-
> interest+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/scite-interest?hl=en.

Philippe Lhoste

unread,
May 25, 2012, 4:51:50 AM5/25/12
to scite-i...@googlegroups.com
On 24/05/2012 14:57, Homme, James wrote:
> Then I'm guessing that Windows is associating php files with the extension, because it
> seems like PHP.exe must be running instead of my web server. If I type
> http://localhost/file.php into the Run dialog, it works, so something else is
> preventing it from working. I will continue to research.

Well, I don't really understand the "PHP.exe must be running instead of my web server"
sentence. PHP should be integrated to your server, so Apache handles the request and then
hand it to PHP so it runs file.php.

Beware of how file extensions are handled.
For example, I have the following line in my setting:

command.go.$(file.patterns.php)=php -f "$(FileNameExt)"

So if I hit F5 in SciTE with a .php file being edited, it will be run instead of the
command for .html files.

strainer

unread,
May 25, 2012, 11:11:26 PM5/25/12
to scite-i...@googlegroups.com
In windows if the file type is registered to php then 'starting' its filepath will send it to php.exe
but windows usually sends urls to the default webbrowser.
If we send a file://c:/eg.txt URL to the webbrowser it can fetch the file (raw), there is no way for the browser to know what web urls might correspond to the file. One file can be served by multiple web servers -and differently. But i think a disk file path should have only one current copy... even in lilliput..

Anyway, this one liner can fetch a url and print it in the output but ive not looked into how to get it into a new or existing buffer, perhaps its only possible through the Lua system.

command.5.*=php -r "error_reporting(0); $content= file_get_contents('http://127.0.0.1/$(FileNameExt)'); if(!$content){echo 'timeout';}else{echo $content;}"

hth
strainer
Reply all
Reply to author
Forward
0 new messages