Skip to main content

Questions tagged [cli]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
18 views

How to get info about an asset via cli?

I have assets configured via azure blob storage and sometimes one of 2 issues is happening : 01. The asset url remains as /en/actions/assets/generate-transform?transformId=45 In this case i would ...
MRARGT's user avatar
  • 11
1 vote
1 answer
205 views

Run craft up command in deployment pipeline without prompts

I am deploying a Craft website with Bitbucket Pipelines. Basically what it does is spinning up a container that runs composer install and builds my CSS and JS with webpack. The vendor folder and js/...
Matthias's user avatar
  • 301
2 votes
1 answer
135 views

Resaving Matrix Blocks skips because of "not loading its content"

We recently updated one of our biggest projects to Craft 4. And today I tried to resave all the matrix block with resave/matrix-blocks but was greeted with the following behaviour: Does anybody have ...
Leonardo's user avatar
  • 471
1 vote
2 answers
184 views

How to programmatically enable Pro trial in Craft 4?

In Craft 3, I setup a base build for my team which had a bash script. At one point in the script I was able to enable a Craft Pro trial license like so: echo 'Craft::$app->setEdition(Craft::Pro)' | ...
Plum Duffer's user avatar
1 vote
1 answer
312 views

Broken site after upgrade via composer from craft 3.37.38

Ran upgrade on my local dev environment. Seemed to go fine. Front end site broke and command line updates for craft also error. My index.php looks like // Set path constants define('CRAFT_BASE_PATH', ...
joomkit's user avatar
  • 2,034
2 votes
2 answers
762 views

Recommended caches to clear after server deployments?

Craft has this article about deployment best practices: https://craftcms.com/knowledge-base/deployment-best-practices It also states that you might want to clear caches after deployments, which is of ...
Thijs Kaspers's user avatar
1 vote
1 answer
558 views

Update Search Index on Entry create and update

I have a multiselect drop-down for age group and I have set "Use this field’s values as search keywords" check box checked. when I create a new entry or update existing entry . we are not ...
Amar Chand Yadav's user avatar
2 votes
1 answer
888 views

How to run custom module controller actions from console?

I have built a custom module with some custom controller actions - some of which I would like to run via console, but I am not sure what the path/command should be for running these actions? In my ...
iamkeir's user avatar
  • 468
1 vote
1 answer
221 views

Update Craft to a specific release from the CLI

I know you can update to a specific release using the CLI, but I can not remember how to specify the version number in the update command! Thanks for any help.
Roi Agneta's user avatar
  • 1,463
3 votes
1 answer
138 views

How do you download multiple plugins vis Command Line?

Coming from Drupal, we often use drush to download modules (plugins) and install them. For example this is what we might do using drush: drush dl bootstrap mailchimp stripe-php This would download the ...
Adrian's user avatar
  • 437
2 votes
1 answer
1k views

Understanding migrations and CLI commands

Can someone please help explain some basics regarding migrations and the associated CLI commands to help troubleshoot when things fail? Specifically, How does craft know which migrations have been ...
Douglas McDonald's user avatar
1 vote
1 answer
358 views

Can't install plug-ins from CP

I can install plug-ins from the command line, but when I do so from within Craft, I get this: Composer was unable to install the updates. Error: Could not delete /var/www/craft-dev/vendor/yiisoft/yii2-...
4midori's user avatar
  • 656
1 vote
1 answer
171 views

Craft CLI ./craft - can I tell it to use a specific php version when running composer via the CLI?

With the Craft CLI, is there a way to set which php version to use? The context here is that the server runs PHP 5.4 for another project, but PHP 7.3 is installed at /usr/bin/php73 and is setup in ...
jpea's user avatar
  • 367
2 votes
1 answer
1k views

How do you install a plugin through the command line?

I would like to install and enable plugins through the command line in a way that can be scripted, and which replicates the same steps as are taken when you install a plugin through the Craft control ...
Mark Northrop's user avatar
1 vote
1 answer
312 views

Memory Upgrade Issues

