Web Development - Saving/Uploading files to Linux server from Windows - php

I will be developing a new project in PHP. The scripts will need to be tested on Linux and I will be coding on windows. The script cant be tested on Windows because I will be running Asterisk server on Linux. The script I will write will communicate with the Asterisk server. It will be uploading the files specific directories on Linux for testing. There are three directories I will be working on:
/var/www/
/var/www/admin
/user/local/bin/ - Daemon (process) script will be written in PHP.
It will be annoying I have to keep uploading files to the specific directories via FTP client. So what is alternative good solution to upload files easily to Linux server while im coding on Windows?

Investigate setting up an SMB share on the Linux machine that you can map as a network drive on your Windows machine.

You can install a samba server and mount the relevant directories as drives on your windows client.
As an alternative, you can use the deployment capabilites of your IDE
Eclipse PDT
see also this answer How do I add FTP support to Eclipse?
Netbeans

I know this is an old post but just in case someone else comes across it....Use something like Netbeans so that when you save your code your files will be automatically saved to the server

Related

Running php files from SmartFtp through an apache server

I am currently working alongside a project team for the development of a website and we are using SmartFtp for file sharing.
Does anyone know how to compile/edit php files through SmartFtp? I.e. using apache for compiling and atom for editing.
Please note: I have already tried copying the files into the htdocs folder within xampp but had no luck. The php files did not successfully copy into the htdocs folder.
Thanks again
Fair warning...
This is a terrible way to host a project. Each developer should have their own isolated project installation. Even though you only have a few developers, it's only a matter of time before you get a collision and somebody loses work.
Using FTP is also a terrible idea. It is completely insecure.
That said, you've got a couple options:
If your dev server is a *nix flavor, you can probably use SSHFS to mount the remote directory on your local machine. This will allow you to edit the remote files live, as if they were any other regular local file. This is secure and relatively easy to set up, but you may find it a bit too slow for anything but small projects.
Use FTPS/SFTP/SCP to push files to the remote server when you save them locally. I'm not terribly familiar with Atom, but many IDEs (like NetBeans and PHPStorm) can be configured to automatically FTPS/SFTP/SCP push changed files to remote servers. Just save locally as you normally would, and in the background, the IDE will perform an FTPS/SFTP/SCP push. Do not use FTP. If your server has FTP configured, it probably also has SFTP and/or FTPS configured.
Create your own development environment. Host your own site on your own machine so that you don't collide. You can run Apache/Nginx/PHP/MySQL directly on your machine, in a virtual box, or even a docker container. This is the best and most flexible option, but also requires the most effort to get running.
This should be a comment, but its a bit long.
I am really confused by your question.
how to compile/edit php files
PHP uses a run-time compiler. Are you talking about Roadsend or HipHop or something else?
development of a website and we are using SmartFtp for file sharing
Presumably you don't give a damn about your code integrity, managing conflicting code changes, version control or the security of your development environment. It's 2017. FTP was way past its sell-by date before the turn of the millenium.
compile/edit php files through SmartFtp
It's an FTP client. Just one of many things you don't use to compile or edit files (others include an avacado, a tennis shoe, scissors, a sunset...).
Presumably you are using this client to connect to a server - which you've told us nothing about. You probably want to do the collaborative bit of your code management (if that is what you are asking) on the server.
(from comments)
Development sever with multiple people pushing edits ad hoc while they code through an Ftp server.
That's not a "development server" that's a recipe for code armageddon.

To which doctrine2 script do I point Netbeans if my webserver is remote? - using Symfony2

Can anybody give me a hint?
My environment is:
I am developing on a Windows 7 machine running Netbeans IDE 7.2
I am using a (headless) Ubuntu 12.04 as web- and databaseserver on a home network
I have just started using PHP / Symfony2 and am struggling to complete the setup of my environment
I have installed a PHP engine on my Windows machine in order to get a PHP interpreter but don't want to maintain a webserver on this machine too.
Now I want to tell Netbeans where to look for a Doctrine2 script to exploit the Doctrine IDE support in Netbeans. But as Doctrine is not installed on my development machine, it cannot find any Doctrine2 script.
What are my options?
This is only kind of a hint, since I'm only used to working with a virtual linux installation:
Provide a shared folder on your Windows machine
Mount that shared folder on your Ubuntu machine
Use that shared folder as apache document root for example
Now you can work with the files on your local machine, and your server is able to pull those files for serverside stuff.
Might also work vice versa, sharing your webroot, or whatever directory doctrine is in, as a shared folder, so that Netbeans on your Windows machine can pull it via network.

Working on a remote PHP project (Ubuntu Server) via Eclipse, Netbeans or any other IDE

