<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Shahroz Nawaz</title>
    <description>The latest articles on Forem by Shahroz Nawaz (@_shahroznawaz).</description>
    <link>https://forem.com/_shahroznawaz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1450%2F357244a1-e05c-4110-a1a1-8455a66666fa.jpg</url>
      <title>Forem: Shahroz Nawaz</title>
      <link>https://forem.com/_shahroznawaz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/_shahroznawaz"/>
    <language>en</language>
    <item>
      <title>Cloudways Coding Challenge: Win $500 Free Credits and Goodies</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Mon, 23 Sep 2019 10:07:43 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/cloudways-coding-challenge-win-500-free-credits-and-goodies-3fl8</link>
      <guid>https://forem.com/_shahroznawaz/cloudways-coding-challenge-win-500-free-credits-and-goodies-3fl8</guid>
      <description>&lt;p&gt;Maintaining its high standards to keep the dev market in focus, Cloudways has now announced a &lt;a href="https://www.cloudways.com/en/coding-challenge.php" rel="noopener noreferrer"&gt;Coding Challenge Contest&lt;/a&gt; where all enthusiastic community developers are invited to participate. The coding challenge contest gives all the dev millennial a chance to demonstrate their skills and get their name registered amongst the best.&lt;/p&gt;

&lt;p&gt;It is a platform that encourages all the coders who are new to the field and want to get exposure with some practical means. The challenge will provide fierce competition amongst the best coders to show off their skills and claim exciting prizes. The first challenge to beat up is to build a “Website Speed Test Tool”The winners will be awarded &lt;strong&gt;FREE $500 Cloudways hosting credit&lt;/strong&gt; for one year, and will receive &lt;strong&gt;FREE goodie bags&lt;/strong&gt; as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.cloudways.com/en/coding-challenge.php" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2FCoding-Challenge.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not only that, but the winner will also get recognition throughout the community and will be announced via our social channels. So, it will be a real worthy experience to take part in this competition, as it will hone your dev skills and will give you a chance to compete with some of the top minds in the market. The participation is free for all via registering through Gleam. Just submit your entries and start participating in one of the top coding competitions of 2019.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>coding</category>
      <category>webdev</category>
    </item>
    <item>
      <title>DEV Summer Alert! Get 30% Off on Cloudways and Win Exclusive Swags. [Giveaway]</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Sat, 22 Jun 2019 07:57:49 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/dev-summer-alert-get-30-off-on-cloudways-and-win-exclusive-swags-giveaway-35m5</link>
      <guid>https://forem.com/_shahroznawaz/dev-summer-alert-get-30-off-on-cloudways-and-win-exclusive-swags-giveaway-35m5</guid>
      <description>&lt;p&gt;As summer time starts and most of the developers fly to enjoy the vacations and take a gap from work and business. &lt;a href="https://www.cloudways.com/blog/summer-discount-offer-on-hosting/"&gt;Cloudways decides to give a cool treat&lt;/a&gt; and will take care of your online businesses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Brief About Cloudways Platform
&lt;/h2&gt;

&lt;p&gt;Cloudways is a Managed Cloud Hosting platform use by Digital Agencies, Ecommerce, Bloggers and developers to empower their online business with speed and no downtime. At Cloudways, You can launch servers on top cloud providers like DigitalOcean, Linode, Vultr, AWS and GCE. All the server and applications can be completely managed by the platform with few clicks.&lt;/p&gt;

&lt;p&gt;Well, Summer is the time when business owners got time to rethink and refresh the mind to take advance steps to flourish business. They can be thinking of switching to the better cloud provider to get the maximum peace of mind.  &lt;/p&gt;

&lt;p&gt;Cloudways Completely understands the variety of challenges faced by online business. That's why they provide the complete hosting platform for WordPress websites to Magento stores and &lt;a href="https://www.cloudways.com/en/php-cloud-hosting.php"&gt;PHP/JS based applications&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Offer
&lt;/h2&gt;

&lt;p&gt;AS People is waiting for the BFCM the biggest online shopping event Cloudways decides to treat people at earliest. If you want to switch to a better cloud server sign up for a new Cloudways and use the Promo Code &lt;strong&gt;SCALEINSUMMER&lt;/strong&gt; . For the next two months, you will get a &lt;a href="https://www.cloudways.com/blog/summer-discount-offer-on-hosting/"&gt;discount of 30% with a free migration&lt;/a&gt; for your websites.  &lt;/p&gt;

&lt;h2&gt;
  
  
  The Swags You Love
&lt;/h2&gt;

&lt;p&gt;Beside the Cloud hosting offer you can also participate in the giveaway cooling the summer vibes and win Cloudways branded SWAG including branded t-shirts, sunglasses, summer hat, can cooler, and much more to 50+ most active participants of our giveaway.&lt;/p&gt;

&lt;p&gt;Giveaway is for all you don't need to be a Cloudways customer to win this. Whether you hosting you websites anywhere you can take part in the giveaway and win swags.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>discuss</category>
      <category>giveaway</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to Migrate WordPress Website from Any Server Using WP-CLI</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Fri, 29 Mar 2019 08:30:52 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/how-to-migrate-wordpress-website-from-any-server-using-wp-cli-1ni2</link>
      <guid>https://forem.com/_shahroznawaz/how-to-migrate-wordpress-website-from-any-server-using-wp-cli-1ni2</guid>
      <description>&lt;p&gt;&lt;a href="https://www.cloudways.com/en/wordpress-migration-plugin.php"&gt;Migrating a WordPress Website&lt;/a&gt; has been never easier than before. With tons of plugins and tools, anyone can migrate the whole website from one server to another. Having said that, there are times when you do not have the option of using a cPanel or a File Manager to control the migration process. And you have to rely on the command line interface to interact with the server your WordPress website is hosted on.&lt;/p&gt;

&lt;p&gt;Using a command line may not very convenient to many and that’s because we are not used to of using it in our routine tasks. But the control and performance command line offer are unparalleled to any other way of execution.&lt;/p&gt;

&lt;p&gt;I will be covering the following topics in this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is WP-CLI?&lt;/li&gt;
&lt;li&gt;Migrate WordPress via WP-CLI&lt;/li&gt;
&lt;li&gt;Taking Backup of WordPress Files&lt;/li&gt;
&lt;li&gt;Importing WordPress Files to a New Server&lt;/li&gt;
&lt;li&gt;Taking the Database Backup&lt;/li&gt;
&lt;li&gt;Test and WordPress Website&lt;/li&gt;
&lt;li&gt;Search and Replace URLs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is WP-CLI?
&lt;/h2&gt;

&lt;p&gt;WordPress Command Line or (WP-CLI for short) is a dedicated command line interface tool for controlling WordPress. This enables users to run different commands, update WordPress files, install themes, and managing the plugins. This tool can also be used for WordPress website migration from one server to another. &lt;/p&gt;

