<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>wordpress Archives | Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/tag/wordpress-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.clever.cloud/blog/tag/wordpress-2/</link>
	<description>From Code to Product</description>
	<lastBuildDate>Fri, 23 May 2025 08:59:27 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>wordpress Archives | Clever Cloud</title>
	<link>https://www.clever.cloud/blog/tag/wordpress-2/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Cloud hosted WordPress with Composer like it&#8217;s 2024</title>
		<link>https://www.clever.cloud/blog/features/2024/01/08/wordpress-cloud-2024/</link>
		
		<dc:creator><![CDATA[Julia March]]></dc:creator>
		<pubDate>Mon, 08 Jan 2024 11:11:06 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[composer]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://www.clever-cloud.com/?p=7554</guid>

					<description><![CDATA[<p><img width="1076" height="415" src="https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="wp composer 1" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1.png 1076w, https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1-768x296.png 768w" sizes="(max-width: 1076px) 100vw, 1076px" /></p><!-- wp:paragraph -->
<p>Devastating news for Wordpress haters: with a clean, secure, and modern file structure, you can easily migrate it to Clever Cloud. All of this is possible using the tools described in this post.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For those who have never used Git before, we will also cover how to deploy a WordPress installation on Clever Cloud in this post. If you want to give it a try, we'll walk you through the steps. If you choose not to, our platform does offer a GitHub integration.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Requirements:</strong></p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>A&nbsp;<a href="https://www.clever.cloud" target="_blank" rel="noreferrer noopener">Clever Cloud</a>&nbsp;account</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Le <a href="https://github.com/CleverCloud/clever-wordpress" target="_blank" rel="noreferrer noopener">Bedrock's Composer</a>&nbsp;to deploy WordPress with Clever Cloud, that we have updated.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>A&nbsp;<a href="https://github.com" target="_blank" rel="noreferrer noopener">GitHub</a>&nbsp;account if you deploy the code from it, <strong>or</strong>&nbsp;<a href="https://git-scm.com" target="_blank" rel="noreferrer noopener">Git </a>&nbsp;installed on your computer, if you choose this method.</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Deployment and WorpdPress configuration</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Composer will deploy a WordPress site in a matter of minutes, creating a rapid, light, and secure framework for our new website.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Follow the instructions below:</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">1. Get the code</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The code can be found in its &nbsp;<a href="https://github.com/CleverCloud/clever-wordpress" target="_blank" rel="noreferrer noopener">"WordPress + Bedrock"</a> . public repository. It has a WordPress architecture that works with Composer. There are two ways to download it: directly from Git or GitHub (the easier choice if you don't feel comfortable using command lines).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Take this post as an opportunity to learn more about command lines on a Terminal and Git, even if you aren't accustomed to them. No worries, by following our directions, you will be able to use this method..</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Option A : Using GitHub</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>If you really don't want to use Git, simply fork the code and deploy from GitHub on Clever Cloud. Creating a fork will duplicate the code in your own repository.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":7536,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://cdn.clever-cloud.com/uploads/2022/09/github-fork.png" alt="" class="wp-image-7536"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Open the&nbsp;<a href="https://console.clever-cloud.com" target="_blank" rel="noreferrer noopener">Clever Cloud Console</a>&nbsp;settings, clic on &nbsp;"Profile" and link your GitHub account, if you haven't done it already. That's all, now go directly to step 2.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Option B: Using Git, step by step</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The other option is to download the code to your computer (locally). If that's your first time, here are the instructions:</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":5} -->
<h5 class="wp-block-heading">Set up</h5>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You must first grant permission for your computer to push code to Clever Cloud before you can proceed. You must create and add an SSH key to your console if you haven't already. Go directly to the next step if it has already been completed.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Open your Terminal and:</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li>type&nbsp;<code>ssh-keygen -t ed25519 -C "[votre@email.ici]</code>&nbsp;the email must be the same you use to log into Clever Cloud.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>When the Terminal asks you in which file you wish to add the key, juste press "Enter". </li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Add a password</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Copy the key content using &nbsp;<code>pbcopy &lt; ~/.ssh/id_[rsa].pub</code> (replace&nbsp;<code>[rsa]</code>&nbsp;by your key id, of course))</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Open the Clever Cloud Console and go to Profile&gt;SSH keys&gt;Add and paste your key's content.</li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Your machine is now connected to your Clever Cloud account and ready to push code.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":5} -->
<h5 class="wp-block-heading">Clone the code</h5>
<!-- /wp:heading -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li>Make a&nbsp;<code>sites</code>&nbsp;directory on your computer. It will contait your apps and your websites.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Open your terminal and type&nbsp;<code>cd sites</code>, this will open your "sites" directory.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Still in your terminal, copy-paste&nbsp;<code>git clone git@github.com:CleverCloud/clever-wordpress.git'</code></li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>The code has been downloaded to your computer, inside the&nbsp;<code>sites</code>directory, you'll see a a new&nbsp;<code>clever-wordpress</code>&nbsp;directory. Open it (<code>cd clever-wordpress</code>) et type&nbsp;<code class="lang-shell">ls -a</code> : you'll see all the files and directories it contains.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you just used Git and your Terminal for the first time, you'll find more tutorials and explanations on the Internet. Our teammate David Legrand happens to publish great stuff I &nbsp;<a href="https://www.nextinpact.com/article/43792/apprenez-a-utiliser-git-bases-pour-suivre-evolution-dun-document" target="_blank" rel="noreferrer noopener">greta stuff in French.</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">2. Declare the app on Clever Cloud</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Click "Create" and "An application" from the Clever Cloud Console. After choosing your fork, you can create a new PHP app if you are using GitHub integration. All that remains is for the code to be pushed from GitHub. If you're using Git, the identical procedure can be carried out by entering a short command line.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The Console will ask if you need any add-on, choose a <strong>MySQL database</strong> and proceed.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Edit your PHP app <strong>environment variables</strong>&nbsp;in expert mode and past the salts generated on sur <a href="https://cdn.roots.io/salts.html" target="_blank" rel="noreferrer noopener">this page</a> (don't forget to save &nbsp;changes!)</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":7533,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://cdn.clever-cloud.com/uploads/2022/09/variables-environnement.png" alt="Expert mode on Clever Cloud Environnement variables page" class="wp-image-7533"/></figure>
<!-- /wp:image -->

<!-- wp:list {"ordered":true,"start":6} -->
<ol start="6"><!-- wp:list-item -->
<li>Add 3 additional environment variables:<!-- wp:list -->
<ul><!-- wp:list-item -->
<li><code>WP_ENV</code> with value&nbsp;<code>production</code></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><code>WP_HOME</code>&nbsp;with value&nbsp;<code>https://yourdomain.tld</code></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><code>WP_SITEURL</code>&nbsp;with value&nbsp;<code>https://your-domain.tld/wp</code></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:image {"id":7534,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://cdn.clever-cloud.com/uploads/2022/09/variables-simple.png" alt="Simple mode on environment variables from the Clever Cloud Console" class="wp-image-7534"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>The Console will provide you with command lines to copy-paste in your Terminal in order to send your code to your new instance, unless you've decided to work with the GitHub integration. The deployment will begin once you've completed this.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>While the deployment starts,&nbsp;<strong>create an Cellar addon</strong>&nbsp;and link it to your app (clic on your PHP app, then choose "Linked dependencies" to connect it).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>From the&nbsp;<strong>Cellar</strong> set up page, create&nbsp;<strong>a bucket</strong> and give it a name.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Go back to your PHP app and add the following&nbsp;<strong>environment variable</strong>:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><code>CELLAR_ADDON_BUCKET</code>&nbsp;with the name of your bucket as value.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Tip : You can easily configure a custom domain for your bucket. Check &nbsp;<a href="https://www.clever.cloud/developers/deploy/addon/cellar/#using-a-custom-domain" target="_blank" rel="noreferrer noopener">the doc</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Restart your app to incorporate last changes.

Don't forget to set up your domain for the WP_HOME variable (or with a .cleveapps.io for testing purposes).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>When you'll visit your website, the installation page from WordPress will then appear (you'll find de database credentials in the Console, either by clicking on the addon, either in your app's environment variables). Once you are logged into WordPress, go to your plugins page and activate&nbsp;<strong>S3 Uploads</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>That's it. You now have a hosted WordPress on Clever Cloud. Your files and medias will be stored in the Cellar's bucket.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Add a plugin by a single command</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The&nbsp;<code>composer.json</code>&nbsp;file reflects the WordPress themes and plugins directory; you just have to specify what it should reflect. <strong>You don't need to host the plugin directory in your app </strong>to add a new plugin to your site<strong>.</strong> You'll use&nbsp;<a href="https://wpackagist.org">Wpackagist</a>&nbsp;to find and add the plugin's references to&nbsp;<code>composer.json</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Find&nbsp;<code>require</code> , this is where the plugins are specified.</p>
<!-- /wp:paragraph -->

<!-- wp:code {"className":"lang-json"} -->
<pre class="wp-block-code lang-json"><code>"require": 
//Here are your further plugins declarations. Add this line wherever you'd like (update the version if necessary)
"wpackagist-plugin/&#91;plugin]": "&#91;version]",</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>You'll find all your favorite plugins on&nbsp;<a href="https://wpackagist.org">Wpackagist</a>&nbsp;to add them to the file. Commit changes (with Git : <code>git add .</code>&nbsp; et <code>git commit -m "un-message"</code>) and push the modified code to Clever Cloud (on GitHub, this action will be done automatically). Wait until your app has redeployed, then go top your WordPress dashboard and activate the plugins you just added.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Welcome aboard!!</p>
<!-- /wp:paragraph -->]]></description>
										<content:encoded><![CDATA[<p><img width="1076" height="415" src="https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="wp composer 1" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1.png 1076w, https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2022/08/wp-composer-1-768x296.png 768w" sizes="(max-width: 1076px) 100vw, 1076px" /></p><!-- wp:paragraph -->
<p>Devastating news for Wordpress haters: with a clean, secure, and modern file structure, you can easily migrate it to Clever Cloud. All of this is possible using the tools described in this post.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For those who have never used Git before, we will also cover how to deploy a WordPress installation on Clever Cloud in this post. If you want to give it a try, we'll walk you through the steps. If you choose not to, our platform does offer a GitHub integration.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Requirements:</strong></p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>A&nbsp;<a href="https://www.clever.cloud" target="_blank" rel="noreferrer noopener">Clever Cloud</a>&nbsp;account</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Le <a href="https://github.com/CleverCloud/clever-wordpress" target="_blank" rel="noreferrer noopener">Bedrock's Composer</a>&nbsp;to deploy WordPress with Clever Cloud, that we have updated.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>A&nbsp;<a href="https://github.com" target="_blank" rel="noreferrer noopener">GitHub</a>&nbsp;account if you deploy the code from it, <strong>or</strong>&nbsp;<a href="https://git-scm.com" target="_blank" rel="noreferrer noopener">Git </a>&nbsp;installed on your computer, if you choose this method.</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Deployment and WorpdPress configuration</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Composer will deploy a WordPress site in a matter of minutes, creating a rapid, light, and secure framework for our new website.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Follow the instructions below:</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">1. Get the code</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The code can be found in its &nbsp;<a href="https://github.com/CleverCloud/clever-wordpress" target="_blank" rel="noreferrer noopener">"WordPress + Bedrock"</a> . public repository. It has a WordPress architecture that works with Composer. There are two ways to download it: directly from Git or GitHub (the easier choice if you don't feel comfortable using command lines).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Take this post as an opportunity to learn more about command lines on a Terminal and Git, even if you aren't accustomed to them. No worries, by following our directions, you will be able to use this method..</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Option A : Using GitHub</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>If you really don't want to use Git, simply fork the code and deploy from GitHub on Clever Cloud. Creating a fork will duplicate the code in your own repository.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":7536,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://cdn.clever-cloud.com/uploads/2022/09/github-fork.png" alt="" class="wp-image-7536"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Open the&nbsp;<a href="https://console.clever-cloud.com" target="_blank" rel="noreferrer noopener">Clever Cloud Console</a>&nbsp;settings, clic on &nbsp;"Profile" and link your GitHub account, if you haven't done it already. That's all, now go directly to step 2.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Option B: Using Git, step by step</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The other option is to download the code to your computer (locally). If that's your first time, here are the instructions:</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":5} -->
<h5 class="wp-block-heading">Set up</h5>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You must first grant permission for your computer to push code to Clever Cloud before you can proceed. You must create and add an SSH key to your console if you haven't already. Go directly to the next step if it has already been completed.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Open your Terminal and:</p>
<!-- /wp:paragraph -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li>type&nbsp;<code>ssh-keygen -t ed25519 -C "[votre@email.ici]</code>&nbsp;the email must be the same you use to log into Clever Cloud.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>When the Terminal asks you in which file you wish to add the key, juste press "Enter". </li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Add a password</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Copy the key content using &nbsp;<code>pbcopy &lt; ~/.ssh/id_[rsa].pub</code> (replace&nbsp;<code>[rsa]</code>&nbsp;by your key id, of course))</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Open the Clever Cloud Console and go to Profile&gt;SSH keys&gt;Add and paste your key's content.</li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Your machine is now connected to your Clever Cloud account and ready to push code.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":5} -->
<h5 class="wp-block-heading">Clone the code</h5>
<!-- /wp:heading -->

<!-- wp:list {"ordered":true} -->
<ol><!-- wp:list-item -->
<li>Make a&nbsp;<code>sites</code>&nbsp;directory on your computer. It will contait your apps and your websites.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Open your terminal and type&nbsp;<code>cd sites</code>, this will open your "sites" directory.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Still in your terminal, copy-paste&nbsp;<code>git clone git@github.com:CleverCloud/clever-wordpress.git'</code></li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>The code has been downloaded to your computer, inside the&nbsp;<code>sites</code>directory, you'll see a a new&nbsp;<code>clever-wordpress</code>&nbsp;directory. Open it (<code>cd clever-wordpress</code>) et type&nbsp;<code class="lang-shell">ls -a</code> : you'll see all the files and directories it contains.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you just used Git and your Terminal for the first time, you'll find more tutorials and explanations on the Internet. Our teammate David Legrand happens to publish great stuff I &nbsp;<a href="https://www.nextinpact.com/article/43792/apprenez-a-utiliser-git-bases-pour-suivre-evolution-dun-document" target="_blank" rel="noreferrer noopener">greta stuff in French.</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">2. Declare the app on Clever Cloud</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Click "Create" and "An application" from the Clever Cloud Console. After choosing your fork, you can create a new PHP app if you are using GitHub integration. All that remains is for the code to be pushed from GitHub. If you're using Git, the identical procedure can be carried out by entering a short command line.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The Console will ask if you need any add-on, choose a <strong>MySQL database</strong> and proceed.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Edit your PHP app <strong>environment variables</strong>&nbsp;in expert mode and past the salts generated on sur <a href="https://cdn.roots.io/salts.html" target="_blank" rel="noreferrer noopener">this page</a> (don't forget to save &nbsp;changes!)</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":7533,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://cdn.clever-cloud.com/uploads/2022/09/variables-environnement.png" alt="Expert mode on Clever Cloud Environnement variables page" class="wp-image-7533"/></figure>
<!-- /wp:image -->

<!-- wp:list {"ordered":true,"start":6} -->
<ol start="6"><!-- wp:list-item -->
<li>Add 3 additional environment variables:<!-- wp:list -->
<ul><!-- wp:list-item -->
<li><code>WP_ENV</code> with value&nbsp;<code>production</code></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><code>WP_HOME</code>&nbsp;with value&nbsp;<code>https://yourdomain.tld</code></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><code>WP_SITEURL</code>&nbsp;with value&nbsp;<code>https://your-domain.tld/wp</code></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item --></ol>
<!-- /wp:list -->

<!-- wp:image {"id":7534,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="https://cdn.clever-cloud.com/uploads/2022/09/variables-simple.png" alt="Simple mode on environment variables from the Clever Cloud Console" class="wp-image-7534"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>The Console will provide you with command lines to copy-paste in your Terminal in order to send your code to your new instance, unless you've decided to work with the GitHub integration. The deployment will begin once you've completed this.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>While the deployment starts,&nbsp;<strong>create an Cellar addon</strong>&nbsp;and link it to your app (clic on your PHP app, then choose "Linked dependencies" to connect it).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>From the&nbsp;<strong>Cellar</strong> set up page, create&nbsp;<strong>a bucket</strong> and give it a name.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Go back to your PHP app and add the following&nbsp;<strong>environment variable</strong>:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><code>CELLAR_ADDON_BUCKET</code>&nbsp;with the name of your bucket as value.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Tip : You can easily configure a custom domain for your bucket. Check &nbsp;<a href="https://www.clever.cloud/developers/deploy/addon/cellar/#using-a-custom-domain" target="_blank" rel="noreferrer noopener">the doc</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Restart your app to incorporate last changes.

Don't forget to set up your domain for the WP_HOME variable (or with a .cleveapps.io for testing purposes).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>When you'll visit your website, the installation page from WordPress will then appear (you'll find de database credentials in the Console, either by clicking on the addon, either in your app's environment variables). Once you are logged into WordPress, go to your plugins page and activate&nbsp;<strong>S3 Uploads</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>That's it. You now have a hosted WordPress on Clever Cloud. Your files and medias will be stored in the Cellar's bucket.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Add a plugin by a single command</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The&nbsp;<code>composer.json</code>&nbsp;file reflects the WordPress themes and plugins directory; you just have to specify what it should reflect. <strong>You don't need to host the plugin directory in your app </strong>to add a new plugin to your site<strong>.</strong> You'll use&nbsp;<a href="https://wpackagist.org">Wpackagist</a>&nbsp;to find and add the plugin's references to&nbsp;<code>composer.json</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Find&nbsp;<code>require</code> , this is where the plugins are specified.</p>
<!-- /wp:paragraph -->

<!-- wp:code {"className":"lang-json"} -->
<pre class="wp-block-code lang-json"><code>"require": 
//Here are your further plugins declarations. Add this line wherever you'd like (update the version if necessary)
"wpackagist-plugin/&#91;plugin]": "&#91;version]",</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>You'll find all your favorite plugins on&nbsp;<a href="https://wpackagist.org">Wpackagist</a>&nbsp;to add them to the file. Commit changes (with Git : <code>git add .</code>&nbsp; et <code>git commit -m "un-message"</code>) and push the modified code to Clever Cloud (on GitHub, this action will be done automatically). Wait until your app has redeployed, then go top your WordPress dashboard and activate the plugins you just added.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Welcome aboard!!</p>
<!-- /wp:paragraph -->]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Optimize your PHP Applications on Clever Cloud</title>
		<link>https://www.clever.cloud/blog/features/2015/11/19/how-to-optimize-your-php-applications/</link>
		
		<dc:creator><![CDATA[Gautier Pogam]]></dc:creator>
		<pubDate>Thu, 19 Nov 2015 15:35:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2015/11/19/how-to-optimize-your-php-applications/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="wordpress optim 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1-1368x528.jpg 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p>PHP is quite popular in website creation. A lot of famous/popular CMS and frameworks are written in this language.

As these CMS and frameworks became extremely complex, it's important to know that some tricks can be applied to improve overall performances. Communities created a lot of tools or plug-ins. Here are different tips you can easily apply to optimize your <a href="https://www.clever.cloud/product/php/">PHP Applications</a>.

<span id="more-2862"></span>
<h3 id="varnish-for-faster-content-pages">Varnish, for faster content pages</h3>
Let's begin with a simple cache service, Varnish. <a href="https://www.varnish-cache.org/">Varnish</a> is a <em>HTTP Cache</em> on the server side that can boost the response time of a request. It will handle the requests sent by the browser. And instead of sending all requests to the back-end, it caches the first request into a HTML file. Next time, the raw HTML file will be sent directly. Without bothering the back-end and the database.

With a set of rules and options, it can fit all websites and offer a real breath of fresh air to your website. You can find the <a href="https://www.varnish-cache.org/docs">Varnish documentation here</a>.

To enable a configured Varnish on Clever Cloud, it's prety straightforward:
<ol>
 	<li>First, create a <code>/clevercloud</code> folder if it doesn't exist.</li>
 	<li>In this folder, copy your own <code>varnish.vcl</code> file.</li>
 	<li>With git, add the file, commit and push your website on Clever Cloud.</li>
</ol>
If needed, redeploy you app. Varnish will be activated. Also, you should test your new configuration with <a href="http://isvarnishworking.com">isvarnishworking.com</a> to check if everything is working well.

Before we continue let me be clear: do not forget that Varnish returns a dumb cached page. In plain HTML. So you might have to adapt your configuration to be sure that dynamic pages are not cached. You have to manage these pages differently, so we recommend the following strategies.
<h3 id="how-to-decrease-load-on-sql-databases-with-redis">How to decrease load on SQL databases with Redis</h3>
Redis is an in-memory data store. It's a key-value database capable of storing in memory some information to speed up their fetching. Most of the time, you can use Redis along with a classic database (eg. PostgreSQL) to improve response time.

Instead of querying the DB for each request, we poke Redis to get the results of the previous request. The database will not have to process the request, as Redis takes care of it.

Redis associates a hash to each value and will return the result associated with it from the RAM. The delay to access the value is then way faster than querying the SQL database.

For PHP we provide <a href="https://github.com/phpredis/phpredis">PHPRedis</a>, an extension to communicate with Redis. It's quite easy to integrate it with your application along with Varnish for HTTP-Caching.

For instance, you can use Varnish to cache pages that do not change often - like the content for anonymous visitors. And Redis to speedup the response time of dynamic pages such as a forum or a e-commerce website.
<h3 id="storing-php-sessions-in-redis">Storing PHP sessions in Redis</h3>
Sessions in PHP are, by default, stored in temporary files. On a file system. And that's a really bad news. Because file systems are:
<ul>
 	<li>Slow</li>
 	<li>too complex for a simple</li>
 	<li>and SPOF-free multi tenant file systems are unicorns</li>
</ul>
So, if you website has to deal with a high traffic, here's what's happening:

For each request, PHP will open, read and close the file. Such operations on the file system are transactional. As a consequence, it will slow down the response time. This also requires disk space. If your website keeps sessions for a long time, and for a lot of different users, this might use a lot of space.

Luckily, Redis can help us on this. PHP offers the possibility to change the <em>session handler</em> and how sessions are managed. Using a DB like Redis instead of the FS can improve performance of your application. Especially if you have a lot of visitors

PHPRedis, which we mentioned above, can do this. Clever Cloud gives you a simple way to enable storage of sessions in Redis. You do not even have to change or add a file, it can be setup in the environment variables:
<ol>
 	<li>Go in the <a href="https://www.clever.cloud/developers/admin-console/environment-variables/">environment variables</a> section of
your application in our console.</li>
 	<li>Create an environment variable named <code>SESSION_TYPE</code> with the value <code>redis</code>.</li>
</ol>
To words. And nothing more. The sessions of your application will now be stored in a Redis database!
<h3 id="advice-for-wordpress-websites">Advice for Wordpress websites</h3>
Clever Cloud deals with a lot of Wordpress websites, so we found multiple ways to improve the performance easily.
<blockquote>We noticed many times that plug-ins such as <em>W3 Total Cache</em> or <em>JetPack</em> can slow down your apps.</blockquote>
The most problematic thing are plug-ins. We noticed many times that plug-ins such as <em>W3 Total Cache</em> or <em>JetPack</em> can slow down your apps. They are providing cache systems, but these are designed for shared hosting. Not Cloud hosting.

As Clever Cloud provides dedicated VMs for each app, these plug-ins create problems. Or slowdowns. So just get rid of them. If you need a caching system, use Varnish instead. There is a <code>varnish.vcl</code> file example in the <a href="https://www.clever.cloud/developers/php/tutorial-wordpress/#http-cache-with-varnish">WordPress documentation</a>.

Also, the previous three optimization methods works great for Wordpress of course.
<h3 id="conclusion">Conclusion</h3>
Alongside complex PHP's CMS evolution, the tools to improve performances also made their way. We hope these few trivial optimizations will help you to scale better and create a great browsing experience.

If you have other tips for these tools, tell us about them in the comments. We are always looking for tips which could improve performance and offer a great service. So if you have any suggestions feel free to contact us at <a href="mailto:support@clever-cloud.com">support@clever-cloud.com</a>.]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="wordpress optim 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/08/wordpress-optim-1-1368x528.jpg 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p>PHP is quite popular in website creation. A lot of famous/popular CMS and frameworks are written in this language.

