Pushing to cPanel: How to set up? - php

As a self-taught developer I have always worked directly in cPanel to edit websites, which is obviously not the way to go. I am looking to figure out how I can start connecting local folders with cPanel so I can easily try changes locally before deploying them to the live website.
I have heard about FTP and checked out fileZilla but that seems to still be a manual process. I am looking for a way similar to using Git. Run changes locally, and then commit and push them to cPanel when all is good.
If anybody has any suggestions on the best way to go about doing this, that would be greatly appreciated. I'd like to work with node.JS if possible but just running php would also already be great.

I'd recommend using GIT itself. cPanel has now integrated GIT to its updated versions.
You can read more about this from below URL:
https://blog.cpanel.com/git-version-control-series-setting-up-git/

Related

provide updates to a webapp via a bitbucket repo

I have created a simple web-application using PHP, JS etc.. My next step is to deploy it to eg. liveserver.com. I am sure that I will be providing a lot of additional features in the future and so I would like to know how this is generally done. I am pretty sure its a noob question so I tried to google it but nothing helpful came up.
Here is a rough idea on how I may do it. I would keep a local copy in WAMP and keep developing it and sync / push it to bitbucket. The question is : How do I connect the updated bitbucket version to my liveserver.com. I am keen to know how web-developers generally provide updates to their app users. Is there a general update mechanism they follow ? Is my idea of using a version control application wrong for this purpose ? How would you do it for a simple app like this ?
A concise answer would suffice. It would be great if anyone could provide me helpful links or point me to right direction, further information etc. TIA.
You're really asking two questions here:
How do I connect the updated bitbucket version to my liveserver.com?
I would like to know how this (syncing code between test environment and production environment) is generally done, best practices and stuff.
The first question is answered here. The latter, broader question is touched on here but I'd like to offer my personal thoughts as well.
You've mentioned you're using WAMP, whereas I'm coming from a LAMP environment. Regardless, I'm hoping you will find some additional usefulness in my answer as it may help lead you to a Windows-based equivalent solution.
At home/work:
I also use bitbucket and prefer it to github. I have Git installed for source control which allows me to push or pull any code between bitbucket and my local machine.
On the go:
I have AWD IDE installed on my tablet which allows me FTP access to a production environment, and the non-free version also has Git integration. Another great IDE is Cloud 9; completely web-based and convenient if I don't have my tablet with me and need to use a public computer or laptop. Cloud 9 also supports Git.
Syncing:
Rather than push code from Bitbucket to my production server, I prefer to keep a mirror of my production server locally. I use a tool called rsync for this. I have a bash file setup on a cron job that looks something like this:
#!/bin/sh
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
RUSER=remoteUser
RHOST=remoteHost
RPATH=/remote/path/
LPATH=/local/path/mirror/
$RSYNC -av --no-p --delete -O -e $SSH $RUSER#$RHOST:$RPATH $LPATH
So basically, my primary workstation (which is where I do most of my work) is always in sync with the live server. Both the live server and Bitbucket can be updated away from home. Thanks to Git, I can see exactly what has been modified. It's also comforting to know my code exists in three different places for redundancy.
This is what I have found to be most convenient for me, but I would love to know how others do it.

Workflow for PHP website development with multiple developers & designers

I thought this had to be a common problem, but I was not able to find an easy solution. The problem is, we are working with multiple people on developing a website, without any version control involved. Which leads to obvious problems with conflicting edits and someone messing up the whole site with no simple way to recover. Currently some work with Filezila + Notepad++ directly downloading, additing and uploading the files.
Others work with Netbeans on their local copy and upload the files automatically when saving.
What I would like to do now is intruduce a version control system that still lets everyone work on the live system, but checks for conflicts and allows to rollback files to previous versions.
I tried to set up GIT with a post-receive hook that copies everything to the webroot, but failed in doing so. Besides I think SVN might be a better solution because everyone has just to checkout/commit instead of pull/commit/push.
Is it possible to set up GIT/SVN the way I like to?
Is there a better solution?
I have an SVN server setup and a cron job on the dev server to pull the latest revision out every 60 seconds. Then I have another script on the live server that isn't croned but I can manually run which updates the live server to the specified revision when I request it.
This allows the devs to commit and automatically test on the dev server pretty much real time and then when we've reviewed the code changes etc on the dev server and we're happy with it then I manually run the update on the live server.
The "common" problems come from you letting them work on live website ...
A developer on live will always find a way to ruin your day!