&lt;p&gt;Let’s get started and see how easy it is to use the WP-CLI for WordPress migration.   &lt;/p&gt;

&lt;h2&gt;
  
  
  Migrate WordPress via WP-CLI
&lt;/h2&gt;

&lt;p&gt;WordPress Command Line is accessed through a terminal and in this tutorial, I will use the SSH-client &lt;a href="https://www.putty.org/"&gt;PuTTY&lt;/a&gt; for accessing the command line. You may use any SSH-client of your choice. &lt;/p&gt;

&lt;p&gt;You would require the following to access your existing server:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Server IP address&lt;/li&gt;
&lt;li&gt;Username&lt;/li&gt;
&lt;li&gt;Password&lt;/li&gt;
&lt;li&gt;Public Key&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Launch PuTTY desktop application and navigate to SSH → Auth.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbq2pwckg7y3leui2vqku.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbq2pwckg7y3leui2vqku.png" width="459" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, browse to the location where you have stored the public key of your server and navigate to Session inside the PuTTY window to enter the IP address of the server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4ao0w9ieqt79dt3wnnr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4ao0w9ieqt79dt3wnnr.png" width="452" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the Open button and log in with your credentials. (IMP: Make sure to log in as a root admin and supply the correct password).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrofgeb327f2z02qklo6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrofgeb327f2z02qklo6.png" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After accessing the server successfully via SSH terminal, let's go ahead and check if WP-CLI is installed on our server or not. For that, simply type the WP command below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wp --info&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Since I do not have the wp-cli installed, I will see the following error:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3zwe4k9fmmip4u2yqf9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3zwe4k9fmmip4u2yqf9.png" width="496" height="32"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s fix this by installing the WP-CLI. Run the following command in the SSH terminal of your old server. cd back to the opt folder by going all the way back to the root location. Keep running the command cd ../ command until you reach there. &lt;/p&gt;

&lt;p&gt;Install wp-cli by running the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This should install the WP-CLI. Next, confirm this typing the wp --info command. &lt;/p&gt;

&lt;p&gt;Now, change the file’s permission to make it executable.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod +x wp-cli.phar&lt;br&gt;
sudo mv wp-cli.phar /usr/local/bin/wp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Go back to the main WordPress folder and run the following command that should show you the version of your WordPress installation.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wp core version --allow-root&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmxcgsfk3nkpvi6ruc583.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmxcgsfk3nkpvi6ruc583.png" width="782" height="43"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s go ahead and take the backup of our WordPress website using WP-CLI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Back up WordPress Files Using WP-CLI
&lt;/h2&gt;

&lt;p&gt;Taking a backup using WP-CLI is easy. Navigate to the www folder or the folder which contains your WordPress website and create a zip file by running the following command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;zip -r wordpress.zip wordpress&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Move the zipped folder inside the WordPress website folder by running the command below.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv wordpress.zip&lt;/code&gt; wordpress where wordpress is the name of the folder which contains WordPress site.&lt;/p&gt;

&lt;p&gt;Now, navigate to the wordpress folder by running the cd command and you will find the wordpress.zip folder. &lt;/p&gt;

&lt;p&gt;The following screenshot summarizes the whole process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzc0jj9a4pajnnl8es50r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzc0jj9a4pajnnl8es50r.png" width="800" height="143"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I moved the zipped folder inside the main folder so that I can download it easily from my new server using the command below:&lt;/p&gt;

&lt;p&gt;http://[serverIP]/wordpress.zip OR http://[wordpress website location]/wordpress.zip depending upon your structure.&lt;/p&gt;

&lt;p&gt;Here, wordpress.zip is the folder name and since it's inside our main folder, it should be accessible via URL or from the location depending upon your settings. &lt;br&gt;
Import WordPress Files to a New Server&lt;br&gt;
If you are using Cloudways then launch its integrated SSH terminal otherwise, hook your new server using PuTTY. Navigate to your new WordPress website and inside the public_html folder, type the following command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wget http://[serverIP]/wordpress.zip&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will fetch the complete zipped folder from your older server through a URL. Once the transfer finishes, unzip the content of the folder by running the following command:&lt;/p&gt;

&lt;p&gt;unzip wordpress.zip&lt;/p&gt;

&lt;p&gt;And move all the content back to the parent directory (public_html) by running the following command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv * ../&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There you go! I have successfully fetched the zipped folder and moved the WordPress website to the new host.&lt;/p&gt;

&lt;h2&gt;
  
  
  Take the Database Backup
&lt;/h2&gt;

&lt;p&gt;We are halfway through our migration process. In the second half of our migration, we need to back up our MySQL database and for that, go back to your existing server and inside the SSH terminal type the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mysqldump --add-drop-table -h localhost -u wpuser -p wordpress &amp;gt; site.bak.sql&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;In the above command, I have supplied the following parameters. Please adjust them to match your values.&lt;/p&gt;

&lt;p&gt;-h localhost will stay the same&lt;br&gt;
-u is the username of your MySQL database&lt;br&gt;
wordpress is the name of the database.&lt;/p&gt;

&lt;p&gt;Supply the password after running this command. Once the command is executed, you will notice a new file has been created (with the name ‘site.bak.sql’). This contains the complete database of our WordPress site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7viuid44q05620apkw6m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7viuid44q05620apkw6m.png" width="800" height="67"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will create the backup file that can easily be exported to our new server using integrated SSH shell.&lt;/p&gt;

&lt;p&gt;Let’s transfer the .sql file using the similar scp command from the old server to the public_html folder of our new WordPress website hosted on our new server. &lt;/p&gt;

&lt;p&gt;Note: In this example, I am using Cloudways, this will override the existing database of WordPress website on Cloudways with the previous database.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;scp /var/www/site.bak.sql master_prgaekpebs@104.237.158.292:/home/master/applications/ewscfaavrd/public_html&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqmm3n0141foxhsuvw5ur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqmm3n0141foxhsuvw5ur.png" width="689" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, go back to Cloudways SSH terminal window and run the following command to import the database file. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;mysql -u ewscfaavrd -p ewscfaavrd &amp;lt; site.bak.sql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4h1b0s3qq8t7dpk6y0z2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4h1b0s3qq8t7dpk6y0z2.png" width="765" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-u ewscfaavrd This is the database username of the WordPress website on Cloudways&lt;br&gt;
-p ewscfaavrd This is the database name of the WordPress website on Cloudways&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0wx00tz6putxavbjatv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0wx00tz6putxavbjatv.png" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! I have successfully moved both the WordPress website files and database to my new server. You may also &lt;a href="https://www.cloudways.com/blog/migrate-wordpress-via-ssh-and-wp-cli/"&gt;migrate a WordPress site using SSH&lt;/a&gt; Command Line. Let’s go ahead and check if the WordPress website is properly operational or not. &lt;/p&gt;

