Getting white page after uploading my Laravel 5.2 application to server - php

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.

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.

Uploading a Symfony 3.3 project

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

Following services are not running: proxy # AWS -- after Laravel re-config

I have Laravel application which I learned to run both with php artisan serve and with local Apache.
Now I wish to run the same on Amazon Beanstalk.
I have created Beanstalk instance for PHP7. Then I went to Amazon Linux console and installed composer there. I think this was unneeded step.
Next I acrhived all my Laravel project with ZIP and uploaded it to AWS with web console. First I got Forbidden error
as said here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-laravel-tutorial.html
Then I fixed document root to public/ as said below and now I have health state severe saying
Impaired services on all instances.
Following services are not running: proxy.
When I am opening site with browser, I see blank page.
How to see any logs in AWS to understand what is happening?
What cen be a reason? Project is self-contained, it uses SQLite database inside the codebase. When I was enabling this project on local machine, I was to enable multiple things in Apache and PHP.
It was the problem with ZIP file structure: it contained extra top directory inside. So, on AWS it was /var/app/current/myappname while should be just /var/app/current.
Did you install mbstring after creating the instance?
sudo yum install php70w-mbstring
If this isn't the problem, you can view Laravel log in storage/log/laravel.log and tell us what is there to help you.
I was getting this error due to Elastic Beanstalk config settings being incorrect, specifically, the Document root was incorrect and was seeing the Following services are not running: proxy. error in the event log.
When generating the ZIP archive, be sure to generate it within the project folder. So when you open the zip file, you have the app folder, not another folder with the project name.

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