As these CMS and frameworks became extremely complex, it's important to know that some tricks can be applied to improve overall performances. Communities created a lot of tools or plug-ins. Here are different tips you can easily apply to optimize your <a href="https://www.clever.cloud/product/php/">PHP Applications</a>.

<span id="more-2862"></span>
<h3 id="varnish-for-faster-content-pages">Varnish, for faster content pages</h3>
Let's begin with a simple cache service, Varnish. <a href="https://www.varnish-cache.org/">Varnish</a> is a <em>HTTP Cache</em> on the server side that can boost the response time of a request. It will handle the requests sent by the browser. And instead of sending all requests to the back-end, it caches the first request into a HTML file. Next time, the raw HTML file will be sent directly. Without bothering the back-end and the database.

With a set of rules and options, it can fit all websites and offer a real breath of fresh air to your website. You can find the <a href="https://www.varnish-cache.org/docs">Varnish documentation here</a>.

To enable a configured Varnish on Clever Cloud, it's prety straightforward:
<ol>
 	<li>First, create a <code>/clevercloud</code> folder if it doesn't exist.</li>
 	<li>In this folder, copy your own <code>varnish.vcl</code> file.</li>
 	<li>With git, add the file, commit and push your website on Clever Cloud.</li>
</ol>
If needed, redeploy you app. Varnish will be activated. Also, you should test your new configuration with <a href="http://isvarnishworking.com">isvarnishworking.com</a> to check if everything is working well.

