Drupal 8 - Drupal 8 - News - Help - Tutorial - And more... https://drupal8.ovh/en en Squash commits into one with Git, Rebase https://drupal8.ovh/en/tutoriels/412/squash-commits-one-git <span class="field field--name-title field--type-string field--label-hidden">Squash commits into one with Git, Rebase</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 04/06/2021 - 11:02</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Steps:</p> <p>1. Update branche<br /><code>git reset --hard origin/features/BRANCHNAME<br /> OR<br /> git pull origin features/BRANCHNAME</code></p> <p>2. Rebase<br /> git rebase -i HEAD~N --rebase-merges<br /><code>git rebase -i HEAD~2 --rebase-merges<br /> OR<br /> git rebase -i COMMIT-NUMBER --rebase-merges</code></p> <p>3. Change pick by s (Squash) except first</p> <p>4. Comment unwanted comment texts</p> <p>5. Check rebase and push using --force</p> <p> </p> <p><strong><u>Rebase a branch: (Avoid if possible)</u></strong></p> <p>Example :<br /><code>git rebase origin/BRANCH-NAME  --rebase-merges</code></p> <p> </p> <p><u>Other commands:</u></p> <p><code>git rebase --continue</code></p> <p><code>git rebase --abort</code></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/git" hreflang="en">Git</a></li> </ul> </div> <div class="field field--name-field-related-contents field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><a href="/en/tutoriels/343/git-usage-2-cherry-pick-rebase" hreflang="en">Git Usage 2 - Cherry-pick, Rebase</a></div> <div class="field__item"><a href="/en/tutoriels/11/helpful-git-commands" hreflang="en">Helpful git commands</a></div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=412&amp;2=comment&amp;3=comment" token="ylgREJmWua4dG71o47RcAhs6Wb14xNX87xolS0arLts"></drupal-render-placeholder> </section> Tue, 06 Apr 2021 09:02:07 +0000 editor 412 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/412/squash-commits-one-git#comments Chocolatey packages installer https://drupal8.ovh/en/tutoriels/411/chocolatey-packages-installer <span class="field field--name-title field--type-string field--label-hidden">Chocolatey packages installer</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 04/06/2021 - 10:51</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Chocolatey is a software manager for Windows. Can use to install packages like php, tig, make</p> <p>Examples:</p> <p>Install php<br /><code>choco install php</code></p> <p>Install TIG<br /><code>choco install tig</code></p> <p>Site : https://chocolatey.org/install</p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/windows" hreflang="en">Windows</a></li> </ul> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=411&amp;2=comment&amp;3=comment" token="g0oEmheXRX1D3iWvm3XKDV53Tx0C_avnEcbOqa5wDTI"></drupal-render-placeholder> </section> Tue, 06 Apr 2021 08:51:44 +0000 editor 411 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/411/chocolatey-packages-installer#comments Convert M4A or OGG audio file in to MP3 on linux https://drupal8.ovh/en/tutoriels/410/convert-m4a-or-ogg-audio-file-mp3-linux <span class="field field--name-title field--type-string field--label-hidden">Convert M4A or OGG audio file in to MP3 on linux</span> <div class="clearfix text-formatted field field--name-field-question field--type-text-long field--label-above"> <div class="field__label">Question</div> <div class="field__item"><p>How to convert mp4 or ogg file in to mp3 using ffmpeg</p> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Mon, 03/08/2021 - 09:42</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><strong>Convert OGG to MP3</strong></p> <p><code>ffmpeg -v 5 -y -i file.m4a -acodec libmp3lame -ac 2 -ab 192k file.mp3</code></p> <p><strong>Convert M4A to MP3</strong></p> <p><code>ffmpeg -i file.ogg file.mp3<br /> #Or<br /> ffmpeg -i file.{ogg,mp3}</code></p> <p> </p> <p><strong>Batch process (bulk processing - shell/batch script) examples:</strong></p> <p>#Example1<br /><code>for i in *.m4a; do ffmpeg -v 5 -y -i "$i" -acodec libmp3lame -ac 2 -ab 192k "mp3/${i%.*}.mp3"; done</code></p> <p>#Example2<br /><code>for i in *.ogg; do ffmpeg -i "$i" "mp3/${i%.*}.mp3"; done</code></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/shell" hreflang="en">Shell</a></li> <li><a href="/en/tags/linux" hreflang="en">Linux</a></li> <li><a href="/en/tags/audio" hreflang="en">Audio</a></li> </ul> </div> <div class="field field--name-field-related-contents field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><a href="/en/tutoriels/128/images-processing-using-imagemagick-convert" hreflang="en">Images processing using ImageMagick (convert)</a></div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=410&amp;2=comment&amp;3=comment" token="oOijBNrAcwacW5Jzi9cdJXhDUcT6-I1gZG11Qg1hiRA"></drupal-render-placeholder> </section> Mon, 08 Mar 2021 08:42:34 +0000 editor 410 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/410/convert-m4a-or-ogg-audio-file-mp3-linux#comments Create a shortcut for drush https://drupal8.ovh/en/tutoriels/408/create-shortcut-drush <span class="field field--name-title field--type-string field--label-hidden">Create a shortcut for drush</span> <div class="clearfix text-formatted field field--name-field-question field--type-text-long field--label-above"> <div class="field__label">Question</div> <div class="field__item"><p>Different possibilities to run drush (drush 10)</p> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Thu, 01/21/2021 - 11:23</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Method 1 : Install and run drush as described in <a data-entity-substitution="canonical" data-entity-type="node" data-entity-uuid="2aeee871-aa09-4d91-a6f8-12028d04cf14" href="/en/tutoriels/397/install-drush-10" rel="nofollow">this article</a><br /> This is the recommended method</p> <p>Method 2 : Create a shortcut on ~/.local/bin</p> <p>1. Create a link to drush exec file on ~/.local/bin<br /> Example:<br /><code>cd ~/.local/bin</code><br /> ln -s 'PATH TO DRUSH BIN'<br /> Example:<br /><code>ln -s /home/drupal/.config/composer/vendor/bin/drush</code></p> <p>2. If not added yet, add ~/.local/bin folder to env path (<a data-entity-substitution="canonical" data-entity-type="node" data-entity-uuid="54e090c1-d493-441b-babb-b29c75c8848a" href="/en/tutoriels/407/linux-local-and-common-bin-folders" rel="nofollow">Tutorial</a>) to load automaticly or load manually like<br /><code>PATH=$PATH:$HOME/.<span><span><span><span><span><span><span><span><span><span><span><span><span><span><span>local</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>/bin:$HOME/bin<br /> export PATH</code></p> <p>Methos 3 : Create shorcut on .bashrc<br /> Edit ~.bashrc file and add (For example)<br /><code>alias drush='PATH TO DRUSH BIN'</code><br /> Example:<br /><code>alias drush='/home/drupal/.config/composer/vendor/bin/drush'</code></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/drush-10" hreflang="en">Drush 10</a></li> <li><a href="/en/tags/linux" hreflang="en">Linux</a></li> </ul> </div> <div class="field field--name-field-related-contents field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><a href="/en/tutoriels/397/install-drush-10" hreflang="en">Install drush 10</a></div> <div class="field__item"><a href="/en/tutoriels/407/linux-local-and-common-bin-folders" hreflang="en">Linux local and common bin folders (environnement path)</a></div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=408&amp;2=comment&amp;3=comment" token="1FLCSGVj7xXhPvRbOQmZwOODH-n4t0MiFgzaleT8XXk"></drupal-render-placeholder> </section> Thu, 21 Jan 2021 10:23:53 +0000 editor 408 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/408/create-shortcut-drush#comments Linux local and common bin folders (environnement path) https://drupal8.ovh/en/tutoriels/407/linux-local-and-common-bin-folders <span class="field field--name-title field--type-string field--label-hidden">Linux local and common bin folders (environnement path)</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Thu, 01/21/2021 - 11:16</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Local bin folders<br /> $HOME/.local/bin (~/.local/bin)<br /> $HOME/bin (~/bin)</p> <p>Add to path manually</p> <p><code>PATH=$PATH:$HOME/.local/bin:$HOME/bin<br /> export PATH</code></p> <p> </p> <p>User specific environment and startup programs</p> <p>1. Edit and add to one of the following files<br /> .bash_profile<br /> .profile<br /> .bashrc</p> <p><code>PATH=$PATH:$HOME/.local/bin:$HOME/bin<br /> export PATH</code></p> <p>To load a file manually the file .bashrc<br /><code>. ~/.bashrc</code></p> <p> </p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/linux" hreflang="en">Linux</a></li> <li><a href="/en/tags/shell" hreflang="en">Shell</a></li> </ul> </div> <div class="field field--name-field-related-contents field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><a href="/en/tutoriels/408/create-shortcut-drush" hreflang="en">Create a shortcut for drush</a></div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=407&amp;2=comment&amp;3=comment" token="Co8H6fqyn-6fBn70WxqmB1nO_JQA3iQA4qujWtQzLjk"></drupal-render-placeholder> </section> Thu, 21 Jan 2021 10:16:57 +0000 editor 407 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/407/linux-local-and-common-bin-folders#comments Drupal error due to DrushLog https://drupal8.ovh/en/tutoriels/406/drupal-error-dur-drushlog <span class="field field--name-title field--type-string field--label-hidden">Drupal error due to DrushLog</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 01/19/2021 - 17:42</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Symptoms</p> <p>You may have error messages like:</p> <p>The website encountered an unexpected error. Please try again later.<br /> and<br /><code>Error: Class 'Drush\Log\DrushLog' not found in Drupal\Component\DependencyInjection\Container-&gt;createService() (line 257 of /home/drupal/public_html/www/web/core/lib/Drupal/Component/DependencyInjection/Container.php) </code></p> <p><strong>probably this is due to DrushLog class.</strong></p> <p> </p> <p>Solution.</p> <p>Include the package drush/drush<br /><code>composer require drush/drush</code></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/drupal-9" hreflang="en">Drupal 9</a></li> <li><a href="/en/tags/error" hreflang="en">Error</a></li> </ul> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=406&amp;2=comment&amp;3=comment" token="9CACdDhKCUOPeusa8Mi4rpE-ke7g9WLNNMDA5PrQkwg"></drupal-render-placeholder> </section> Tue, 19 Jan 2021 16:42:38 +0000 editor 406 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/406/drupal-error-dur-drushlog#comments Use IMCE files browser for custom field on Drupal 8/9 https://drupal8.ovh/en/tutoriels/403/use-imce-files-browser-custom-field-drupal-89 <span class="field field--name-title field--type-string field--label-hidden">Use IMCE files browser for custom field on Drupal 8/9</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Fri, 12/04/2020 - 11:34</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>You can use IMCE to select a file.</p> <p><code>if (\Drupal::moduleHandler()-&gt;moduleExists('imce') &amp;&amp; \Drupal\imce\Imce::access()) {<br />   $form['values']['image-imce-field'] = [<br />     '#type' =&gt; 'textfield',<br />     '#title' =&gt; $this-&gt;t('Image'),<br />     '#attached' =&gt; ['library' =&gt; ['imce/drupal.imce.input']],<br />     '#attributes' =&gt; ['class' =&gt; ['imce-url-input']],<br />     '#default_value' =&gt; '',<br />   ];<br /> }</code></p> <p>Convert file path to FID</p> <p><code>public static function getFidFromPath($path) {<br />   $uri = str_replace('/sites/default/files/', 'public://', $path);<br />   $query = \Drupal::entityQuery('file');<br />   $query-&gt;condition('uri', $uri);<br />   $query-&gt;sort('created', 'DESC');<br />   $fids = $query-&gt;execute();<br />   if ($fids) {<br />     $fids = array_values($fids);<br />     return $fids[0] ??  NULL;<br />   }<br />   return NULL;<br /> }</code></p> <p> </p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/drupal-8" hreflang="en">Drupal 8</a></li> <li><a href="/en/tags/code" hreflang="en">Code</a></li> <li><a href="/en/tags/drupal-9" hreflang="en">Drupal 9</a></li> <li><a href="/en/tags/images" hreflang="en">Images</a></li> </ul> </div> <div class="field field--name-field-related-contents field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><a href="/en/tutoriels/341/use-imce-on-custom-page" hreflang="en">Use IMCE on custom page</a></div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=403&amp;2=comment&amp;3=comment" token="ZnMatWFYkymShWnWMU634yfeJu7eWKsK_N4Cc09MovQ"></drupal-render-placeholder> </section> Fri, 04 Dec 2020 10:34:16 +0000 editor 403 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/403/use-imce-files-browser-custom-field-drupal-89#comments Drupal 9 add inline JavaScript to a page programmatically https://drupal8.ovh/en/tutoriels/402/drupal-9-add-inline-javascript-page-programmatically <span class="field field--name-title field--type-string field--label-hidden">Drupal 9 add inline JavaScript to a page programmatically</span> <div class="clearfix text-formatted field field--name-field-question field--type-text-long field--label-above"> <div class="field__label">Question</div> <div class="field__item"><p>How to add inline JS script to a page or block programmatically  to drupal 8/9 ?</p> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Thu, 11/26/2020 - 14:15</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Method 1 : Form hook_page_attachments</p> <p>Example:<br /><code>/**<br />  * Implements hook_page_attachments().<br />  */<br /> function MYMODULE_page_attachments(array &amp;$attachments) {<br />   // You can optionally perform a check to make sure you target a specific page.<br />   if (\Drupal::routeMatch()-&gt;getRouteName() == 'some.route') {<br />     // Add our JS.<br />     $attachments['#attached']['html_head'][] = [<br />       [<br />         '#tag' =&gt; 'script',<br />         '#attributes' =&gt; [<br />           'type' =&gt; 'text/javascript',<br />         ],<br />         '#value' =&gt; 'console.log("i am here");',<br />       ],  'key_for_this_snippet',<br />     ];<br />   }<br /> }</code></p> <p>Method 2 : Form a controller (Or other renderer array)</p> <p>Example:<br /><code>/**<br />  * Test page<br />  */<br /> public function aPage() {<br /> $output = [];<br /> // Your page<br /> $output['#attached']['html_head'][] = [<br />   [<br />     '#tag' =&gt; 'script',<br />     '#attributes' =&gt; [<br />       'type' =&gt; 'text/javascript',<br />     ],<br />     '#value' =&gt; 'console.log("i am here");',<br />   ],  'key_for_this_snippet',<br /> ];<br /> return $output;<br /> }</code></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/drupal-8" hreflang="en">Drupal 8</a></li> <li><a href="/en/tags/code" hreflang="en">Code</a></li> <li><a href="/en/tags/javascript" hreflang="en">JavaScript</a></li> </ul> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=402&amp;2=comment&amp;3=comment" token="PAaJkqzNf8ReBn_O12Er_ZJjs7A4kB2XI1Th4j96KJg"></drupal-render-placeholder> </section> Thu, 26 Nov 2020 13:15:42 +0000 editor 402 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/402/drupal-9-add-inline-javascript-page-programmatically#comments Private Tempstore - Store data on Drupal 9 session https://drupal8.ovh/en/tutoriels/401/private-tempstore-store-data-drupal-9-session <span class="field field--name-title field--type-string field--label-hidden">Private Tempstore - Store data on Drupal 9 session</span> <div class="clearfix text-formatted field field--name-field-question field--type-text-long field--label-above"> <div class="field__label">Question</div> <div class="field__item"><p>How to stores and retrieves temporary data on session.</p> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Thu, 11/26/2020 - 11:32</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>This method allow to store data on drupal session using drupal session table (not php $_SESSION).<br /> Storage is different for each users ans each visitors if anonymous</p> <h2>Store data</h2> <p><code>$tempstore = \Drupal::service('tempstore.private')-&gt;get('mymodule');<br /> $tempstore-&gt;set('var_name', 'Just test');</code></p> <h2> Get data</h2> <p><code>$tempstore = \Drupal::service('tempstore.private')-&gt;get('mymodule');<br /> $var = $tempstore-&gt;get('var_name');</code></p> <h2>Delete data</h2> <p><code>$tempstore = \Drupal::service('tempstore.private')-&gt;get('mymodule');<br /> $tempstore-&gt;delete('var_name');</code></p> <p><strong>CAUTION</strong> : The <strong>user.private_tempstore</strong> and <strong>user.shared_tempstore</strong> are now deprecated.</p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/drupal-8" hreflang="en">Drupal 8</a></li> <li><a href="/en/tags/code" hreflang="en">Code</a></li> <li><a href="/en/tags/drupal-9" hreflang="en">Drupal 9</a></li> <li><a href="/en/tags/cache" hreflang="en">Cache</a></li> </ul> </div> <div class="field field--name-field-related-contents field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><a href="/en/tutoriels/365/save-temporary-data-key-value-expirable" hreflang="en">Save a temporary data - Key Value Expirable.</a></div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=401&amp;2=comment&amp;3=comment" token="FmPyqM9R3XMLNXM38ujK5642D7Kckilr-4qQcNgCi8A"></drupal-render-placeholder> </section> Thu, 26 Nov 2020 10:32:49 +0000 editor 401 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/401/private-tempstore-store-data-drupal-9-session#comments Redis and Php-Redis with drupal 9 on Linux https://drupal8.ovh/en/tutoriels/400/redis-and-phpredis-drupal-89-linux <span class="field field--name-title field--type-string field--label-hidden">Redis and Php-Redis with drupal 9 on Linux</span> <div class="clearfix text-formatted field field--name-field-question field--type-text-long field--label-above"> <div class="field__label">Question</div> <div class="field__item"><p>How to install and configure Redis / Php-Redis with drupal 8/9 on debian based Linux</p> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Thu, 11/26/2020 - 10:55</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Install Redis</h2> <p><code>sudo apt-get update &amp;&amp; sudo apt-get upgrade<br /> sudo apt install redis-server<br /> sudo apt install php-redis</code></p> <h3>Check</h3> <p><code>sudo systemctl status redis-server<br /> redis-cli ping</code></p> <h2> Drupal 9 configuration</h2> <p>Add following to the <code>settings.php</code></p> <p>// REDIS default configurations.<br /><code>$settings['redis.connection']['interface'] = 'PhpRedis';<br /> $settings['redis.connection']['host']      = '127.0.0.1';  // Your Redis instance hostname.<br /> $settings['cache']['default'] = 'cache.backend.redis';<br /> $conf['redis_cache_socket'] = '/tmp/redis.sock';</code></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/drupal-8" hreflang="en">Drupal 8</a></li> <li><a href="/en/tags/settings" hreflang="en">Settings</a></li> <li><a href="/en/tags/drupal-9" hreflang="en">Drupal 9</a></li> <li><a href="/en/tags/cache" hreflang="en">Cache</a></li> </ul> </div> <div class="field field--name-field-related-contents field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><a href="/en/tutoriels/302/memcache-install-memcached-on-linux-and-drupal" hreflang="en">Memcache - Install memcached on linux and Drupal.</a></div> <div class="field__item"><a href="/en/tutoriels/256/drupal-8-cache-api" hreflang="en">Drupal 8 Cache API</a></div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=400&amp;2=comment&amp;3=comment" token="PiPY35TPQzSmkp0Odonsn3FVvgey2c3paVl9HkMXfEg"></drupal-render-placeholder> </section> Thu, 26 Nov 2020 09:55:29 +0000 editor 400 at https://drupal8.ovh https://drupal8.ovh/en/tutoriels/400/redis-and-phpredis-drupal-89-linux#comments