&lt;h2&gt;
  
  
  Test and Run WordPress Website
&lt;/h2&gt;

&lt;p&gt;It is important that we test and run the WordPress website after moving it to a new server. For that, simply access the URL of your WordPress website either by your server IP or from the domain if you have already mapped your existing domain to your new server.&lt;/p&gt;

&lt;p&gt;While browsing the website, I came across the error page which tells me that my WordPress website is unable to connect with its database. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2w83wiah17nsouaku0ax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2w83wiah17nsouaku0ax.png" width="800" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can fix this by replacing the old database credentials inside our wp-config.php file with the new credentials provided by my new server which in my case is Cloudways. &lt;/p&gt;

&lt;p&gt;Go back to FileZilla and open the wp-config.php.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0if9kkydi3xq9b5l4lu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0if9kkydi3xq9b5l4lu.png" width="688" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inside the file, replace the DB_NAME, DB_USER, and DB_PASSWORD, save and close the file.&lt;/p&gt;

&lt;p&gt;Now I go back and reload the page, I can see my WordPress website running fine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg76z4qoelxdq07n8xxgx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg76z4qoelxdq07n8xxgx.png" width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, I have successfully moved the WordPress website and its database from my old server to its new hosting server using WP-CLI.&lt;/p&gt;

&lt;p&gt;The entire process might feel a bit lengthy, but it’s faster and secure. Now, if you have a small website, use any of the popular migrator plugins for problem-free migrations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Search and Replace URLs
&lt;/h2&gt;

&lt;p&gt;At last, if you are moving your WordPress website to a new domain then you will also need to replace the URLs pointed to your old domain through a simple process.&lt;/p&gt;

&lt;p&gt;Inside your SSH terminal, run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wp search-replace "http://old-url.com" "https://new-url.com"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will first search for all the URLs and then replace them with the new URL provided in the later part of the command. Make sure to replace the URLs to match yours.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up!
&lt;/h2&gt;

&lt;p&gt;Using WP-CLI for WordPress migration may sound a bit unconventional method but if you follow the article above carefully, you will experience the most convenient and seamless migration experience. Not to mention, you will also learn your way around the command line. &lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>wordpress</category>
      <category>cli</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Laravel .env Files Exposed In Browsers</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Thu, 03 Jan 2019 06:22:02 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/laravel-env-files-exposed-in-browsers-28l</link>
      <guid>https://forem.com/_shahroznawaz/laravel-env-files-exposed-in-browsers-28l</guid>
      <description>&lt;p&gt;What would be your secure directory structure when working with Laravel framework. The sensitive files like .env should not be exposed in the browsers. It contains sensitive information like database, mail, payment API credentials.&lt;/p&gt;

&lt;p&gt;I just google &lt;code&gt;DB_USERNAME filetype:env&lt;/code&gt; and dang hundreds of .env files are exposed in the browser. How would you save that?&lt;/p&gt;

&lt;p&gt;I did the tweet also: &lt;a href="https://twitter.com/_shahroznawaz/status/1080393723412967424"&gt;https://twitter.com/_shahroznawaz/status/1080393723412967424&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>laravel</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Let's take a break and discuss how developers spend the vacations? </title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Mon, 10 Dec 2018 10:55:45 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/lets-take-a-break-and-discuss-how-developers-spend-the-vacations--599g</link>
      <guid>https://forem.com/_shahroznawaz/lets-take-a-break-and-discuss-how-developers-spend-the-vacations--599g</guid>
      <description>&lt;p&gt;As we all know that long vacations are just around the corner. Let's discuss what plans do you have for spending this time. Are you still thinking to play with codes or spot the places to visit this vacations? :D &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>developers</category>
      <category>vacations</category>
    </item>
    <item>
      <title>Hi, I'm Shahroze Nawaz, web developer, cloud hosting advisor and community specialist at Cloudways. AMA</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Mon, 14 May 2018 11:35:36 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/hi-im-shahroze-nawaz-web-developer-cloud-hosting-adviser-and-community-specialist-at-cloudways-ama-266i</link>
      <guid>https://forem.com/_shahroznawaz/hi-im-shahroze-nawaz-web-developer-cloud-hosting-adviser-and-community-specialist-at-cloudways-ama-266i</guid>
      <description>&lt;p&gt;Hey, developers! I'm Shahroze Nawaz, the Community Manager at &lt;a href="https://www.cloudways.com/en/"&gt;Cloudways&lt;/a&gt;, A managed cloud hosting platform for growing businesses. I've been working in the developer community for advising best cloud hosting solutions like Cloudways which allows developers, Designers, eCommerce store owners, Site owners to launch their websites and applications on six cloud providers including DigitalOcean, Linode, Vultr, Amazon Cloud, Google Cloud and KYUP containers.&lt;/p&gt;

&lt;p&gt;You can launch cloud servers on these providers with few clicks and manage all the server settings from Cloudways platform. &lt;/p&gt;

&lt;p&gt;I've been working on few PHP/JS frameworks for educating budding developers with my tutorials and article on the internet and so far appreciated by thousands of people getting massive views. &lt;/p&gt;

&lt;p&gt;Now, I'm here to answer back your questions/confusions regarding hosting solutions for your next web project. Feel free to ask me anything regarding web hosting, development, and Cloudways. :)&lt;/p&gt;

&lt;p&gt;You can follow me on Twitter &lt;a href="https://twitter.com/_shahroznawaz"&gt;@_shahroznawaz&lt;/a&gt;, &lt;/p&gt;

</description>
      <category>ama</category>
      <category>hosting</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Create A Messenger Chatbot for Your Business Needs in PHP</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Thu, 22 Feb 2018 13:53:08 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/create-a-basic-chatbot-for-your-business-needs-in-php--1h8m</link>
      <guid>https://forem.com/_shahroznawaz/create-a-basic-chatbot-for-your-business-needs-in-php--1h8m</guid>
      <description>&lt;p&gt;Chatbots are the latest sensation in social media communication channels. These automated chat systems are especially employed to receive visitors on social media chats and provide basic information to the visitors. This information could include event schedules, product information, latest deals, store offers and general information about the brand. &lt;/p&gt;

&lt;p&gt;Entrepreneurs and brand marketers employ chatbots to handle the bulk of chats queries. This way, a large number of queries could be easily handled with minimum costs. Chatbots help reduces the dependence on human customer service representatives (CSR). These chatbots vet out common queries so that the human CSR cold focus on queries that require processing of multiple information sources.  Since chatbots steer all conversation toward a pre-set direction, it is easy and time-efficient to use these chatbots instead of human CSR.&lt;/p&gt;

&lt;p&gt;In this article, I will create a simple Facebook chatbot that could carry out an effective conversation with the users. The process of creating the chatbot comprises of several interconnected steps. &lt;br&gt;
Create a Page on Facebook&lt;/p&gt;