Problem Hi all, I have been struggling with issuing the command ./craft gc. It shows the following Delete all trashed items? (yes|no) [no]:yes Running garbage collection ... PHP Fatal Error 'yii\base\...
Seraphim Jester's user avatar
2 votes
1 answer
456 views

Is it possible to execute ./craft via cron?

I'm trying to execute Craft 3.3.X CLI commands via cron. I can execute ./craft from ssh no problem, but the same type of commands triggered via cron do not execute. These command works via SSH: # cd ...
thisanimus's user avatar
2 votes
1 answer
367 views

How does the Craft CMS built-in web server works?

I just found this while using ./craft help in the Craft CMS command line utilities: - serve Runs the PHP built-in web server. serve/index (default) ...
Romain P.'s user avatar
  • 1,852
1 vote
1 answer
932 views

Allowed memory size of 1610612736 bytes exhausted when updating via CLI on OS X

This one has been bugging me for months. My development environment is running on MAMP on OS X. It's worked absolutely find for ages but for no reason that I can identify all my Craft sites now ...
neekster's user avatar
  • 403
3 votes
1 answer
2k views

When should I run queue/listen instead of queue/run?

Definitions from the documentation: queue/run: runs all the queued-up jobs queue/listen: listens to the queue and runs new jobs Example case: The runQueueAutomatically config option is set to false,...
Romain P.'s user avatar
  • 1,852
1 vote
0 answers
463 views

Auto trigger craft project-config/sync on deployment

So I have the following in my Composer file: "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-...
Terry Upton's user avatar
  • 1,894
1 vote
1 answer
80 views

Updates on live server without using Control Panel

I'll freely admit to being a bit of a newb when it comes to SSH but wanting to start utilizing it more for my Craft3 sites. Maybe this is an irrelevant question but is it possible to update craft on ...
Dr_Codswallop's user avatar
2 votes
1 answer
767 views

How to I set the location folder of Control Panel resources?

I'm trying to use the ./craft clear-caches/all CLI command. Everything is working fine, except that I always get this error: Error clearing cache Control Panel resources: Unable to clear Control ...
Romain P.'s user avatar
  • 1,852
5 votes
3 answers
5k views

"Craft isn't installed yet" error after updating to Craft 3.1

I just updated to Craft 3.1 and logged into the admin to make the required updates to the database and this all worked fine. However, when I use the new ./craft update CLI feature, it responds with "...
Jay's user avatar
  • 1,042
2 votes
1 answer
3k views

Clear template cache from the CLI?

I was looking for a way to clear the “template caches” and “compiled templates” from the CLI, as I want to automatically do this after every auto-deploy of the site I've created. For this I was ...
Bramus's user avatar
  • 133
1 vote
3 answers
1k views

How do I get past this MySQL error installing Craft 3 using CLI

I am using https://box.scotch.io/ (vagrant). I'm trying to install Craft 3 with the cli, but can't get past these errors: Connection refused No such file or directory One or the other error shows ...
Adam George's user avatar
10 votes
3 answers
2k views

Craft CLI RC1 Connectivity Issues with MAMP Pro

I've been trying to run the new Craft CLI for the last couple of versions without any success. I figured maybe since we weren't at RC1 yet that it wasn't fully working. After seeing Ryan's video about ...
Tim Knight's user avatar
  • 1,022
1 vote
1 answer
5k views

failed: could not find driver

Craft CMS 3 - I have used the CLI ./craft setup script to set the database connection on my local machine. I setup a MySQL connection, but when it attempts to validate my credentials, I get "failed: ...
codeandchips's user avatar
1 vote
0 answers
257 views

Class 'Craft\ErrorHandler' not found in YiiBase.php after new Thread-Safe PHP install

I've just upgraded PHP 7.0 on a standard Ubuntu Server 16.04 LTS distro from non-thread safe to thread safe (using Michel Phillipe Luca's instructions here: http://php.net/manual/de/pthreads....
Jonny Asmar's user avatar
2 votes
1 answer
664 views

How do I configure multiple environments for console commands?

I have built a plugin with some console commands for automating some regular tasks that will be run by a cron job for my site. In order to get the commands working, I had to replicate my database ...
Jeremy Gimbel's user avatar