Before we continue let me be clear: do not forget that Varnish returns a dumb cached page. In plain HTML. So you might have to adapt your configuration to be sure that dynamic pages are not cached. You have to manage these pages differently, so we recommend the following strategies.
<h3 id="how-to-decrease-load-on-sql-databases-with-redis">How to decrease load on SQL databases with Redis</h3>
Redis is an in-memory data store. It's a key-value database capable of storing in memory some information to speed up their fetching. Most of the time, you can use Redis along with a classic database (eg. PostgreSQL) to improve response time.

Instead of querying the DB for each request, we poke Redis to get the results of the previous request. The database will not have to process the request, as Redis takes care of it.

Redis associates a hash to each value and will return the result associated with it from the RAM. The delay to access the value is then way faster than querying the SQL database.

For PHP we provide <a href="https://github.com/phpredis/phpredis">PHPRedis</a>, an extension to communicate with Redis. It's quite easy to integrate it with your application along with Varnish for HTTP-Caching.

For instance, you can use Varnish to cache pages that do not change often - like the content for anonymous visitors. And Redis to speedup the response time of dynamic pages such as a forum or a e-commerce website.
<h3 id="storing-php-sessions-in-redis">Storing PHP sessions in Redis</h3>
Sessions in PHP are, by default, stored in temporary files. On a file system. And that's a really bad news. Because file systems are:
<ul>
 	<li>Slow</li>
 	<li>too complex for a simple</li>
 	<li>and SPOF-free multi tenant file systems are unicorns</li>
