NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Getting Started - advice request


Joined: 02 May 2015
Posts: 2
Reply with quote
Hi all,

I just installed a trial version of PhpEd and would welcome some advice in getting up and running.

I have several shared hosting accounts with php websites which I edit via ftp using PSPad, a simple test editor with built-in ftp client.

I recently took on a dedicated linux server and I want to do the same, but via SFTP. So I am trying out PhpEd with this aim.

To get up and running and familiarise myself with PhpEd I am firstly trying to replicate my ftp file-editing setup (shared hosting). At this stage I don't need any server-side debugging, just the ability to edit php files locally and update them on the server via ftp.

Can anyone guide me in the simplest way to set up accounts, workspaces and projects to do this without any debugging (and thus no php.ini updates which I can't do on shared hosting)?

Thanks.
View user's profileFind all posts by gavSend private message
Guru master

Joined: 24 Jul 2009
Posts: 716
Reply with quote
My recommendation would be to install a XAMPP distribution. Don't use SRV and don't use IIS with PHP. You really want to more closely emulate Apache with PHP on Linux and using XAMPP is the best way of doing that, unless you are wanting to also create a local Linux server.

Note: SRV is good for some projects, but when you are developing a web project you really want to more closely emulate the final server.

Next recommendation is to not use localhost for running your websites when developing; use real looking domain names which contain some dots. A lot of new developers use something like http://localhost/mysite-1 and http://localhost/mysite-2 but localhost is technically not a valid domain name. Some site frameworks don't like localhost as a domain name and it often causes issues with cookies either not working or being shared for all the localhost sites.

Also this configuration often means all those sites are sharing a root, which can be bad for security and some frameworks need to be told they are sharing a root.

You can use your computer hosts file (c:\windows\system32\drivers\etc\hosts) to make up fake domain names and/or use a local DNS server. You don't need to register these domain names, they are just for you.

Then XAMPP can be configured to serve web sites using these same names, with each web site having its own separate root directory.

Then copy over a web site (files and data) from your public web server to your XAMPP and get it running without PhpED. You should be able to visit and use the site with any web browser.

Once you have that done, on your local XAMPP you can install the NuSphere DBG module into PHP and get project working for debugging. Use the NuSphere DbgWizard to help with setting up DBG into PHP; it will tell you where to install it. Whilst you said you don't want server side debugging yet, I'm assuming you mean public server. You do want local server debugging?

Note: Debugging on the public server is rarely required and often not recommended anyway. I have only very rarely had to debug on a public server when there has been a complex issue that I couldn't debug locally, or where I was debugging for a client and didn't have a local copy of the site.

Use PhpED to setup a new project, which will at the same time test the debugger is working. You could skip the debugger steps if you don't need debugging yet. Normally you would tell PhpED about your local XAMPP (using your fake domain names) and not the public web server, which PhpED doesn't need to know about.

Optionally you can add an FTP account for your public web server to PhpED so you can transfer files back to it.

There are additional things you can do such as implementing a version management system such as Git or SVN.
View user's profileFind all posts by plugnplaySend private message


Joined: 02 May 2015
Posts: 2
Reply with quote
Thanks for the advice plugnplay!

Very useful, but possibly overkill for what I want to do right now which is simply to edit on my pc files which sit on my web server, using ftp/sftp to transmit the file updates. (I don't want to carry out any debugging, at least for now. I also don't want to run a server or do anything on my pc except edit).

This process is ridiculously easy with PSPad, in which one only has to enter and save ftp login details and connect before viewing, opening and editing server files as if they were local. Saving a file automatically overwrites the server file via ftp. I would happily continue to use PSPad except that it does not support sftp.

I would however like to make use of PhpEd's interface and code-editing tools. Can I set up PhpEd to let me edit and update server files as eaily as this?

Thanks.
View user's profileFind all posts by gavSend private message
Guru master

Joined: 24 Jul 2009
Posts: 716
Reply with quote
If you want to make use of PhpED Code Insight, then you either need a local copy of the project (fast) or have to map an FTP area to a drive (extra software + slow).

PhpED can open, edit and save files using FTP, but I doubt you would be getting much use of the features in PhpED that make it useful.

So the best method would probably be to download project files and store those locally, then upload changes from PhpED.

Coincidentally I know developers who work exclusively on servers using FTP. They don't have local development copies of their sites. When their sites have an issue or get hacked, then don't have a nice local development copy to compare with. Having a local development copy of sites can be a very good idea.
View user's profileFind all posts by plugnplaySend private message
Getting Started - advice request
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic