Issue Deploying with Laravel Forge - laravel-4

I am trying to deploy a Laravel PHP Project with Laravel Forge. I have connected to my repository on github correctly. However, when I hit deploy, if I go to the public IP for the site, I just see:
"No input file specified."
on the page.
I do not know why it is exhibiting this behavior.
If I go to the latest deployment log, I see:
/home/forge/.forge/provision-433327.sh: line 1: cd: /home/forge/default/laravel: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
Composer could not find a composer.json file in /home/forge
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
Could not open input file: artisan
However, I do have a composer.json file in my laravel folder....
Any ideas? Thank you in advance.

It looks like the /home/forge/default/laravel directory doesn't exist. Could you ssh in and verify that the directory exists?
These are the commands that the default forge deploy script runs:
cd /home/forge/default
git pull origin master
composer install
php artisan migrate --force
It looks like your deploy script is navigating to /home/forge/default/laravel instead.

Related

DigitOcean - laravel 8 deployment through Github (error 500)

I deployed the laravel app to digitalocean:
but I don't understand why is it showing error 500??
I connected a github repo to deploy it to digitalocean.
1- I set the build commands to: composer install
2- environment variables are set: APP_NAME, APP_URL, APP_KEY, DATABASE_URL, APP_DEBUG
This is how the repo looks (private)
What seems to be the issue??
I just did check the repo and it seems the vendors folder not there and your build steps look like a typo issue so please run below command
composer install
Still you face the issue then refer the laravel logs for that what went wrong
you also dont have a .env file
maybe copy the .env.example to .env
perhaps follow the instructions on the laravel site for the version you are using.
in your question, you have spelt 'install' incorrectly
turns out there were typos of lower and upper cases in controllers according to the laravel log.
I fixed them and now the site is running. It's weird that these typos didn't trigger erorrs locally..
All You have to do is configure the .env file if u have a .example.env edit the file to .env if u dont have it just try to create one or clone one from another project and do composer install but don't forget to generate a key with php artisan key:generate in the end

Laravel Nova installation via composer fails on production server

I have added Laravel Nova to our application and purchased a license. On the local server everything works perfectly. However, when I try to deploy the updated application to our linux server and run composer update it says:
Failed to download laravel/nova from dist: /var/www/{myPath} does not exist and could not be created.
Now trying to download from source
Syncing laravel/nova (3.29.0) into cache
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new It will be stored in "/var/www/{myPath}"
So I created a GitHub Token and added the Laravel Nova credentials to the auth.json file on the server too. Everything should be correct and it is working on the local copy as I said before. However, I am getting the following errors:
[RuntimeException]
Failed to execute git clone --mirror -- 'git#github.com:laravel/nova.git' '/var/www/{myPath}/.cache/composer/vcs/git-github.com-laravel-nova.git/'
Cloning into bare repository '/var/www/{myPath}/.cache/composer/vcs/git-github.com-laravel-nova.git'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
How could I solve this problem?
Deleting the /vendor directory and the composer.lock file and running composer install --optimize-autoloader --no-devsolved the problem.
I had a similar problem and finally figured out the cause and its due to the laravel/nova:3.29. A minor upgrade to 3.30 fixed the issue for me without having to delete the whole composer.lock file as it will update some other packages as well.
Create file at root directory with name "auth.json"
copy your nova credentials to it
{
"http-basic": {
"nova.laravel.com": {
"username": "email",
"password": "passsword"
}
}
}
composer update

How to run a Laravel project that is downloaded from a cPanel?

