Workaround to install composer on single shared hosting in hostinger - composer-php

Without understanding that I needed SSH Access to deploy my Laravel 8 project smoothly, I purchased the Single Shared Hosting tier from Hostinger which does not offer SSH Access. I have to install Composer, but most of the tutorials I have seen requires the use of SSH in doing so.
Deploying the project has to be done before tomorrow morning and I still have no idea what to do next. I am new to this.

Follow these steps:
Try to match the PHP version of the server and localhost.
Install composer locally. This will generate all library files inside the project. You can check the 'vendor' folder.
Upload the whole project folder to the server filesystem.

Related

How to update the code of Laravel that is deployed on live server?

The Laravel project made based on vuejs UI is deployed on the server. Now I need to change the code and worked fine on the local machine. But the problem arose that I have to zip all the files and again upload. This seemed tedious. Also when I uploaded it, the application seemed not changed as on the local machine. What should I do? I also don't have a node installed on my Cpanel so that I was unable to run npm run dev.
The preferred way is to use a Version Control System (VCS) like Git.
VCS
Version control systems are software tools that help software teams manage changes to source code over time. Consider uploading your project to a Github repository.
If you Google this, you’ll find tutorials that can explain it much better than we can in an answer here.
Note: You require SSH access to the server in order to run Git commands. Having SSH access will also solve your problem of not being able to run commands like npm run dev. Consider deploying your repository on a Virtual Private Server (VPS).
(S)FTP
There are several ways of deploying. One of them being, manually transferring files using SFTP or FTP. However, as you've mentioned, this is a tedious process.

Adding laravel to an existing project that already runs with laravel on the web

Im very new to laravel and ive a project on a server that uses laravel.
How can i download this project and run laravel to it ? I managed to run laravel but it creates a whole new folder etc.
when i tried coppying the project folder to the laravel-created folder i got an error.
Download source code except vendor casus it's extra. Install php and composer. Then use a terminal(cmd in windows) and go to your project and run composer install. Wait till downloading packages complete. For running project type php artisan serve and your project is up. If your project had migrations and I think it has actually, run php artisan migrate before running serve command. Also check .env file in the root of project and change database credentials with your own. Depending on what dbms that project uses, you should install that DBMS too. Good luck
Taking reference to your comment:
i have the source code of a project that runs on laravel. Basicaly i am asking how can i run this source code localy on my pc
Good, that you have a project that runs on Laravel. You should probably consider to move your project to a central place, maybe Github, and from there create a proper workflow for development and further deployment to your (testing, production, ...) systems.
Even if you develop alone it would be a good practice to use git and Github - no, it is not the same
To come back to your original question:
How can i download this project and run laravel to it ? I managed to run laravel but it creates a whole new folder etc.
You don't need to install a new Laravel into an existing Laravel project. Just take the existing one.

How to run Scala project on local Apache - Windows

I received a Scala project to be run locally.
I'm on Windows, I've installed MySql (needed by the project), Apache 2.4 configured and started on port 9000 as suggested on Play Framework website, installed sbt and scala.
Now.. I got lost.. I don't understand how am I supposed to publish/deploy the project locally?
Which directory is supposed to be the www Apache directory?
How am I supposed to tell sbt that I'm running Apache?
I cant find any hint around.
Any structured suggestion to help my nut crawling on a bit?
Thank you!
Not sure if that would be helpful, but you've mentioned play framework. If your project is made with play, you should be able just to execute sbt run in your project directory, and then your application should be accessible via http://localhost:9000.
Details here: https://www.playframework.com/getting-started

Laravel, Composer, Git workflow

I am new to Laravel, Laravel Homestead, Composer, and the development workflow associated with commiting changes to a Git repository and then pulling those changes to a development/production server. So far after much trial and error, I have managed to:
Set up my local Homestead environment with vagrant.
Create a new Laravel application
Run Composer to fetch dependencies
Access the application locally.
Create a Git repository for my application, commit changes, and push to an origin master branch.
Clone the repository on my remote server (shared hosting on 1and1) and pull the changes in.
For a long time, I couldn't understand why when I pulled the changes to the remote site, I would get PHP errors, but the local site ran just fine. It came down to the fact that the Laravel .gitignore file was ignoring the /vendor directory, which Laravel requires to function. Some Google-fu searches indicate that some people simply run composer update / (composer install ?) on their production servers. (I don't have access to Composer on my shared hosting server, so I am unable to do this)
My question to the community - what do you feel is the best workflow for my given situation? remove the /vendor directory from the .gitignore file? Something else?
Replies are much appreciated.
It looks like you are using GIT as a deployment tool which I dont think is a good idea.
Composer update/install is just for managing dependecies. Some servers dont allow you to run scripts from console or running them is complicated. In this situation you can run composer locally before deployment and send your code to server with all dependencies.
Here are some things that you should keep in mind when designing your workflow:
Use GIT to keep source code and configurations
Use composer to manage dependecies (downloaded dependencies should't be under version control in your GIT repository. Vendor directory and its contetnt is a dependency too)
For deployment use one of deployment tools eg. https://github.com/rocketeers/rocketeer
use the -f flag to forcefully include the vendor directory while using git add.
You are on the right track here, and many will do what you are doing.
The real trouble comes when you are doing multiple server deployments (load balanced, auto-scaling).
Typically what I've seen is a shell script that you would include and run whenever something happens that would require these commands to be run.
Inside of this shell script would be the commands that you want completed every time a new server instance is booted up.
You can do this with a number of tools for a single server environment as well.
I might look into continuous integration tools like Travis CI, Jenkins, etc. If this is a major headache of yours.
Otherwise, it might be overkill.... then just keep doing what you are doing.
adding the vendor directory to your git repo is against best practices.
This is also a decent option involving webhooks:
http://losstopschade.de/post/96967373358
Look at Deploy Laravel Webapp to 1and1

Twitter Bootstrap on Symfony2 with NetBeans (Windows)

When I create a new project with NetBeans, I choose a PHP project and a PHP Application
As sources folder, I choose C:\xampp\htdocs\X and I run as Local Web Site (running on local web server) and as Project Url there is automatically "http:// localhost /X/".
So I go on X->Symfony2->Run Command and I generate a bundle who I call, for example, "xHelloWorldBundle".
When I go on "RUN", opens the page http:// localhost /X/, so Index of/X.
Now, I want to install Twitter Bootstrap because I want to create a Landing Page.
How to install Twitter Bootstrap for Symfony2 on NetBeans?
First of all install composer (it's the package manager symfony sugests)
composer installation on windows
Then install the symfony2 framework with composer (it's the recommended way by symfony) and I find it personally a better way then the netbeans installation of symfony2!
Install symfony2 with composer
There a few bundles that help integrate twitter bootstrap in symfony
MopaBootstrapBundle -- Installation guide
BraincraftedBootstrapBundle -- Installation guide
As an extra tool you could use (as mentioned above) Bower. This is an assets manager for your js, css,...
Here is a guide to integrate bower in symfony2
I think the tools/bundles should help you to start project with symfony2 and twitter bootstrap!

Resources