Rectangle 27 0

php Setting up a Laravel 4 app on a VPS?

"Remote server" is just a generic term - it can be of any type: shared, VPS, dedicated, cloud.

For some reason I didn't see the last two paragraphs of your initial answer. Basically all I am trying to do is run this app at a company who has two buildings with a mile distance between. They already have a server running between the two buildings. They have been testing the app over the past week on a Mac and accessing it via wifi by going to the-macs-name.local. They are wondering if I can connect it to both buildings. Is a vps the correct Route? or is there a more simple way to accomplish this task?

If you have a machine on the LAN and you can refer to it via a DNS name, then a VPS would be an unnecessary expense. I wouldn't run it via wifi though: do you have a proper wired WAN between both buildings?

My feeling is that a shared host would be easier for you as a beginner - is the Node.js component of your app critical? Running your own VPS is not difficult, but there is quite a bit to learn. Your distro (such as Ubuntu) would be ready-installed, and on top of that you would use the package system (something like apt-get) to install Apache, PHP, PHP modules, phpMyAdmin, git, and whatever else you need.

So, the short answer is: if it works locally, copy it up to the remote host, and it should work there. Make sure you've set up your config system in your app so that it can cope with the different settings you need in local/remote environments, such as database connection settings.

This does make since. and Yes I am using node for live updating content. However, what is the difference between a VPS and a remote server? and when you say that Laravel has everything I need, WHat about the MySql database? The VPS I am looking at has a Lampstack template. Is lampstack what I am lookingfor? it says it come with mysql and apache

Yes, you can certainly deploy using Git. One way to do this is to create bare repositories on your server in a private place, set it up as a remote in your local dev machine, and push to it as your off-site copy. Then, from your dev or production web folders, pull and update submodules. This is not trivial, and requires at least a working knowledge of Git - so presently I wouldn't recommend this route.

You didn't mention MySQL in your question, but if you need that, then it would need to be explicitly installed, yes. It's usually quite easy - install the server, the console client, and the PHP modules - one command each. I've not heard of a "Lampstack template" but it does sound ideal - probably saves you installing a good few things.

You don't need install Laravel separately from the app it is part of - these days a PHP app just contains everything it needs in its vendor folder. How to deploy depends on how you have arranged your dependencies locally, but the simplest way is to copy everything in your local project to your remote server (FTP or rsync). I don't think Laravel demands a VPS, but if you are using Node as well, then yes you will.