help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with PHP setup


From: Bob Proulx
Subject: Re: Help with PHP setup
Date: Fri, 20 Jul 2018 17:10:05 -0600
User-agent: Mutt/1.10.1 (2018-07-13)

taariqq wrote:
> I am trying to set emacs up so that I can use it for PHP development.

I use emacs for PHP development.

> What I am looking for: 
> a) A way to open the files, via my vagrant or lampp setup, in the browser.
> b) Update the view in the browser as I save changes to the file in the editor.
> c) Switch the view in the browser as I switch from file to file and continue 
> to see the updates upon save.

I hate to post something that says it can't be done.  Because almost
always when someone says something can't be done it actually can be
done and other people prove that to be true.  But reading the above
makes me think that if someone does make that work that it would be
"icky".

The web browser program is so far removed from the editing program
that your desire to connect them together makes this feel "icky" to
me.  Although maybe you can get part way there with a browser plugin.

You didn't say if you were using Firefox, Chromium, or one of the
other browsers.  Knowing which browser you are using will undoubtedly
be important at some point.

> Not experienced at this stuff and would appreciate a little help. 

The way I personally operate is to edit the files with emacs on my
local system in my local sandbox.  I usually have a local php server
running in another terminal "php -S localhost:3000 -t root" or similar
(the "root" will be instance specific).  I make changes.  I then
switch over to my web browser (which may be emacs w3m or emacs eww, or
it may be Firefox or Chromium, either way) and reload the page.
Seeing the result then I make more changes in emacs.  Back and forth.
I check the output of the php server to check on any errors that may
be logged there.  I tolerate no spurious output and fix any error or
warning that appears.  Working this way is very easy.

If I switch to a different page then I do need to manually track to
that new page using either emacs w3m or Firefox/Chromium or whatever.
But then I am on the new page.  I only need to reload the page.  I
must emphasize that most of the time when I am developing that using
emacs as the browser through emacs w3m is usually sufficient.  (I find
the w3m form interaction user interface to be tedious however.)

I always develop locally in my local sandbox.  Then commit to version
control into my development branch.  Then test on my victim server.
Then push to production.  This glosses over a lot of details.

When I check into git I use the command line.  Usually using the most
awesome "git add -p ..." to split my changes into appropriate chunks
of changes.  That's a killer feature for me.  I never picked up the
habit of the emacs magit git interface but everyone else says very
good things about it and eventually I will try it.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]