I am wokring on a PHP project, which is located on an Ubuntu server to which I have SSH access.
Sometimes I code in Ubuntu and sometimes in Windows (mostly Ubuntu).
Do you have any idea how to connect to the project on the server and edit the files. I searched the net, got some ideas like using SSHFS, but I want something which works both on Linux and Windows.
I also found Eclipse Remote System Explorer, but I think it is not that stable and might cause problems (correct me if I am wrong).
Basically I (like) code in Eclipse, but I can move to Netbeans or any other good (but Free) IDEs, if I have to.
Thanks.
Aptana Studio 3 has everything you need
ssh w/ built in terminal
sftp (connect FTP through SSH)
Eclipse Based
GIT/SVN support
PHP Support
etc...
Related to your comment:
How Connect to remote host from Aptana Studio 3
http://vimeo.com/aptana
At my company each developer has a windows PC to work from with a linux dev VM that mirrors production's setup. The linux servers have a samba share setup to the /var/www directory. There are two common workflows we follow.
The developer checks out the code repo to their local PC. They use Netbeans (previously Eclipse) to edit the files and an IDE feature copies the edited file to the webserver via samba.
Pro: fast
Con: webserver can get out of sync, only one way syncing: windows -> VM
The developer checks out the code repo to the samba folder. They open the code from the IDE and edit from there.
Pro: two way syncing, can edit from server if need be, can use any editor/IDE
Con: slow
We ran for a while under setup 2, but quickly found that it was far too slow for us so most use setup 1. The only exceptions are remote teams that find it easier to connect directly to the VMs.
I use Emacs with Tramp plug-in.
I use eclipse with Aptana. There you can easily use the build in FTP support to connect to the server.
Another solution would be mouting the server directory to your PC. On Windows systems you can use something like WebDrive.

Setting up a (web) development environment

I would like to know how I can improve my development environment.
At the moment:
I'm using Netbeans as my IDE.
My local Dev server runs on a RHEL5 VirtualMachine similar to my production server.
My Netbeans project is editing the VM files via ssh (I have mounted the server as a local drive)
But:
It's slow
Files can disapear ( netbeans delete them ? )
I can't use git on it because it's slow.
The idea would be to be able to have a shared filesytem between the guest os and the host os.
Your setup sounds ok. You might need to give your virtual machine more resources however if your experiencing speed problems. That or move your server to a separate physical machine.
You may try a setup for files the other way around. Keep your files an the host machine in the shared folder. Than on your VM create a symbolic link from your htdocs folder to that shared folder. In this case developing should be very fast but only running the website on your VM might be slower.
EDIT: My setup is the following:
I got a XAMPP running on Windows 7 for development
I got a SVN repository on the webserver the production system is runnig
In a separate subdomain on my webserver I have a test system running
So basically I develop under Windows, I test on the same machine that runs my production system. We even got Macs for developing as well. I never had any issues developing under Windows and running the page on a openSUSE system (beside case-sensitive file names). Using the exact same machine for the test server is a good idea as it has the same limitations as the production server. So I think having three system DEVELOPMENT, TEST, PRODUCTION is the best you can get. But if it is only for some smaller projects your setup look quite good.
I find XAMPP sufficient for nearly all development locally :)
http://www.apachefriends.org/en/xampp.html
It depends on the type Virtual Machine you're running. For example Vmware is able to share a specific folder between the guest and the host OS
if you're using a mac, I'd recommend : http://www.mybringback.com/bringers/14509/git-local-and-shared-server-development-environment-with-ssh-setup/
which uses a local mamp/git/ and live server.
You could probably follow along with windows, but it's been awhile since I used it, so I'm 100%
best of luck

Developing on both Windows & Linux machines simultaneously

Sorry for the bad title (couldn't think of a better way to describe it)
I have a windows machine which I do development on. However, I have a new project which needs to interact with a linux system (executing linux commands etc.).
So, obviously I can't do development on my windows machine..and I don't wish to code on the dev machine, svn commit and then svn update it on the linux machine.
Is there a way where any changes I make on my dev machine will be quickly mirrored to the linux machine? SVN is not a very quick alternative and of course some changes will be very minor.
Any ideas? A network share I guess....but that's not very pretty (bit slow too).
As fellow developers I would like to know if you've been in a similar situation and how you've resolved it.
On a furthernote, I can't just install Ubuntu as my development machine and mirror the commands, applications etc. from the linux machine because it's a cluster 'master' machine and so therefore it has quite a special configuration.
Thanks guys!
EDIT: I've also thought about having web services on the linux machine and then just calling them from code thus seperating platform development dependency. What do you think about that too? thanks
Edit your files on the Linux machine, using Samba to expose them to Windows file-sharing.
(Alternatively via SFTP, but Windows software to mount SFTP as a filesystem isn't free.)
Have you considered using an XServer on your Windows box? You should be able to fire up a desktop session on the Linux box and have it display on your Windows machine.
Depending on how Linux-savvy you are, you may be able to get away with simply using SSH to get a terminal window, then editing files with vi or emacs. If you're working with PHP, I assume that you'll be able to see the results with your regular browser. I've done this a lot, and while it's not a full-on IDE, it's certainly workable.
You can developp your app in Windows and test it throug cygwin ;)

Categories