I have a Git repository on my local computer, that is cloned onto a shared server. On my local computer everything works fine, but on the shared server I have a blank page.
I see all the code in my FTP client and I get the git status:
On branch master
Your branch is up-to-date with 'origin/master'.
On my local computer I have the same message, so the source are up-to-date.
Now the strange thing: On my local computer I can see my website. But on my server it is just a blank page. How is this possible? Could this have something to do with the htaccess? The code should be exactly the same.
Technical information: Local computer is Mac OSX. Shared Server is Linux System. I have installed Symfony framework
You are using Symfony framework, but as it was said in comments on your shared server you don't have Composer to install dependencies.
The Symfony's .gitignore ignores the vendor/ directory because usually the dependencies during the deployment process by executing composer install.
In your case, if you haven't Composer on your shared server, you can copy/paste your vendor/ directory from your PC onto your server.
Do not forget to copy/paste it again when you update your dependencies.
The easier approach would be to have Composer on your server to execute composer install each time you push your project onto your server.
Related
I run a custom PHP site on a Managed VPS (LAMP stack) and am the solo developer, but want to start using GIT so freelancers can contribute. Currently I don't use GIT.
GIT
For GIT, I wanted to use Visual Studio Online (VSO) since I've used it before but am open to suggestions if it's better for the suggested deployment process.
Deployment
I kept a "Dev" folder and a "Live" folder on the web server and simply did all of my dev in the Dev folder, tested there, then ran rsync to push it to the Live folder. I couldn't easily run it locally since it has things like Linux symlinks, and I work on a Windows computer.
The Goal
I want to start adding GIT to this process, integrate that into a decent build process, and still use a Windows IDE for development. Though maybe I should install a Linux VM on my Windows machine so I can start running the site directly from pulling the latest version from GIT?
I need a setup that would be easy for other developers to join on as I find freelancers to help out.
Suggestions?
here's what I do for
Git deployment
For deployment, I follow a very-simple git-flow technique (http://nvie.com/posts/a-successful-git-branching-model/#the-main-branches) with 2 branches:
master for prod
dev for new features
You always develop new features on dev branch, so dev is always ahead of master in term of functionnalities.
When you want to deploy, you SSH on your server, you git pull dev branch, and if everything works fine, you git merge with master.
You can always switch on the prod server between prod and dev version with git branch master and git branch dev. No need of 2 folders, git handles this !
If you have a bug on prod environment, you can switch branch to master on your local computer and fix the bug. Then you upload it via ssh.
Multi collaborator development (developers with windows/linux/mac but 1 production server)
I personally use docker, it creates a single VM which you can customize to match your prod environment (linux version, apache version, php version and my sql version). You create 1 docker image, and then every collaborator can download this image and run it on his computer.
I just setup gitdeployment to my production server from my local machine following this tutorial
Now i am going to deploy a laravel project but i've few doubts.
1.In my laravel git repo vendors folders are excluded from the git so when i deploy the project with git to live server it doesn't worked because vendor folder is missing.
One solution to solve this problem is add vendor folder to the git buti don't think its a better practise.
My solution
After git deployment login to my live server and run the composer install command to add the vendors folder.
But its looks painful process suppose if a new package is added to my project (ie image intervention package) i need to repeat my step.
So is there any way to automatically manage vendors folder in live server
Is it possible to install symfony and all it's components on a server without internet connection?
I hope that I can download the required files and copy and install on the server.
I intend to create an application to run on the intranet of the company. I'm already using XAMPP and the PHP version is 5.3.8.
Thanks
Of course you can install symfony on a server with no internet connection. What you would need to do is have your project up and running with all the vendors already installed and then you would copy the project into your network share.
In other words:
Go to a computer with an internet connection
Run composer install so it will download all necessary dependencies
Copy the project to the machine with no internet access.
Make sure to clean your cache folder on the server (i.e rm -rf app/cache/{prod,dev,test})
And everything should be working just fine. I've done this in multiple cases when composer was not available on a shared hosting, which is pretty much the same as "not having internet". :)
I'm in a trouble trying to install phpBB on openshift.
I have created a php5.3 cartridge with PostgreSQL: I unpack phpbb on a folder of my app, I push the change, then I run the installation form the browser.
The forum installation is successful.
In the end I need to delete the "install" folder in order to enable the forum.
I tried it on my standalone wampp server and it works.
So I delete it in my repo, and I commit and push the change.
When the app restarts it automatically tries to go back to the installation: everything is broken.
It seems the push breaks the configuration on the server side.
I also have tried to change the name of the directory using ssh connection, and move the install directory name: this is uneffective.
What's the problem here?
The problem is that if you deploy the phpBB package as downloaded from official website app the files will go on app-deployments with are not persistent on git changes and can not be pull to local. You can try using the OpenShift quickdeply version of phpBB (https://github.com/openshift-quickstart/phpbb-example) that deploys the files to app-root/data (I think :S) and this reamins untouched on git changes.
The "install" folder is at app-root/runtime/repo/php
I am new to GitHub. I managed to install GitHub for Windows and created a github repository. I'm a PHP developer and this is my current situation before GitHub.
Currently, all of my work go to C:\xampp\Dropbox\* ("htdocs"). Everything I code is in there with each application under its own subdirectory. Whenever I need to update the production server, I FTP our production server and upload the necessary files. This is good when I am working alone but working with other developers would be hard because we need to know who edited which, when what was edited, etc.
Could you help explain how I can maintain my codes using GitHub? I suppose that I shouldn't make the entire htdocs as a local repository. I access my codes via http://localhost/ when testing it locally. Since I develop web applications using PHP, code changes regularly. We don't compile codes and I was used to simply saving all the files and letting Dropbox save all the versions I made.
It's a bit confusing what to do next since the GitHub for Windows application created local repositories in C:\Users\Admin\Documents\GitHub\test-app folder. Should I edit the code in htdocs and ALSO edit the code in My Documents\GitHub? Then also "push" the update to GitHub AND also update our production server via FTP?
So, to summarize, from the primitive perspective of web development, what steps must be changed so that I can enjoy the benefits of using version control systems such as GitHub?
Thank you!
The global idea is to use a versioning server to push code directly into your production server, bypassing FTP boring method.
You can tell GitHub application to clone your code at Xampp htdocs root, instead cloning it into your documents, if you have already initialized your repositories.
Every project must be a GitHub (or Git, more generally) repository.
So, you have to :
git init all your projects into your local server, at root of your project (so, not htdocs, but htdocs\<YOURPROJECT>
create repositories on GitHub for each of your projects
Follow GitHub instructions to initialize projects, git push on GitHub to finish.
You can do all that with a command line. In my opinion, it's easier.
Your code is on GitHub now. You won't have to edit your code into your documents AND htdocs if you initialize your repos in htdocs.
Next, it could be "fun" to install Git on your production server to grab most recent code from GitHub repository. Without Git, it's a pain in the a** to push code on a production server.
Now, when your local dev server and your production server are in sync, every time you will commit and push on GitHub, you can grab latest copy with a simple git pull on your production server.