&lt;p&gt;The first step is the creation of a Facebook page. This requires an active account. Login and then create a page. Select the appropriate category and then fill in required information including page name, address and contact information. Complete the process of page creation. For the purpose of this tutorial, I have created a page named Cloudways School. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa5jn51zann7otrj5xu4w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa5jn51zann7otrj5xu4w.png" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Create a Facebook Application
&lt;/h2&gt;

&lt;p&gt;The second step is the creation of the Facebook application that interfaces between the chatbot and the facebook page chat. To create the app, go to Facebook Developers page and click Add New App. Add all required information and click Create App ID button. Facebook might ask you to verify a CAPTCHA code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq2b1buhyz364lra4gdo6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq2b1buhyz364lra4gdo6.png" width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The app will appear in the developer dashboard. Open the application and add messenger platform to the app.&lt;/p&gt;

&lt;p&gt;Next, add the webhook that connects the app to the website. To add the webhook, generate the page access token. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4imwa5qp3sb9eq4i8od.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4imwa5qp3sb9eq4i8od.png" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, define the callback URL and the access token. Right below the token generation tab, go to the Webhook tab and click Setup Webhooks.Insert the URL. note that, in order for this to work,  the URL must be in https format. &lt;/p&gt;
&lt;h2&gt;
  
  
  Create bot.php File
&lt;/h2&gt;

&lt;p&gt;The Facebook app is now active. I will now create the file for the bot.&lt;/p&gt;

&lt;p&gt;Create a new file named bot.php and add the following code to it. This code is based on Remy Mellet’s code of a simple Facebook Messenger bot. I have added more code that handle structured messages sent to the bot.  The basic code is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.cloudways.com/blog/summer-discount-offer-on-hosting/" rel="noopener noreferrer"&gt;Forget BFCM! Save, Scale and Win Cloudways Swag This Summer! (Giveaway)&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// parameters&lt;/span&gt;
&lt;span class="nv"&gt;$hubVerifyToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'cloudwaysschool'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$accessToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;   &lt;span class="s2"&gt;"EAxxxxxxxxxxxqgBAKWAgizvoHnQLZBR7ZxxxxxxxxxxxxxxxxxxxxxxxxxxxxxptYSymSdocFFCp1ink3EHRVMrCSxxxxxxxxxxxxxxxxxxxxwMZApStyA8GbqAxxxxxxxxxxxxxxxxxxxxxxxxxxx9R6QttFVyNS4ZBurwZDZD"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// check token at setup&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$_REQUEST&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'hub_verify_token'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nv"&gt;$hubVerifyToken&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$_REQUEST&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'hub_challenge'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="k"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// handle bot's anwser&lt;/span&gt;
&lt;span class="nv"&gt;$input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;file_get_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'php://input'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nv"&gt;$senderId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'entry'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'messaging'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'sender'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'id'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nv"&gt;$messageText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'entry'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'messaging'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'message'&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;'text'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;//set Message&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$messageText&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"hi"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//send message to facebook bot&lt;/span&gt;
&lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'recipient'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="s1"&gt;'id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$senderId&lt;/span&gt; &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="s1"&gt;'text'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$answer&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="nv"&gt;$ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_init&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://graph.facebook.com/v2.6/me/messages?access_token='&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;$accessToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_POST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_POSTFIELDS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_HTTPHEADER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="p"&gt;)){&lt;/span&gt;
&lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;curl_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The $hubVerifyToken should contain the same value as the value provided in the webhook token value. In this case, I have set up both values to cloudwaysschool in both the code and the webhook. Once the challenge has been successfully validated, the incoming message is collected in $input. From this, sender ID is extracted into $senderId and the message text in  $messageText. Next, the string in messageText is matched with exact keywords and a pre-selected response is sent. &lt;/p&gt;

&lt;p&gt;For instance, if the user sends Hi, the keyword is matched and triggers a reply.  The code that executes this function is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$messageText&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"hi"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//send message to facebook bot&lt;/span&gt;
&lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'recipient'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="s1"&gt;'id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$senderId&lt;/span&gt; &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="s1"&gt;'text'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$answer&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the message is sent using CURL by passing $response as the response..&lt;/p&gt;

&lt;h2&gt;
  
  
  Upload and Test bot.php
&lt;/h2&gt;

&lt;p&gt;Since the Facebook webhooks supports only https, bot.php could only be tested on a hosting platform that supports SSL. Fortunately, all top hosting providers offer some form of SSL. For the purpose of this tutorial, I am using &lt;a href="https://platform.cloudways.com/signup" rel="noopener noreferrer"&gt;Cloudways&lt;/a&gt;. I have installed Letsencrypt for my application and point it to the domain. A staging URL is always provided with every Cloudways app. However, I have pointed my domain to symfonyfeed.com. Simply upload bot.php in public_html folder using Filezilla.&lt;/p&gt;

&lt;p&gt;At this point, when you say hi on the facebook page,  you will get hello in reply.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfl8u08cu80vfo4xip23.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfl8u08cu80vfo4xip23.png" width="260" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Send Structured Messages
&lt;/h2&gt;

&lt;p&gt;In addition to Hello , in reply to hi, Facebook Messenger also provides several interesting template messages that cover latest news, image and list messages. Button links could also be sent in response. Some common message templates are: &lt;/p&gt;

&lt;p&gt;-Button Template&lt;br&gt;
-Generic Template&lt;br&gt;
-List Template&lt;br&gt;
-Receipt Template&lt;/p&gt;

&lt;p&gt;I will explain you some of the templates here to kickstart your 1st messenger bot in php. You can see the complete documentation for the message templates could be found here. &lt;/p&gt;
&lt;h2&gt;
  
  
  Generic Message
&lt;/h2&gt;

&lt;p&gt;Facebook Messenger provides several templates that could be used to send responses to the users. For example, if a user wishes to inquire about the latest blog on your website, they could send a blog. The generic response would be like: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9ohz91hzaozwdgcv7bp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9ohz91hzaozwdgcv7bp.png" width="264" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s make a new condition for this message. Try out the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$messageText&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"blog"&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
     &lt;span class="nv"&gt;$answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"attachment"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"template"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s2"&gt;"payload"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"template_type"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"generic"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"elements"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"Welcome to Peter\'s Hats"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"item_url"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"https://www.cloudways.com/blog/migrate-symfony-from-cpanel-to-cloud-hosting/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"image_url"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"https://www.cloudways.com/blog/wp-content/uploads/Migrating-Your-Symfony-Website-To-Cloudways-Banner.jpg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"subtitle"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"We\'ve got the right hat for everyone."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"buttons"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
              &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"web_url"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"https://petersfancybrownhats.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"View Website"&lt;/span&gt;
              &lt;span class="p"&gt;],&lt;/span&gt;
              &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"postback"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"Start Chatting"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"payload"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"DEVELOPER_DEFINED_PAYLOAD"&lt;/span&gt;
              &lt;span class="p"&gt;]&lt;/span&gt;              
            &lt;span class="p"&gt;]&lt;/span&gt;
          &lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;]];&lt;/span&gt;

     &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'recipient'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="s1"&gt;'id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$senderId&lt;/span&gt; &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$answer&lt;/span&gt; 
