Usually you run you Web Application on locahost and you test there. But if the developing and the testing are performed on a Remote Server then using the FTP connection can be handy.
Prerequisites
- 💻 Apache NetBeans
- install Apache NetBeans which will be used to develop the project
- 🔗 GIT version control repo
- 💾 FTP Server
- have access to an online server that will provide you with login credentials (FTP Hostname, Username and Password)
- the FTP server must allow remote connection to its file system
Step 1 – GIT
- Login or Register to BitBucket and create a new repository under “Repositories”
- Lets call our repository “test_project” as a private repository (do not want to be public at this point)
- The version control system will be GIT and is good to have a README file so that the repo will not be empty (does not really matter)
- After the creating you will need to locate the clone URL via HTTPS (the link is located on the “Clone” button in the top right corner), and it would be something like that: https://username@bitbucket.org/username/test_project.git
Step 2 – NetNeans GIT
- Open NetBeans (dont create a project yet, we will create it later) and click “Team” => “Clone Repository”
- In the field “Repository URL” paste the repo URL from the previous step (BitBucket clone URL)
- Enter the username and the password to access the online repo
- Before clicking next specify the destination folder to store the code and in the next steps just confirm the settings
- If the clone repo is successful then it will prompt us to create an IDE project
Step 3 – NetBeans Project and FTP
- In the create project wizard we choose PHP Application
- In the next step we give a name in out project, preferably the same name with the repo “test_project” and we save the project:
- either in a subfolder eg. C:\www\test_project\test_project (which the first folder is the GIT repo and the second is the IDE project)
- or we save the project and the GIT repo files in the same folder eg. C:\www\test_project
- In the 3rd step we choose “Remote Web Site (FTP/SFTP)” and click on the “Manage” button to define the FTP connection details (hostname, username, password)
- On the same 3rd step we choose when it will push the files to the live server. There are 3 options “Manually”, “On Run” and “On Save” and in this case will choose “On Save”
Final Step
We are ready to start developing our project. If we create the first file eg. index.php and start edititng the file on every save the file it will automatically push to live server.
Also at the end of a task we could commit our changes to the repo with right click on the project “GIT => Commit” and then “GIT => Remote => Push to Upstream”