</ul>
So, if you website has to deal with a high traffic, here's what's happening:

For each request, PHP will open, read and close the file. Such operations on the file system are transactional. As a consequence, it will slow down the response time. This also requires disk space. If your website keeps sessions for a long time, and for a lot of different users, this might use a lot of space.

Luckily, Redis can help us on this. PHP offers the possibility to change the <em>session handler</em> and how sessions are managed. Using a DB like Redis instead of the FS can improve performance of your application. Especially if you have a lot of visitors

PHPRedis, which we mentioned above, can do this. Clever Cloud gives you a simple way to enable storage of sessions in Redis. You do not even have to change or add a file, it can be setup in the environment variables:
<ol>
 	<li>Go in the <a href="https://www.clever.cloud/developers/admin-console/environment-variables/">environment variables</a> section of
your application in our console.</li>
 	<li>Create an environment variable named <code>SESSION_TYPE</code> with the value <code>redis</code>.</li>
</ol>
To words. And nothing more. The sessions of your application will now be stored in a Redis database!
<h3 id="advice-for-wordpress-websites">Advice for Wordpress websites</h3>
Clever Cloud deals with a lot of Wordpress websites, so we found multiple ways to improve the performance easily.
<blockquote>We noticed many times that plug-ins such as <em>W3 Total Cache</em> or <em>JetPack</em> can slow down your apps.</blockquote>
The most problematic thing are plug-ins. We noticed many times that plug-ins such as <em>W3 Total Cache</em> or <em>JetPack</em> can slow down your apps. They are providing cache systems, but these are designed for shared hosting. Not Cloud hosting.

As Clever Cloud provides dedicated VMs for each app, these plug-ins create problems. Or slowdowns. So just get rid of them. If you need a caching system, use Varnish instead. There is a <code>varnish.vcl</code> file example in the <a href="https://www.clever.cloud/developers/php/tutorial-wordpress/#http-cache-with-varnish">WordPress documentation</a>.

Also, the previous three optimization methods works great for Wordpress of course.
<h3 id="conclusion">Conclusion</h3>
Alongside complex PHP's CMS evolution, the tools to improve performances also made their way. We hope these few trivial optimizations will help you to scale better and create a great browsing experience.

If you have other tips for these tools, tell us about them in the comments. We are always looking for tips which could improve performance and offer a great service. So if you have any suggestions feel free to contact us at <a href="mailto:support@clever-cloud.com">support@clever-cloud.com</a>.]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