&lt;span class="p"&gt;];}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  List Messages
&lt;/h2&gt;

&lt;p&gt;Facebook Messenger bot could also send lists in response to the users’ queries. For instance, if the user wishes to see the list of all the latest blogs published, all the user could send today. In response, the bot sends a list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp53qz1grqhrrc6liz2c9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp53qz1grqhrrc6liz2c9.png" width="262" height="338"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Add this code to bot.php to test this option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if($messageText == "today"){

 $answer = ["attachment"=&amp;gt;[
      "type"=&amp;gt;"template",
      "payload"=&amp;gt;[
        "template_type"=&amp;gt;"list",
        "elements"=&amp;gt;[
          [
             "title"=&amp;gt; "Classic T-Shirt Collection",
                    "image_url"=&amp;gt; "https://www.cloudways.com/blog/wp-content/uploads/Migrating-Your-Symfony-Website-To-Cloudways-Banner.jpg",
                    "subtitle"=&amp;gt; "See all our colors",
                    "default_action"=&amp;gt; [
                        "type"=&amp;gt; "web_url",
                        "url"=&amp;gt; "https://www.cloudways.com/blog/migrate-symfony-from-cpanel-to-cloud-hosting/",                       
                        "webview_height_ratio"=&amp;gt; "tall",
                        // "messenger_extensions"=&amp;gt; true,
                        // "fallback_url"=&amp;gt; "https://peterssendreceiveapp.ngrok.io/"
                    ],
            "buttons"=&amp;gt;[
              [
                "type"=&amp;gt;"web_url",
                "url"=&amp;gt;"https://petersfancybrownhats.com",
                "title"=&amp;gt;"View Website"
              ],
            ]
          ],
            [
            "title"=&amp;gt;"Welcome to Peter\'s Hats",
            "item_url"=&amp;gt;"https://www.cloudways.com/blog/migrate-symfony-from-cpanel-to-cloud-hosting/",
            "image_url"=&amp;gt;"https://www.cloudways.com/blog/wp-content/uploads/Migrating-Your-Symfony-Website-To-Cloudways-Banner.jpg",
            "subtitle"=&amp;gt;"We\'ve got the right hat for everyone.",
            "buttons"=&amp;gt;[
              [
                "type"=&amp;gt;"web_url",
                "url"=&amp;gt;"https://petersfancybrownhats.com",
                "title"=&amp;gt;"View Website"
              ],
            ]
          ],
            [
            "title"=&amp;gt;"Welcome to Peter\'s Hats",
            "item_url"=&amp;gt;"https://www.cloudways.com/blog/migrate-symfony-from-cpanel-to-cloud-hosting/",
            "image_url"=&amp;gt;"https://www.cloudways.com/blog/wp-content/uploads/Migrating-Your-Symfony-Website-To-Cloudways-Banner.jpg",
            "subtitle"=&amp;gt;"We\'ve got the right hat for everyone.",
            "buttons"=&amp;gt;[
              [
                "type"=&amp;gt;"web_url",
                "url"=&amp;gt;"https://petersfancybrownhats.com",
                "title"=&amp;gt;"View Website"
              ],
            ]
          ]

        ]
      ]
    ]];

  $response = [
    'recipient' =&amp;gt; [ 'id' =&amp;gt; $senderId ],
    'message' =&amp;gt; $answer
];


}
elseif($messageText == "hi") {
    $answer = "Hello";
      $response = [
    'recipient' =&amp;gt; [ 'id' =&amp;gt; $senderId ],
    'message' =&amp;gt; [ 'text' =&amp;gt; $answer ]
];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Button Messages
&lt;/h2&gt;

&lt;p&gt;Facebook Messenger could also send actionable buttons as a response. For example, if the user asks for more the response would be: &lt;/p&gt;

&lt;p&gt;To send buttons as response, try out the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$messageText&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"more"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nv"&gt;$answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"attachment"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"template"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="s2"&gt;"payload"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"template_type"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"button"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"text"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"What do you want to do next?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"buttons"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"web_url"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"https://petersapparel.parseapp.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"Show Website"&lt;/span&gt;
          &lt;span class="p"&gt;],&lt;/span&gt;
          &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"postback"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"Start Chatting"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"payload"&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="s2"&gt;"USER_DEFINED_PAYLOAD"&lt;/span&gt;
          &lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;]];&lt;/span&gt;

      &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'recipient'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="s1"&gt;'id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$senderId&lt;/span&gt; &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$answer&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this tutorial, I discussed how to setup a basic Facebook Messenger to cater to your visitors. I highlighted how to use both generic and structured responses that add a lot to the volume of the conversation. I hope you are able to follow the code and implementation of various messages via PHP. &lt;/p&gt;

&lt;p&gt;If you have a question about the code or would like to add to the discussion, leave a comment below. &lt;/p&gt;

</description>
      <category>showdev</category>
      <category>php</category>
      <category>bots</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How I Automated Symfony Deployment with Envoyer</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Thu, 28 Dec 2017 13:00:19 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/how-i-automated-symfony-deployment-with-envoyer-212f</link>
      <guid>https://forem.com/_shahroznawaz/how-i-automated-symfony-deployment-with-envoyer-212f</guid>
      <description>&lt;p&gt;Developers have different options and tools to create automatic deployments for their projects. These automatic deployments options ensure that no time is wasted on adding new coding blocks manually between the files. The good news is that developers cold choose from a lot of deployment tools now including DeployBot and DeployHQ.&lt;/p&gt;

&lt;p&gt;For the purpose of this article, I’ve picked the popular zero-time deployment tool ‘Envoyer’, created by Laravel’s creator Taylor Otwell. While Envoyer is considered the “default” option for deploying Laravel apps, I will demonstrate its capabilities of &lt;a href="https://www.cloudways.com/blog/host-symfony-on-linode/" rel="noopener noreferrer"&gt;deploying Symfony applications on Cloudways&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The team behind Symfony recently published the latest versions of Symfony, 3.4 and 4.0. These versions have different structure when compared to the standard release versions. I will not go into the details of &lt;a href="http://symfony.com/4" rel="noopener noreferrer"&gt;Symfony 4&lt;/a&gt;. Similarly, if you wish to upgrade Symfony 3.x to version 4, follow this &lt;a href="https://github.com/symfony/symfony/blob/master/UPGRADE-4.0.md" rel="noopener noreferrer"&gt;detailed upgrade guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So now, back to the point.&lt;/p&gt;

