I see a lot of online guides and even the official Laravel documentation saying that Laravel Octane should run with supervisor even inside a Docker container.
Is there any reason not to simply run php artisan octane:start as an entry point and use docker-compose to restart on failure?
Is there anything I am missing here because this way seems to tap into what is already possible with Docker Compose and avoid introducing another component in my setup.
Related
I'm using Buddy Works to deploy my project to a server.
When creating a pipeline to deploy my Laravel project, I'm asked to enter deployment actions; this is where I'm stuck.
So far, I have set it to run the following composer commands:
composer validate
composer install
Because this is usually what I do when running my project locally. But I understand that I also need to run Apache and such (I use WAMP so it sorts all that for me).
I've searched on Google and all I got was composer install. Is this all I need to do or is there more?
Prior to using deployment tools, I used to upload files directly to the server, so CI/CD or other DevOps duties are very new to me.
It's good idea to reload php as well as migrate new tables :)
composer install --no-interaction --prefer-dist --optimize-autoloader
echo "" | sudo -S service php7.3-fpm reload
php artisan migrate --force
If you're using DigitalOcean and you have $12 to spare you could use ready tools such as Laravel Forge :)
I've been trying to set up my CI environment on AppVeyor since I need SQL Server. I can't seem to get laravel dusk working with it. I've managed to
Install PHP
Setup SQL Server 2012
Install Composer and all the packages
Install all my npm packages
Install the PDO SQLSRV drivers
and run a small script to create the .env file for testing but when I finally run
php artisan dusk
there's like 4 errors and 1 failure out of my 5 assertions
Here's an image of the tests failing: https://i.gyazo.com/98f3bc4ae979793eb4af62e97d90080d.png
The tests work on my local machine and I'm trying to automate it. I have no idea how to access my app while it's being tested so I've just put a localhost in the APP_URL of my environment configuration file(Laravel specific).
I'm trying to figure out how to get browser testing working on it. I've also installed chrome for chromedriver to be used in Dusk. Any help would be appreciated
I'm trying Spark and, after install it, I have two problems:
1.- When I try 'Log in' and 'Register' buttons, I get this. It is like if my web page with no style. Any idea what I am doing wrong?
2.- On the other hand, I'm following the Quickstart guide and I'm trying this:
"Once Spark is installed, make sure the NPM dependencies have been
installed via the npm install command, the gulp command has been
executed, and the database migrations have ran."
I'm running npm install in my Terminal and I'm getting this: -bash: npm: command not found.
I did some things with Laravel more than one year ago, and it was with no Homestead. Probably I'm doing something wrong... I'm pretty confusing.
Any help would be really appreciated! :)
You will need to install node and npm:
https://docs.npmjs.com/getting-started/installing-node
Once node is up and running you should be able to run "gulp" from within your application's main folder. This will generate (among other things) the CSS that you're currently missing.
I'm trying to fully understand the Laravel (5.1) artisan optimize command and best practices, but the documentation seems lacking. I don't have Composer installed on the production server so, specifically, I want to know what files are modified or created when running artisan optimize --force on development that must get pushed to production. The goal being not to blow up the app in production! After running the command, I see the following files have been modified:
\bootstrap\cache\compiled.php
\vendor\composer\ - the entire directory
\vendor\autoload.php
Am I overthinking this, or do I just push these files to production and I'm good to go? Also, what is the best practice regarding when to run artisan optimize? Each time a new model is created? What about controllers, routes and helper classes?
Lastly, I see the \bootstrap\cache\compiled.php file is a whopping 548KB and almost 17K lines! Is that really considered optimal?
[edit - As #crishoj says, as of Laravel 5.5, php artisan optimize is no longer needed]
Normal Laravel practice is to have composer installed on your production server.
These are the steps Envoyer (made by Laravel's creator) takes to deploy an app on production -- I've annotated them below:
# Install application dependencies, such as the Laravel framework itself.
#
# If you run composer update in development and commit the `composer.lock`
# file to your repository, then `composer install` will install the exact
# same versions in production.
composer install --no-interaction
# Clear the old boostrap/cache/compiled.php
php artisan clear-compiled
# Recreate boostrap/cache/compiled.php
php artisan optimize
# Migrate any database changes
php artisan migrate
As of Laravel 5.5, php artisan optimize is not longer required.
You can also take benefit of laravel packages to easily optimize your application by caching page partials
https://github.com/imanghafoori1/laravel-widgetize
I actually wanted to follow up on this question, but I guess It's better to start a new question.
I installed a fresh copy of my own laravel(5.0), and I tried running php artisan route:list, which works.
Now I have downloaded the compressed repository of a project I want to deploy on a shared hosting enviorment, but when I run php artisan route:list nothing happens.(No error message, nothing). Using this method for hosting the application
The actual problem is php artisan migrate, which also outputs nothing!
Is there a good method for troubleshooting this ?
Could you provide me we some points of failure that I can check ?
Worth mentioning:
I'm no Laravel developer and I have limited time reading up on it.
As LittleFinger suggested, it's possible that artisan is not actually yet installed. When deploying from a repo, Laravel's packages of which the entire framework core is composed, are not included. You should run composer install to install the packages. If you don't have composer installed that can be difficult on shared hosting, but it's usually possible to install it.
You will need to run composer install before you run composer update. Running composer update is not required, unless you want to update to the newest versions of your packages which are allowed by the rules in your composer.json file. This should be done with care in a production environment as new versions of packages could break your app.
Once you've installed the packages, you'll need to set your environment variables (database credentials etc.) by copying the .env.example file to .env and editing it. Once you've done this you'll be able to run php artisan key:generate to generate an encryption key.
After this, your app should work (assuming you've pointed a domain to the /public directory).
I am facing the same issue when I try to run
php artisan migrate or php artisan cache:clear
nothing happen just a blank screen no success no error see the screenshot
after debugging I found a message in error_log in root directory which says.
Fatal Error: Allowed Memory Size
after increasing the memory php artisan commands works fine