A way to do unit testing online? (i.e. Google)?

I'm trying to setup phpUnit via my host however, they are severely outdated and the documentation on how to use it is non-existent (hosts version). I'm wondering is there a way to do online unit testing, where the framework is hosted somewhere other than my server?
For example does Google have a solution where I can just include a file from Google's server?
UPDATE:
OK so apparently there is no cloud based way to run phpUnit. So my problem is installing it. My host has a PEAR installer (I'm not familiar with how PEAR really works yet). However, the version that they have is phpUnit2 which is apparently related to phpUnit (https://github.com/sebastianbergmann/phpunit/). But that is all I can really find.
According to the above link, the main way to install phpUnit is through PEAR :
http://www.phpunit.de/manual/current/en/installation.html
It requires that I change channels, however, it doesn't look like I have access to do that. Some are suggesting I can just copy the files up to my server and use them that way. Is that the best way for me to do this? Are there other settings I need to change (on my server) to make this work?
Any information is much appreciated.
If I'm understanding your question correctly, there's no need to use your host's version; the entire library is just a simple file. Go download it yourself from sourceforge, upload it to your server, and you should be off and running.
I doubt that you will find something like this because in order to unit test a system you need to have access to the code and a remote site isn't able to get that access (i.e. the ability to call functions built into your application).

Setup SVN/LAMP/Test Server/ on linux, where to start?

I have a ubuntu machine I have setup. I installed apache2 and php5 on it. I can access the web server from other machines on the network via http://linux-server. I have subversion installed on it. I also have vsftpd installed on it so I can ftp to it from another computer on the network.
Myself and other users currently use dreamweaver to checkin-checkout files directly from our live site to make changes.
I want the connect to the linux server from pc. make the changes on the test server until ready and then pushed to the live site. I want to use subversion also into this workflow as well. but not sure what the best workflow is or how to set this up.
I have no experience with linux, svn, or even using a test server, the checkin/out we are currently doing is the way I have always done it.
I have hit many snags already just getting what I have setup because of my lack of knowledge in the area. Dreamweaver 5 has integration with subversion but I can't figure out how to get it to work.
I want to setup and create the best workflow possible.
I dont expect anyone to be able to give me an answer that will enlighten me enough to know everthing I need to know to do what I want to do (altough if possible that would be great) instead I am looking for maybe a knowledge path like answer. Like a general outline of what I need to do accompanied with links to learn how to do it. like read this book to learn linux, then read this article to learn svn, etc., then you should know what to do. I would be happy just getting it all setup, but I would like to know what I am actually doing while setting it up too.
I'm sure you've solved your issue by now, but for future reference to other users, here's the steps I would suggest to get started:
Create a repository for your project (in Ubuntu)
Host the SVN repo using Apache
I'd read up on the subversion book to look at some strategies for development with SVN.
To connect to your SVN machine, you'll need to use it's IP or hostname instead of your svn live site you mentioned. With proper forwarding, it's easy to access it from anywhere.

How to manage eclipse project on remote computer; ssh, ftp?

Usually I'm creating project work space on my localhost (win). As soon as my code is tested I'm committing it into repository.
But some days ago I've faced a little difficulty. My customer want me to write code right on his server because he have some handmade binaries working only on his machine (solaris). I really don't know what to do. I've tried Eclipse plugin for connecting to remote servers, but I'm still unable to create remote project.
Any ideas?
PS: Sorry for my English :)
Thank you.
You don't really need a plugin to accomplish your goal. The following tutorial is aimed at Zend Studio, but I believe the information is generic enough that you can use it with just Eclipse: http://kb.zend.com/index.php?View=entry&EntryID=414

Categories