&lt;p&gt;Envoyer is a deployment tool used for the deployment of PHP applications. The best thing about the tool is the zero downtime during deployment. This means that your application and the customers using it are not even aware of the fact that a new version has been pushed. Envoyer works well with major repository management platforms such as Github, GitLab, and Bitbucket. Other benefits include unlimited deployments and team members. &lt;/p&gt;

&lt;p&gt;The following tutorial will guide you through the process of deploying Symfony applications on Cloudways using Envoyer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create an Envoyer Account and Add a Project
&lt;/h2&gt;

&lt;p&gt;Create an Envoyer account and login to it. Next, add a new project. For the purpose of this tutorial, I am signing in using my Github account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage2-68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage2-68.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect GitHub Repository
&lt;/h2&gt;

&lt;p&gt;Next, connect your Github Repository. Just copy the username/repository for Github repo URL and paste it into the input box. Since I am not deploying a Laravel app, choose the Other radio button, and hit the Save Project button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage5-42.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage5-42.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project will be added to the account and the GitHub repository will now be connected to Envoyer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage10-63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage10-63.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add the Server
&lt;/h2&gt;

&lt;p&gt;The next step is to integrate the Cloudways server. For this, head to the Server tab and click the Add Server button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage12-44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage12-44.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, login to your Cloudways account and get the credentials for adding the server from the Master Credentials section inside the Server Management tab of the Cloudways Console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage9-27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage9-27.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fill out all the required fields and enter the complete absolute path of your Cloudways application and save the server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage8-31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage8-31.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After saving the server, you will be provided with an SSH key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage13-38.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage13-38.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the key and head over to your Cloudways Console and click the ‘SSH Public Keys’ button. Give a label to your key and click Submit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage1-72.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage1-72.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After adding the SSH key, you should be able to connect to your server. Click the tiny Refresh button to test the connection status.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Deployment
&lt;/h2&gt;

&lt;p&gt;At this point, everything is correctly set up. The final step is to click the Deploy button for actual project deployment. You can also deploy applications via Git Push by selecting ‘Deploy when the code is pushed’ option in the settings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage2-68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage2-68.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Envoyer will ask you from which branch or tag you need to deploy the application code. I selected the Default Branch, which is the master branch as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage4-55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage4-55.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit the Deploy button now.The deployment process could be viewed in the deployment tab. You can get additional information related to deployment by clicking the arrow button next to the deployment status.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage7-30.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage7-30.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can clearly see that Envoyer takes minimal time to deploy the application on your server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment Folders on Cloudways
&lt;/h2&gt;

&lt;p&gt;Once deployed, login to the SSH terminal on Cloudways, and move to your application folder. You will find two folders, current &amp;amp; releases.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage14-33.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage14-33.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The current folder have the main application which is in development and the release folder contains the previous releases folder named with date and time of the deployments.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage11-49.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage11-49.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You could check the status of your application from three locations(New York, London, Singapore). In case of a disaster, you have the option of rolling back the current deployment. For this, enable this option by providing the health check URL in the settings. Additionally, you can set up heartbeats to monitor cron jobs for your application. You could also set up a notification channel like Slack and Hipchat to receive deployment related notifications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage6-41.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage6-41.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping it all up
&lt;/h2&gt;

&lt;p&gt;As you could see, Envoyer is a great option for deploying PHP apps. The process is simple and you could directly connect the process to a version control platform to ensure that the latest version of the app is deployed at all times. If you need help with the process, do post a comment, and I will get back to you.&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>php</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Here's What Cloudways is Giving to Developers This Christmas Eve.</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Sat, 23 Dec 2017 08:08:39 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/heres-what-cloudway-is-giving-to-developers-this-christmas-eve-bh4</link>
      <guid>https://forem.com/_shahroznawaz/heres-what-cloudway-is-giving-to-developers-this-christmas-eve-bh4</guid>
      <description>&lt;p&gt;&lt;a href="https://www.cloudways.com/en/php-cloud-hosting.php"&gt;Cloudways&lt;/a&gt; is a managed cloud hosting platform for PHP applications, CMS, and Frameworks. Providing the best six providers including DigitalOcean, Linode, AWS, Vultr, Kyup, and GCE.You can Launch Servers and applications with the complete stack on the above providers in few clicks and enjoy the discounts credit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The ThunderStack
&lt;/h2&gt;

&lt;p&gt;Cloudways Engineers has built their own PHP Thunderstack on the top of best technologies:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B-sbnpLT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cloudways.com/blog/wp-content/uploads/stack-linode-cloudways-768x448.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B-sbnpLT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.cloudways.com/blog/wp-content/uploads/stack-linode-cloudways-768x448.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Exceptional Features
&lt;/h2&gt;

&lt;p&gt;Here are some of the features you must know about.  &lt;/p&gt;

&lt;p&gt;1.Choose from Multiple Cloud Infrastructures like DigitalOcean, Google, Amazon, and more.&lt;/p&gt;

&lt;p&gt;2.Deploy multiple web applications, including WordPress, Magento, Drupal, WooCommerce and PHP Based apps.&lt;/p&gt;

&lt;p&gt;3.Get real-time insights about your servers on popular channels with integrated CloudwaysBot.&lt;/p&gt;

&lt;p&gt;4.Deploy servers on multiple datacenters&lt;/p&gt;

&lt;p&gt;5.Cloudways gives you 24/7 support with Live Chat and ticketing system&lt;/p&gt;

&lt;p&gt;6.Most operations on Cloudways can be performed in 1-Click, like Cloning, Backups, Restore, and Server Scaling.&lt;/p&gt;

&lt;p&gt;7.Build awesome web applications by collaborating with your team from within the Platform.&lt;/p&gt;

&lt;p&gt;8.Test your web applications before going live on the built-in staging mechanism&lt;br&gt;
Monitor 15+ applications from within the Platform.&lt;/p&gt;

&lt;p&gt;9.You can deploy FREE SSL from Let's Encrypt in 1-Click.&lt;/p&gt;

&lt;p&gt;10.Thunderstack, in-house caching recipe, ensures that your websites load 100 times faster than average.&lt;/p&gt;

&lt;p&gt;11.Manage a lot of website from the Cloudways Platform using the Projects feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sit Back &amp;amp; Relax
&lt;/h2&gt;

