Laravel Deployment - php

I have a working Laravel application on my desktop. I am trying to deploy it to a godaddy server. The application has been copied and verified on the server in the same structure format as on my desktop. I have changed the database information in the config to the proper entries. When I run from the server I get the error:
FatalErrorException
Class 'name of the class' not found.
The error is generated in the Routes.php file.
Again this app works locally, any idea why it errors when deployed?

Assuming you have a VPS server running Apache (or whatever else) with a a properly configured vhost and terminal (ssh) access, if you want deploy a Laravel app there, you surely need to
Copy all project files, except for the vendor directory, from localhost to your server
Verify file ownage and access rights (chown/chmod)
Change all necessary config
run a composer update
run php artisan migrate to create the database scheme
clear cache php artisan cache:clear
Next thing is populating the database with your apps data from localhost. You can either do it manually (dump sql local, import it on server), or if you want Laravel for it you can use Seeding (Laravel docs).
There even is a nice package that let's you automaticaly generete Seeders from your current database content - so it's very useful for the purpose of moving the app to another server.
https://github.com/orangehill/iseed
Inverse seed generator (iSeed) is a Laravel 4 package that provides a
method to generate a new seed file based on data from the existing
database table.
EDIT
If you are using a shared hosting account, check out this guide
http://driesvints.com/blog/laravel-4-on-a-shared-host
This post from Laravel forum might also be of use
http://forums.laravel.io/viewtopic.php?id=9639

Related

How do I run laravel migrations directly to live database on my local machine or on cpanel

I was passed a laravel backend project that's already on cpanel, both the MySql database and the laravel project itself is already live on phpmyadmin.
I did some modifications on the files on my local machine such as on the models and adding new columns and I'm trying to migrate the changes on the live database. How do I go about this without messing with the live database?
I tried using ssh but I get even more confused on the whole process.
I tried setting my env file to the live database config but when I run migration on my local machine laravel terminal I get a series of errors.
How can I get out of this situation?

How to setup Laravel application in AWS Elastic Beanstalk using external RDS database

I want to start deploying my laravel app to production. To avoid changing AWS config in the near future, I decided to try to add continuous integration. To do this I'm using elastic beanstalk and pushing the code there using another AWS tool. All this is working perfectly. I put a test message in /public/index.php to output "hello world" and it works as expected when going to the URL. When I remove this text and run my laravel app as normal, I get a 500 internal server error. I'm not sure all what elastic beanstalk does on deployment for laravel apps. Because of this I'm not sure if this error is occurring from a bad DB connection or laravel app not fully setup yet.
I created an RDS DB instance outside of elastic beanstalk. I am able to access this from sequel pro and I added the database I will use to store all my data. I added all the necessary db connection values (host, port, database, username, password) to /config/database.php and the elastic beanstalk server configuration environment variables.
I've searched online for days for info but haven't found anything specific to this. Also part of my issue is a lack of understanding of how laravel is setup during a deployment in beanstalk. Is there something with /.ebextensions that will help me accomplish these goals?
When I deploy my code I need to make sure all vendor files are installed through composer and then I also need to make sure all database migrations/changes happen. I want to automate as many steps as possible so I can just push up code changes and server will change code and keep working.
I also want to make sure there isn't anything I'm missing for setting up my db connection. Are there any other files in laravel I need to setup or something in elastic beanstalk I need to have configured? I'm keeping my db open to all connections and then I can tighten restrictions later
EDIT: My database may not be configured correctly yet, but that appers to not be source of the issue. I think my issue is knowing what scripts and how to run them during deployment. I want to make sure composer and php artisan migrate is ran to keep everything up to date. How can I do this with elastic beanstalk?
This is a little off topic but with my experience I do not recommend using beanstalk to achieve a good workflow pushing and deploying. I recommend
you to use Forgelaravel.com to deploy your GitHub repository. In forge Laravel you will be able to create a server from AWS and it will automatically create database connections and stuffs, then with just one click you can deploy to the server and keep a good workflow.
Given that we're speaking of a Laravel application, this 500 Server Error
often occurs when one is creating new infrastructure. Why? It's likely to forget to add the environment variables to the EB environment.
Simply go to that EB environment configuration, then under software modify to include at least the following environment properties
APP_DEBUG (can be, for example, false)
APP_KEY (this is the key generated with php artisan key:generate)
APP_NAME (tiagoPeres)
Then the issue will be gone.

Laravel Deploy Issue Shared Host

I am using hawkhost as my server
I successfully created a project and arrived to Laravel Page
Then I pushed the whole laravel respository with git, then I create a new folder in my server and git clone the respository. (respository no any change)
I cant access to Laravel Page, only the Error 500 shown
The reason I do this because I want to build the project in my local machine, then I push it and clone it in server. But I encounter having the same project One can access, another cant access
please check log file and share here to get help, however
Posibble Reason 1:
.env file not available because of gitignore (APP_KEY is needed)
Posibble Reason 2: Storage folder is not writable
Posibble Reason 3: Could be server issue!

Compiled file not created in shared hosting server Laravel 5.1

I am new in Laravel and I have some problem in Laravel 5.1. I work on a GoDaddy shared hosting server. When I create a new view and upload it to the server and try to access this page it shows a blank page.
After long time I found out that Laravel created a view file inside storage/framework/views/ with some encryption md5 name.
How to create this file. I have no ssh access to run php artisan serve and access and create runtime.
Please help me how can I create this view by using http://example.com/xxzxxzx

unable to deploy symfony project to a shared hosting web server

i am using Symfony 1.4, to create my project. i have tried to deploy project using the command and methods given in chapter-16 in symfony book. but i am not able to deploy my symfony project from my local computer to web server. Can i directly copy paste my symfony project to my web server?? will that work?? or is there any other method??
NOTE: i am using Propel as ORM.
Your best option is:
1. gzip up the entire project
2. export all the data from the database using something like mysqldump
3. upload the files to the server
4. import the database dump into your server database
5. unzip your project
A couple notes:
1. Due to the shared hosting environment, you may have security issues due to other hosts on the server gaining access to your php files See here.
2. Hopefully your host allows SSH access to your server account, administering a symfony project is MUCH easier when this is the case.
3. If you don't have SSH access to your account you will have to upload the files to the server without gzipping them and this takes a LONG time due to the number of files symfony creates.
4. If possible place all your symfony files except for the web folder outside the public_html folder.
When I have to deploy something I do this:
Check if the requirement (php5, mysql4 etc) on the production server matches my application.
Change the configuration files to reflect the production server.
Upload everything to the server using ftp.
Your question is cryptic, you should really specify what kind of error you are getting.

Categories