SOLVED: My machine didn't have MySQL installed and was having a hard time installing it and I still do.
I recently downloaded a Laravel project from cPanel and I wish to work on it. But when I try to run the project I get "500 server error".
After searching on Google, I tried the following steps
composer update --no-scripts
php artisan key:generate
php artisan migrate
This does not seem to be doing anything. How do I run the project on my local machine that I downloaded from the cPanel?
You may want to see what that error is in the log file:
Log file location:
/storage/logs/laravel.log`
The laravel.log file mentioned above may have a date with it on the name.
The 500 error is because the stack trace is turned off in the .env file with APP_DEBUG=falsewhich may be by design since it's on a live server.
Download the files in "public_html" folder and project folder(in my case it is "LMS" folder - refer screenshot).
Export the database from phpmyadmin in cPanel which is used in Laravel project
Go inside the Project folder(in my case LMS folder) and delete all the content inside the "public" folder. Then you will have an empty public folder inside your project folder(LMS folder)
Now copy and paste all the content inside "public_html" folder that is downloaded from cPanel into the previously emptied "public" folder inside the project folder(LMS)
Import the exported database to locally created database
Change following lines in index.php file which is inside the local "public" folder
These two lines
require __DIR__.'/../LMS/vendor/autoload.php';
$app = require_once __DIR__.'/../LMS/bootstrap/app.php';
into these two
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
Notice that we have removed the "LMS" in the paths
Go to the .env file in the project root and change these settings that matches to your local environment
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=lms_trends_new
DB_USERNAME=root
DB_PASSWORD=root
//Only for MAMP users
DB_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock
Run following commands
$ php artisan config:cache
$ composer dump-autoload
Finally run your project with following command
php artisan serve
First , Download the database from cpanel which is used in laravel project .
Then follow any one step below .
Upload the database in your localhost mysql .
then Change your env files as per your local system .
Install composer using following command .
composer install
Then update the compsoser From your composer.json file .
Composer update
composer dump-autoload
Now run php artisan serve
If you find any difficult in the first step , follow the second one.
Install new laravel project using following command .
`composer global require laravel/installer`
Create new project Laravel
`laravel new projectname`
Then just copy paste the directories app/ , Resources, /Public , /config .
Do not touch anything inside config/config.php
Just change the database name and username, password in .env file ..
Then run
php artisan serve
If you still cant able to do it , comment here

Deploying Laravel 4 on shared hosting server (hostgator)

I would appreciate your help. I really don't know where else to turn to. I can't deploy a L4 app to Hostgator. I read the guide on the forums, but my shared HG account already has many apps under public_html so deleting it would be catastrophic and a risk I cannot afford to play with.
Is there a way to deploy L4 app like any other normal apps?
What I am trying to do is the following:
home/myuser/public_html/domain.com/laravel/ <--- where the app should live
home/myuser/public_html/domain.com/laravel/dev <--- dev environment
in both of these folders there is a separate git repository (via ssh). with remotes dev and prod
so what I simply want to achieve is:
git push prod
and
git push dev
but when I push, I am getting a message:
dev/bootstrap/../vendor/autoload.php) [function.require]: failed to open stream: No such file or directory
/dev/bootstrap/../vendor/autoload.php' (include_path='.:/opt/php53/lib/php') in
Turns out I had not installed Composer properly.
I solved this by:
adding alias to php 5.3 in .bashrc:
alias php53='/opt/php53/bin/php'
installing Composer:
curl -sS https://getcomposer.org/installer | php53
in composer.json, in the "scripts" replacing php with: /opt/php53/bin/php (alias is not accepted, do not know why)
running
php53 composer.phar install
adding to .htaccess:
AddType application/x-httpd-php53 .php
I created a repository to simplify the installation process(mostly for future visitors) after struggling with it several times.
You can find the repository at https://github.com/ralphowino/laravel-for-hostgator-users or download it via https://github.com/ralphowino/laravel-for-hostgator-users/archive/master.zip

Error while creating migrations table with laravel: "No such file or directory"

When trying to run php artisan migrate:make create_users_table I get the following output in Windows CMD:
{"error":{"type":"ErrorException","message":"require(C:\...\\localhost
\\sites\\makeitsnappy\\app\/filters.php): failed to open stream: No such file or
directory","file":"C:\\...\localhost\\sites\\makeitsnappy\\app\\start
\\global.php","line":83}}
I'm running Windows 8. Laravel 4 and installed Composer, also ran composer update in the project folder. Same error happens.
Edit: Loading the application webpage, I get:
require(C:\.../localhost\sites\makeitsnappy\app/filters.php): failed to open stream: No such file or directory
Also, there is no filter.php file.
How can I fix this problem?
Since Laravel4 the routes and filters are in two different files: routes.php and filters.php not like in Laravel3 where both lay in the same file.
Check if there is a filter.php file in you app/ folder.
The error occurs because the autoloader tries to load this file on application's startup to get the filters for the called route or global filters.
Running composer update won't help here because you only get the framework and it's dependencies via composer and it doesn't update your app/ folder.
did you do composer install? It downloads some important files. I think you missed this command!
composer install

Resources