&lt;p&gt;So, what you need to do this Christmas🎄? Nothing sit back, relax, control your web applications and servers with mouse clicks. Here's the demo:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3NUUamwN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://www.cloudways.com/blog/wp-content/uploads/launch-linode.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3NUUamwN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://www.cloudways.com/blog/wp-content/uploads/launch-linode.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>php</category>
      <category>showdev</category>
      <category>devops</category>
    </item>
    <item>
      <title>$1 CloudwaysCDN- Get Global Reach for your PHP Applications</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Fri, 13 Oct 2017 14:49:24 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/1-cloudwayscdn--get-global-reach-for-your-php-applications-24a</link>
      <guid>https://forem.com/_shahroznawaz/1-cloudwayscdn--get-global-reach-for-your-php-applications-24a</guid>
      <description>&lt;p&gt;Over years, PHP has consolidated its position as the preferred development language for legacy and real-time projects. With the recent release of PHP versions, the language is now in a great position to help developers launch RAD enabled apps quickly.&lt;/p&gt;

&lt;p&gt;At Cloudways, we try to facilitate PHP developers in launching their projects without worrying about the hassles of server management. Our about-to-be-released Content Delivery System (CDN) is a continuation of this commitment. In this article, I will go over the process of enabling and configuring CloudwaysCDN for your PHP applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.cloudways.com/blog/host-php-on-digitalocean/" rel="noopener noreferrer"&gt;Cloudways server with PHP application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.cloudways.com/blog/install-symfony-3-on-cloud/" rel="noopener noreferrer"&gt;Symfony installed on the server&lt;/a&gt; (or Symfony Flex enabled application)&lt;/li&gt;
&lt;li&gt;Your domain should be mapped&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can follow the following GIF to launch a server and a PHP application on Cloudways. By default, you will get PHP 7.0; however, you could downgrade or upgrade to PHP 5.6 or 7.1.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm85w0slm723q17gqqbze.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm85w0slm723q17gqqbze.gif" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First of all, let’s talk about CDN, and why you need to integrate it into PHP projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is CDN ?
&lt;/h2&gt;

&lt;p&gt;A CDN is a system of multiple servers which delivers static content (such as text, images) to the users. Instead of serving the static content from the original server, a CDN ensures that the user is served the data from the nearest location (a.k.a., points of presence, or PoPs). Each PoP contains a number of caching servers responsible for content delivery to visitors within its proximity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1lvmgt9mvqih1scgzwow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1lvmgt9mvqih1scgzwow.png" width="768" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why CDN is Necessary?
&lt;/h2&gt;

&lt;p&gt;CDN ensures speedy delivery of content, thus improving the speed of websites and web apps. When a CDN is active, the actual location of the website does not matter. The CDN ensures that the visitor receives the data from the nearest location. Since Symfony is well known for powering fintech and ecommerce applications,  CDn plays a central role in speeding up the user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enable CDN for PHP Apps on Cloudways
&lt;/h2&gt;

&lt;p&gt;When you login to your server, move to the Application tab and open the PHP application. You will see the tab for configuring CDN at the end of the options. When you click the tab, you will enter the CDN configuration screen. Here you will find the URL of the application to be inserted in the WEBSITE URL field and click the Create button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwbofrtzl96qdeq84hz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwbofrtzl96qdeq84hz0.png" width="768" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next you will get the newly generated URL for you Symfony application:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu7o9gqs830zlsnxkr1cv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu7o9gqs830zlsnxkr1cv.png" width="768" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Few things to note here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can view the bandwidth usage on this screen.&lt;/li&gt;
&lt;li&gt;You can always purge old content from CDN by using the Purge button.&lt;/li&gt;
&lt;li&gt;You can always remove your subscription anytime.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Integrate CDN URL in Application Assets
&lt;/h2&gt;

&lt;p&gt;In core PHP applications developers love to create their own usecases to integrate CDN. one use case will be to define the CDN url in php like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
define('CDN', 'https://3971-7889-2-raikfcquaxqncofqfm.stackpathdns.com/');
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, add it to every asset URL here asset means all the JS,Css and image files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img src="&amp;lt;?php echo CDN ?&amp;gt;images/portfolio/big/css.png"/&amp;gt;
&amp;lt;script type="text/javascript" src="&amp;lt;?php echo CDN ?&amp;gt;js/modernizr.custom.26633.js"&amp;gt;&amp;lt;/script&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The URL generated for the assets will look like this now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script type="text/javascript" src="&amp;lt;?php echo CDN ?&amp;gt;https://3971-7889-2-raikfcquaxqncofqfm.stackpathdns.com/js/modernizr.custom.26633.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is just one example although developers tries different usecase with the websites.&lt;/p&gt;

