Uploading a Symfony 3.3 project - php

I finished my symfony project, and bought a hosting and domain. Previously I have uplaoded sites to web, but it was just put everything in public_html folder, and the site is running. I tryed this with the project, but it wasn's the case. I'm a bit confused, because at the my storage I had a lot of folders on default. This is how it looks:
Where should I upload my folders?

Uploading symfony is a little tricky thing , symfony is not a normal website it's a big framework
First you need hosting with ssh access ( without it you'll have a lot more problems )
create folder symfony on the same level that is public_html
copy all your project data , without vendor directory and composer.lock file
login via ssh and
cd symfony
composer install
You shoud always use composer - because it 'll check all dependencies with you php version on server (different libs and extensions may require different php version and diffent modules) , and let you know if something will be not right.
rm public_html folder, and create symlink to symfony/web
ln -s public_html ~/symfony/web
upload sql to database

Related

how to install dependencies of a Laravel project?

I am very new to Laravel, I have got to work on an existing project that is located on a server. I am able to access the source code through the FileZilla. The size of the whole project on the server is more than 6 GB. I know that I shouldn't download the whole project but the main folder and run composer install command to install all the dependencies specified in the vendor/composer folder. but I am not able to figure out the structure of the project and which part I need to download in order to run the composer install command and get the project running locally on my machine. Below is the project structure on the server.
I can right-click on a node and select download. which folder is the main project? that I assume it should only has the main files and the composer.json file where all deps are specified in it?
you may need to download the whole project, since there are Controllers, Migrations, resources, etc.

Which folders/files must be copied to the shared hosting server when you want to deploy a Per-Project Homestead Laravel 5.5 application

I want to deploy my Laravel project which has a Per-project Homestead inside it (not the global homestead). Some Vagrant and all Homestead files are included inside my Laravel project. This is the first time I'm deploying a Laravel application, and I really cannot find any information about files and folders that may be excluded from the deployment (Especially for a project with a per-project Homestead inside it).
I guess, .vagrant, tests, .env.example, .gitattributes, .gitignore, after.sh, aliases, Homestead.yaml, phpunit.xml, readme.md, and Vagrantfile files and folders may be excluded. Am I right? And what about the vendor folder (There are some Vagrant, Homestead files inside, as well, like e.g. homestead, homestead.bat inside the vendor/bin folder, or the whole homestead folder inside vendor/laravel).
Ideally, you would use a VPS or deployment server like DigitalOcean. However, as you stated you are using a shared server, the directories/files you will need to upload to the root directory of your server account are:
app/*
bootstrap/*
config/*
database/*
public_html/*
resources/*
routes/*
storage/*
vendor/*
.env
The remaining .files are for dependency management and development tests, and since you likely won't be using any build processes or Continuous Integration on a shared server, you won't need them.
Note: make sure these are in the root directory and the only publicly accessible directory is public_html. By default, shared hosting servers already have this restriction. Uploading the Laravel project as you have it will overwrite the website's current public_html directory, so make sure to back up anything you may have there currently.
Update
Frameworks like Laravel are designed to use root/command-line access to assist with deployment and server management. This is the advantage of frameworks. Shared servers do not typically allow users root access, so you end up having issues like yours, where deployment is a manual upload instead of a CLI command through version control.
vendor contains all of the dependencies your app is relying on to operate (Eloquent, Doctrine, Flysystem, etc.), so it won't work without the vendor directory.
You should deploy from version control, and by default that should exclude .vagrant and Homestead.yaml everything else is safe to leave in.

Git Clone Laravel Website just displays files and directories

I'm still really new to Git version control and Laravel. But I have gotten so far, and I'm not sure now where I am going wrong.
I set up VirtualBox and Vagrant on my local windows machine and installed homestead successfully. I have managed to get my Laravel website (it's only one page at the moment as I learn things) working correctly, it displays the header and the footer and the images load and everything. So that's all good.
So now, I have my Laravel website set up within my virtual vagrant server. On this server, the directory for my website is:
/home/vagrant/Code/sites/public_html
No when I cd to that directory, I ran the following:
git init
get remote add origin https://user#repo/user/publichtml.git
git add *
git commit -m "Initial Commit"
git push -u origin master
(I've substituted user#repo instead of the real URL)
All went through successfully. Great. So now on my live server I ran the following:
cd /home/sites/public_html
git init
git clone https://user#repo/user/publichtml.git
Which again, worked fine. It downloaded all the files into the public_html directory which is great. So then I go to visit the website and this is what I get:
The only explanation for this happening is maybe I need to install something on the server before I clone these files to it. I guess the files in the Laravel folder won't run by themselves? Do I need to install composer and laravel on the server or something? If so, how do I do that, and why don't they run on their own?
I cannot see a .htaccess or index.php in the root directory so I am not sure how it runs anyway.
You should install Laravel using composer instead.
composer create-project laravel/laravel mysite
You should also point the document root on your web server to laravels "/public" folder, making the framework code reside outside of the document root. That's good for security (no one can access any framework code, like your configs etc directly).
You will then find the .htaccess-file in the /public folder.
Please read the Laravel documentation about the different but recommended ways to install Laravel.
Btw, doesn't homestead use Nginx instead of Apache? In that case, .htaccess isn't even used. Please refer to the Laravel documentation again regarding homestead.
You need to redirect traffic to public/index.php instructions for this are webserver dependent.

Getting white page after uploading my Laravel 5.2 application to server

I've already installed composer on the production application. I've set permissions on the storage folder (775, 777). The web server is configured to look for index.php. That's the first time I try to deploy a Laravel application. Something that messed me up was that after I used the push command to upload my Laravel application using git I looked inside the Laravel storage folder in the server and I realized that the storage folder had basically only the directory structure of the storage folder of my local Laravel application, many files were missing like laravel.log among others. I assumed that it was because I didn't ran composer install on the server. After running composer install things continued the same.

Projects got affected while installing laravel

While installing laravel through terminal command, my other projects in MAMP htdocs folder got affected and they are not working.
I followed this process for installing laravel
Those directions have you symlink the "htdocs" directory to your laravel install, effectively making your htdocs directly useful only for Laravel.
You should avoid this, perhaps by creating a symlink from your laravel build to a directory within htdocs. For example, linking to a directory in htdocs called "mylaravelapp": ln -s /path/to/laravel-master /path/to/htdocs/mylaravelapp.
Lastly, consider using Vagrant or another virtual machine provider instead of MAMP for a server. You'll have to get through a learning curve (potentially), but you'll end up better for it. This creates a virtual server for you, which won't interact with any other parts of your Mac (YOu can make a server per project!).
Here is a guide to get started with Laravel 4 and Vagrant.

Categories