&lt;p&gt;Symfony provides easy configuration options for CDN services. If you know about &lt;code&gt;base_url&lt;/code&gt;, you are good to go. In the standard Symfony installation, move to &lt;strong&gt;app &amp;gt;&amp;gt; config&lt;/strong&gt; and open &lt;code&gt;config.yml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You need to find the asset settings in framework configs. Since our CDN is asset based, I will concatenate on the CDN Url as &lt;code&gt;base_url&lt;/code&gt; to every asset file in Symfony.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;framework:
  assets:
      base_urls:
          - 'https://3971-7889-2-raikfcquaxqncofqfm.stackpathdns.com/'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now clear your cache by running &lt;code&gt;rm -fr var/cache/*&lt;/code&gt; and check your Symfony application asset URLs:&lt;/p&gt;

&lt;p&gt;If you are using &lt;a href="https://www.cloudways.com/blog/using-symfony-flex/" rel="noopener noreferrer"&gt;Symfony Flex for application management&lt;/a&gt;, then in your project folder, move to &lt;strong&gt;config &amp;gt;&amp;gt; packages&lt;/strong&gt; folder and open &lt;code&gt;framework.yaml&lt;/code&gt; file. Add the same asset config as shown above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Cloudways have partnered with StackPath (formerly known as MaxCDN) and provide one-click activation for the Cloudways CDN. Note that, for a single website, the Monthly Subscription costs $1 per 25GB of bandwidth. You can avail this for any PHP website and framework based application.&lt;/p&gt;

</description>
      <category>php</category>
      <category>cdn</category>
      <category>symfony</category>
      <category>dev</category>
    </item>
    <item>
      <title>Created A bluewhale game on a learning Weekend</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Tue, 12 Sep 2017 09:39:47 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/created-a-bluewhale-game-on-a-learning-weekend</link>
      <guid>https://forem.com/_shahroznawaz/created-a-bluewhale-game-on-a-learning-weekend</guid>
      <description>&lt;p&gt;Hey Guys as I have started learning Game development in HTML5 on weekends so I've learn to make a simple game which is very basic till now. But you can play the game at:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://shahroznawaz.com/bluewhale/"&gt;https://shahroznawaz.com/bluewhale/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Phaser frameworks uses javascript to play with animations and transitions and give some builtin components which you can use to develop games.&lt;/p&gt;

&lt;p&gt;The game is bit newbie but I would love your advice and contributions on it :)&lt;/p&gt;

</description>
      <category>showdev</category>
    </item>
    <item>
      <title>Setting up a Lamp Stack on Debian Server</title>
      <dc:creator>Shahroz Nawaz</dc:creator>
      <pubDate>Thu, 17 Aug 2017 09:11:41 +0000</pubDate>
      <link>https://forem.com/_shahroznawaz/setting-up-a-lamp-stack-on-debian-server</link>
      <guid>https://forem.com/_shahroznawaz/setting-up-a-lamp-stack-on-debian-server</guid>
      <description>&lt;p&gt;We now have many web stacks to develop web applications rapidly on different operating systems. For instance, we have wamp, xamp, and Lamp stacks. All these stacks consist of some technologies. Our focus in this article is Lamp stack, which is a popular open source web platform used and endorsed by millions of developers to develop dynamic web applications on Linux servers. Lamp is a group of four open source technologies which are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Linux operating system&lt;/li&gt;
&lt;li&gt;Apache web server&lt;/li&gt;
&lt;li&gt;MySQL relational database&lt;/li&gt;
&lt;li&gt;PHP scripting language&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this tutorial, I will be setting up the Lamp stack on a Debian server. If you are a SysAdmin, and you are confused about how to set up Lamp stack, then you can follow the steps in this tutorial. I assume you have an empty Debian server with root access.&lt;/p&gt;

&lt;p&gt;Note: If you do not know about sysadmin process and creating the LAMP stack, you can use Cloudways &lt;a href="https://www.cloudways.com/en/php-cloud-hosting.php" rel="noopener noreferrer"&gt;&lt;strong&gt;Managed PHP Hosting&lt;/strong&gt;&lt;/a&gt;. The complete server containing Lamp stack and PHP app will be built in few min and you don’t need to worry about it.  &lt;/p&gt;

&lt;p&gt;Let's take a deep dive and start setting up Lamp stack on Debian server.&lt;/p&gt;

&lt;p&gt;But first, you need to update all the packages present on your server by running the following command in terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will update all your existing packages. You also need to know the server’s IP address. Run the following command in terminal to find out your server IP address&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ifconfig eth0 | grep inet | awk '{ print $2 }'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yay! You can see your IP address on screen. Note it down. You will need it in subsequent installation steps. So ninjas! We are ready to install other grouped technologies which are Apache, MySQL and PHP. Let's start with Apache.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Apache on Debian Server
&lt;/h2&gt;

&lt;p&gt;Apache is an open source HTTP server. Around 50% of the web applications are running on Apache with an aim to provide high-quality configurations to web apps. You can install Apache on Debian by running the following terminal command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt-get install apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run this, you will see a message for extra space. Just type "y" and hit enter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage04-32-768x160.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage04-32-768x160.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After finishing installation, run Server IP address in a browser which you have noted earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage00-49-768x577.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage00-49-768x577.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our first installation is complete. Now you can access your server and add files in &lt;code&gt;var/www/html&lt;/code&gt; folder  but many developers are familiar with public_html folder -- so maybe you wish to change this folder to &lt;code&gt;public_html&lt;/code&gt;. You need to edit 000-default.conf file exist in apache2/sites-enabled. Move to the folder by running the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd /etc/apache2/sites-enabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, run the vim command with file name to view this in terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vim 000-default.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find “Document root” and edit its path by pressing “i” key. Remove html and replace it with public_html. Press ESC key then type :wq to save the changes in terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage03-37-768x383.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage03-37-768x383.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also need to change the folder name from html to public_html. For this, move to the folder and use move command to change the folder name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd /var/www
$ mv html public_html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart your web server by typing the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ service apache2 restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So now we have installed Apache in our Debian server. Enter your IP address in the browser and check it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing MySQL on Debian
&lt;/h2&gt;

&lt;p&gt;The second main installation in this stack is MySQL relational database. To install MySQL, run the following command in terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt-get install mysql-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the installation finishes, a prompt will appear to set root password&lt;/p&gt;

&lt;p&gt;Enter the password and select ok. Now complete rest of the installation by typing the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press enter. You will be asked to enter root password, which you just setup. Type password and hit enter. &lt;/p&gt;

&lt;p&gt;-Type â€˜n’ in order to not change root password and hit enter&lt;br&gt;
-Type â€˜y’ to remove anonymous users and hit enter&lt;br&gt;
-Type â€˜n’ if you want to disallow root login remotely and hit enter&lt;br&gt;
-Now type â€˜y’ to remove test tables and databases and hit enter, then type â€˜y’ again and hit enter&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage05-24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage05-24.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may also need to install your favourite MySQL GUI client PHPMyAdmin.&lt;/p&gt;

&lt;p&gt;PHPMyAdmin is an open source GUI which helps in Managing MySQL databases. Let’s first setup a SSL with Apache so that our password isn’t sent in plain text form. Type the following to install a SSL with Apache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt-get install mcrypt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart Apache server by service command and type the following command to install PHPMyAdmin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt-get install phpmyadmin  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During the installation, a prompt will open which will ask you about the web server you are using. As we have installed Apache, so select Apache and press enter. After that, it will ask for the root user password. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage01-46-768x274.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage01-46-768x274.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter the password and press enter. &lt;/p&gt;

&lt;p&gt;PHPMyAdmin will be installed in &lt;code&gt;/usr/share/phpmyadmin&lt;/code&gt;. We will create it’s symlink inside the public_html folder. Type the following commands to route to public_html folder and create a symlink:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd /var/www/public_html
$ ln -s /usr/share/phpmyadmin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now type &lt;code&gt;ls&lt;/code&gt; to verify whether the symlink has been created or not. Open this in browser through [server ip address]/phpmyadmin. You will see that it is installed. Now let’s secure it. Create a .htaccess file using vim inside PHPMyAdmin folder and allowing only your server IP to access it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;order allow,deny
allow from &amp;lt;your server ip&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Installing PHP on Debian
&lt;/h2&gt;

&lt;p&gt;We have set up Apache and MySQL on Linux. Now the next and last stack member is PHP language to write web applications. PHP can be installed by running the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt-get install php5 php-pear php5-mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the installation of PHP, restart your Apache server by running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ service apache2 restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Move to your public_html folder by typing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd /var/www/public_html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a PHP file in this folder by typing the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vim index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following code line in it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php echo phpinfo();?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file by pressing ESC and then :wq. Run your IP address in the browser, you will see the PHP info page, which means PHP is installed on server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage02-39-768x443.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudways.com%2Fblog%2Fwp-content%2Fuploads%2Fimage02-39-768x443.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Words
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we have successfully set up Lamp stack on our server and we are ready to develop applications. If you are SysAdmin or server side developer, you can easily set up LAMP stack by following the tutorial step by step. This is not the end. You can also do more configurations and installations according to requirement by following the same road map.&lt;/p&gt;

</description>
      <category>lamp</category>
      <category>php</category>
      <category>webdev</category>
      <category>devtips</category>
    </item>
  </channel>
</rss>
