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

<channel>
	<title>PHP Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/php/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Mon, 31 Mar 2025 16:04:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>PHP Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/php/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Hosting DokuWiki for Documentation on ServerStadium Dedicated Servers</title>
		<link>https://serverstadium.com/knowledge-base/hosting-dokuwiki-documentation-dedicated-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Mon, 31 Mar 2025 16:04:18 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=12171</guid>

					<description><![CDATA[<p>Introduction This tutorial explains how to host DokuWiki – a lightweight, open-source wiki designed for documentation – on a ServerStadium dedicated server. With DokuWiki, you can easily manage and collaborate on documentation, and our high-performance dedicated servers provide a robust platform to support your wiki environment. Prerequisites Before you begin, ensure you have the following:&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/hosting-dokuwiki-documentation-dedicated-servers/">Hosting DokuWiki for Documentation on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This tutorial explains how to host DokuWiki – a lightweight, open-source wiki designed for documentation – on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a>. With DokuWiki, you can easily manage and collaborate on documentation, and our high-performance dedicated servers provide a robust platform to support your wiki environment.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p class="wp-block-paragraph">Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
  
  <li>A <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> running Ubuntu (or a similar Linux distribution).</li>
  
  
  <li>Basic command line knowledge and sudo privileges.</li>
  
  
  <li>A working LAMP stack (Apache, MySQL/MariaDB, and PHP) or the ability to install these components.</li>
  
  
  <li>Familiarity with PHP and basic web server configuration.</li>
  
</ul>



<h2 class="wp-block-heading">Deployment Steps</h2>



<h3 class="wp-block-heading">1. Update Your System</h3>



<p class="wp-block-paragraph">Start by updating your system packages to ensure you have the latest updates and security patches:</p>


<pre><code>sudo apt-get update && sudo apt-get upgrade -y</code></pre>


<h3 class="wp-block-heading">2. Install Apache, PHP, and Other Dependencies</h3>



<p class="wp-block-paragraph">If not already installed, set up the LAMP stack. For example, to install Apache and PHP:</p>


<pre><code>sudo apt-get install apache2 php php-xml php-json -y</code></pre>


<h3 class="wp-block-heading">3. Download and Install DokuWiki</h3>



<p class="wp-block-paragraph">Navigate to your web root directory (e.g., <code>/var/www/html</code>) and download the latest stable version of DokuWiki:</p>


<pre><code>cd /var/www/html
wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz -O dokuwiki.tgz</code></pre>


<p class="wp-block-paragraph">Extract the archive and rename the directory:</p>


<pre><code>tar -xzvf dokuwiki.tgz
mv dokuwiki-* dokuwiki</code></pre>


<p class="wp-block-paragraph">Set proper permissions so that the web server can access the files:</p>


<pre><code>sudo chown -R www-data:www-data /var/www/html/dokuwiki</code></pre>


<h3 class="wp-block-heading">4. Configure Apache for DokuWiki</h3>



<p class="wp-block-paragraph">Create a new Apache virtual host configuration for DokuWiki:</p>


<pre><code>sudo nano /etc/apache2/sites-available/dokuwiki.conf</code></pre>


<p class="wp-block-paragraph">Add the following configuration (adjust <code>ServerName</code> and <code>DocumentRoot</code> as needed):</p>


<pre><code>&lt;VirtualHost *:80&gt;
    ServerAdmin admin@yourdomain.com
    ServerName yourdomain.com
    DocumentRoot /var/www/html/dokuwiki

    &lt;Directory /var/www/html/dokuwiki&gt;
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    &lt;/Directory&gt;

    ErrorLog ${APACHE_LOG_DIR}/dokuwiki_error.log
    CustomLog ${APACHE_LOG_DIR}/dokuwiki_access.log combined
&lt;/VirtualHost&gt;</code></pre>


<p class="wp-block-paragraph">Enable the new site and the Apache rewrite module, then reload Apache:</p>


<pre><code>sudo a2ensite dokuwiki.conf
sudo a2enmod rewrite
sudo systemctl reload apache2</code></pre>


<h3 class="wp-block-heading">5. Complete DokuWiki Setup</h3>



<p class="wp-block-paragraph">Open your web browser and navigate to <code>http://yourdomain.com</code> to access the DokuWiki setup page. Follow the on-screen instructions to complete the installation and initial configuration of your wiki.</p>



<h2 class="wp-block-heading">Post-Deployment Configuration</h2>



<p class="wp-block-paragraph">After installing DokuWiki, consider these enhancements to secure and optimize your documentation environment:</p>


<ul class="wp-block-list">
  
  <li>Configure SSL to secure your site using Let&#8217;s Encrypt or another certificate provider.</li>
  
  
  <li>Set up regular backups for your wiki data.</li>
  
  
  <li>Adjust DokuWiki settings and plugins to suit your documentation needs.</li>
  
</ul>
<!-- /wp:post-content -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting your DokuWiki on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> ensures a high-performance, scalable environment for your documentation and collaboration needs.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Troubleshooting</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>If you encounter issues during installation or configuration:</p>
<!-- /wp:paragraph -->

<ul class="wp-block-list">
  <!-- wp:list-item -->
  <li>Review Apache error logs located in <code>/var/log/apache2/</code> for any errors related to DokuWiki.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Ensure file permissions and ownership are correctly set for the DokuWiki directory.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Consult the DokuWiki documentation for configuration tips and troubleshooting steps.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Refer to our guides in the <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium Knowledge Base</a> for further assistance.</li>
  <!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting DokuWiki on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> provides a robust and scalable solution for managing your documentation. By following this guide, you can install and configure a secure DokuWiki environment that meets your collaboration and documentation needs. For more help or information about ServerStadium services, visit our <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">knowledge base</a> or the <a href="https://serverstadium.com/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium website</a>.</p>
<!-- /wp:paragraph -->
<p>The post <a href="https://serverstadium.com/knowledge-base/hosting-dokuwiki-documentation-dedicated-servers/">Hosting DokuWiki for Documentation on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Deploying a LEMP Stack on Ubuntu 22.04 on ServerStadium Dedicated Servers</title>
		<link>https://serverstadium.com/knowledge-base/deploying-lemp-stack-ubuntu2204-dedicated-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 28 Mar 2025 00:24:04 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=12153</guid>

					<description><![CDATA[<p>Introduction This guide provides step-by-step instructions to deploy a LEMP stack (Linux, Nginx, MySQL, and PHP) on Ubuntu 22.04 using a ServerStadium dedicated server. A LEMP stack is an ideal solution for hosting dynamic websites and web applications, delivering high performance and scalability. Prerequisites Before you begin, ensure you have the following: Deployment Steps 1.&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/deploying-lemp-stack-ubuntu2204-dedicated-servers/">Deploying a LEMP Stack on Ubuntu 22.04 on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This guide provides step-by-step instructions to deploy a LEMP stack (Linux, Nginx, MySQL, and PHP) on Ubuntu 22.04 using a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a>. A LEMP stack is an ideal solution for hosting dynamic websites and web applications, delivering high performance and scalability.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p class="wp-block-paragraph">Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
  
  <li>A <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> running Ubuntu 22.04.</li>
  
  
  <li>Basic command line knowledge and sudo privileges.</li>
  
  
  <li>An understanding of web server concepts.</li>
  
</ul>



<h2 class="wp-block-heading">Deployment Steps</h2>



<h3 class="wp-block-heading">1. Update Your System</h3>



<p class="wp-block-paragraph">First, update your system to ensure all packages are current:</p>


<pre><code>sudo apt-get update && sudo apt-get upgrade -y</code></pre>


<h3 class="wp-block-heading">2. Install Nginx</h3>



<p class="wp-block-paragraph">Install the Nginx web server:</p>


<pre><code>sudo apt-get install nginx -y</code></pre>


<p class="wp-block-paragraph">After installation, start and enable Nginx:</p>


<pre><code>sudo systemctl start nginx
sudo systemctl enable nginx</code></pre>


<h3 class="wp-block-heading">3. Install MySQL</h3>



<p class="wp-block-paragraph">Install MySQL server for database management:</p>


<pre><code>sudo apt-get install mysql-server -y</code></pre>


<p class="wp-block-paragraph">Secure your MySQL installation:</p>


<pre><code>sudo mysql_secure_installation</code></pre>


<h3 class="wp-block-heading">4. Install PHP</h3>



<p class="wp-block-paragraph">Install PHP and the necessary modules to work with Nginx and MySQL:</p>


<pre><code>sudo apt-get install php-fpm php-mysql -y</code></pre>


<p class="wp-block-paragraph">Verify that PHP is installed by checking the version:</p>


<pre><code>php -v</code></pre>


<h3 class="wp-block-heading">5. Configure Nginx to Use PHP Processor</h3>



<p class="wp-block-paragraph">Edit the default Nginx server block to enable PHP processing. Open the configuration file:</p>


<pre><code>sudo nano /etc/nginx/sites-available/default</code></pre>


<p class="wp-block-paragraph">Modify the file to include the following configuration within the server block. Ensure the location for PHP files is set as shown:</p>


<pre><code>server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;
    index index.php index.html index.htm;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}</code></pre>


<p class="wp-block-paragraph">Save and exit the editor, then test the Nginx configuration for syntax errors:</p>


<pre><code>sudo nginx -t</code></pre>


<p class="wp-block-paragraph">If the test is successful, reload Nginx:</p>


<pre><code>sudo systemctl reload nginx</code></pre>


<h3 class="wp-block-heading">6. Verify Your LEMP Stack Installation</h3>



<p class="wp-block-paragraph">Create a PHP info file to confirm that PHP is processing correctly:</p>


<pre><code>sudo nano /var/www/html/info.php</code></pre>


<p class="wp-block-paragraph">Add the following content to the file:</p>


<pre><code>&lt;?php
phpinfo();
?&gt;</code></pre>


<p class="wp-block-paragraph">Save and exit, then open a web browser and navigate to <code>http://your_server_ip/info.php</code> to view the PHP info page.</p>



<h2 class="wp-block-heading">Post-Deployment Configuration</h2>



<p class="wp-block-paragraph">After deploying the LEMP stack, consider the following enhancements:</p>


<ul class="wp-block-list">
  
  <li>Secure your server by configuring UFW or another firewall to limit access.</li>
  
  
  <li>Optimize PHP and Nginx settings based on your application requirements.</li>
  
  
  <li>Set up regular backups and monitor server performance.</li>
  
</ul>
<!-- /wp:post-content -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting your LEMP stack on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> ensures you benefit from a high-performance, scalable environment for running your web applications.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Troubleshooting</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>If you encounter issues during installation or configuration:</p>
<!-- /wp:paragraph -->

<ul class="wp-block-list">
  <!-- wp:list-item -->
  <li>Ensure all prerequisites are installed and updated.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Review configuration files for Nginx, PHP, and MySQL for any errors.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Consult the logs in <code>/var/log/nginx/</code>, <code>/var/log/mysql/</code>, and <code>/var/log/php/</code> for troubleshooting details.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Refer to our guides in the <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium Knowledge Base</a> for additional support.</li>
  <!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Deploying a LEMP stack on Ubuntu 22.04 on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> provides a robust foundation for hosting dynamic websites and applications. By following this guide, you ensure that your server is optimized for performance and security. For more help or information about ServerStadium services, visit our <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">knowledge base</a> or the <a href="https://serverstadium.com/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium website</a>.</p>
<!-- /wp:paragraph -->
<p>The post <a href="https://serverstadium.com/knowledge-base/deploying-lemp-stack-ubuntu2204-dedicated-servers/">Deploying a LEMP Stack on Ubuntu 22.04 on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Installing LAMP in Ubuntu</title>
		<link>https://serverstadium.com/knowledge-base/installing-lamp-in-ubuntu/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 15 Sep 2020 07:14:56 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=188</guid>

					<description><![CDATA[<p>LAMP (Linux, Apache, MySQL, PHP) is a software stack that is quite popular for Ubuntu users to host dynamic websites and web applications written in PHP. To use LAMP properly, we must install Apache, MySQL, and PHP packages individually. Here are the steps for installing and configuring LAMP in the ServerStadium Virtual Machine that uses&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-lamp-in-ubuntu/">Installing LAMP in Ubuntu</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">LAMP (Linux, Apache, MySQL, PHP) is a software stack that is quite popular for Ubuntu users to host dynamic websites and web applications written in PHP.</p>



<p class="wp-block-paragraph">To use LAMP properly, we must install Apache, MySQL, and PHP packages individually. Here are the steps for installing and configuring LAMP in the ServerStadium Virtual Machine that uses the Ubuntu operating system.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 1 &#8211; Installing Apache2</strong></h2>



<p class="wp-block-paragraph">Apache2 is the most famous web server with the most users worldwide. Therefore, it still is a great choice for hosting a website.<br />To begin with, update the Ubuntu repository with the command :</p>



<pre class="wp-block-code"><code># apt update</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" width="313" height="20" class="wp-image-196" src="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2.png 313w, https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-300x19.png 300w" sizes="(max-width: 313px) 100vw, 313px" /></figure>



<p class="wp-block-paragraph">Then, install the Apache2 package with the command :</p>



<pre class="wp-block-code"><code># apt install apache2</code></pre>



<figure class="wp-block-image size-large"><img decoding="async" width="489" height="21" class="wp-image-197" src="https://serverstadium.com/wp-content/uploads/2020/09/002_ver2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002_ver2.png 489w, https://serverstadium.com/wp-content/uploads/2020/09/002_ver2-300x13.png 300w" sizes="(max-width: 489px) 100vw, 489px" /></figure>



<p class="wp-block-paragraph"><mark class="has-inline-color has-vivid-red-color" style="background-color: rgba(0, 0, 0, 0);">Don&#8217;t forget</mark> to add <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 80</mark> to the Network Security Profile. For example, I&#8217;m allowing all IP Addresses to access <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 80</mark> on this Virtual Machine.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="780" height="78" class="wp-image-194" src="https://serverstadium.com/wp-content/uploads/2020/09/003-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-1.png 780w, https://serverstadium.com/wp-content/uploads/2020/09/003-1-300x30.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/003-1-768x77.png 768w" sizes="(max-width: 780px) 100vw, 780px" /></figure>



<p class="wp-block-paragraph">After that, access the Virtual Machine Public IP Address with a web browser. If the installation succeeds, it should display the Apache2 Ubuntu Default Page, as shown below.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="823" height="301" class="wp-image-207" src="https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4.png 823w, https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4-300x110.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4-768x281.png 768w" sizes="(max-width: 823px) 100vw, 823px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 2 &#8211; Installing MySQL</strong></h2>



<p class="wp-block-paragraph">If Apache2 is a web server, MySQL acts as RDBMS (Relational Database Management System) on LAMP. MySQL is a Database Management System that is quite popular for the PHP programming language.<br />To install MySQL on Ubuntu, type the command :</p>



<pre class="wp-block-code"><code># apt install mysql-server</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="540" height="22" class="wp-image-213" src="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-1.png 540w, https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-1-300x12.png 300w" sizes="(max-width: 540px) 100vw, 540px" /></figure>



<p class="wp-block-paragraph">After the installation process is complete, running a series of processes aimed at improving MySQL security is recommended. To run the process, type the command :</p>



<pre class="wp-block-code"><code># mysql_secure_installation</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="397" height="30" class="wp-image-216" src="https://serverstadium.com/wp-content/uploads/2020/09/002.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002.png 397w, https://serverstadium.com/wp-content/uploads/2020/09/002-300x23.png 300w" sizes="(max-width: 397px) 100vw, 397px" /></figure>



<p class="wp-block-paragraph">A new message will pop up; there is an option if you want to enable the &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">VALIDATE PASSWORD</span>&#8221; feature.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="487" height="164" class="wp-image-219" src="https://serverstadium.com/wp-content/uploads/2020/09/003-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-2.png 487w, https://serverstadium.com/wp-content/uploads/2020/09/003-2-300x101.png 300w" sizes="(max-width: 487px) 100vw, 487px" /></figure>



<p class="wp-block-paragraph">This tool checks the password strength and allows MySQL users to set only those passwords which are secure enough. There is 3 level :</p>



<pre class="wp-block-code"><code>- LOW --&gt; Length &gt;= 8
- MEDIUM --&gt; Length &gt;= 8, numeric, mixed case, and special characters
- STRONG --&gt; Length &gt;= 8, numeric, mixed case, special characters, and dictionary</code></pre>



<p class="wp-block-paragraph">Press y / Y if you want to use &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">VALIDATE PASSWORD</span>&#8221; or press n / N if you don&#8217;t want to use it.</p>



<p class="wp-block-paragraph">Set the <span class="has-inline-color has-vivid-cyan-blue-color">root</span> MySQL user password by filling in these prompts with your desired password.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="276" height="75" class="wp-image-220" src="https://serverstadium.com/wp-content/uploads/2020/09/004.png" alt="" /></figure>



<p class="wp-block-paragraph">Removing the &#8220;anonymous&#8221; MySQL users before moving into a production state is advised. Press y / Y to remove the &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">anonymous</span>&#8221; MySQL user on the next pop-up.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="478" height="131" class="wp-image-221" src="https://serverstadium.com/wp-content/uploads/2020/09/005.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/005.png 478w, https://serverstadium.com/wp-content/uploads/2020/09/005-300x82.png 300w" sizes="(max-width: 478px) 100vw, 478px" /></figure>



<p class="wp-block-paragraph">Then, to secure MySQL from a remote connection. Root login by remote access has to disable on the next pop-up.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="520" height="93" class="wp-image-222" src="https://serverstadium.com/wp-content/uploads/2020/09/006.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/006.png 520w, https://serverstadium.com/wp-content/uploads/2020/09/006-300x54.png 300w" sizes="(max-width: 520px) 100vw, 520px" /></figure>



<p class="wp-block-paragraph">Same with the anonymous MySQL user, it is advised to remove &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">test</span>&#8221; named database before moving into a production state. Press y / Y to remove &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">test</span>&#8221; named database on the next pop-up message.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="581" height="108" class="wp-image-223" src="https://serverstadium.com/wp-content/uploads/2020/09/007.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/007.png 581w, https://serverstadium.com/wp-content/uploads/2020/09/007-300x56.png 300w" sizes="(max-width: 581px) 100vw, 581px" /></figure>



<p class="wp-block-paragraph">Press y / Y to reload the privilege tables so the several configurations above will apply.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="512" height="71" class="wp-image-224" src="https://serverstadium.com/wp-content/uploads/2020/09/008.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/008.png 512w, https://serverstadium.com/wp-content/uploads/2020/09/008-300x42.png 300w" sizes="(max-width: 512px) 100vw, 512px" /></figure>



<p class="wp-block-paragraph">To test the MySQL <span class="has-inline-color has-vivid-cyan-blue-color">root</span> user locally, test it by typing the command :</p>



<pre class="wp-block-code"><code># mysql -u root -p</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="333" height="22" class="wp-image-225" src="https://serverstadium.com/wp-content/uploads/2020/09/009.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/009.png 333w, https://serverstadium.com/wp-content/uploads/2020/09/009-300x20.png 300w" sizes="(max-width: 333px) 100vw, 333px" /></figure>



<p class="wp-block-paragraph">Then, fill in the password on the password prompt that appears.<br />The MySQL prompt will appear and be ready to use if the credential is correct.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="564" height="201" class="wp-image-226" src="https://serverstadium.com/wp-content/uploads/2020/09/010.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/010.png 564w, https://serverstadium.com/wp-content/uploads/2020/09/010-300x107.png 300w" sizes="(max-width: 564px) 100vw, 564px" /></figure>



<p class="wp-block-paragraph"><mark class="has-inline-color has-vivid-red-color" style="background-color: rgba(0, 0, 0, 0);">Remember</mark>, if you want to use the MySQL remote connection, add <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 3306</mark> to the Network Security Profile that the Virtual Machine uses.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="771" height="65" class="wp-image-227" src="https://serverstadium.com/wp-content/uploads/2020/09/011.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/011.png 771w, https://serverstadium.com/wp-content/uploads/2020/09/011-300x25.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/011-768x65.png 768w" sizes="(max-width: 771px) 100vw, 771px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 3 &#8211; Installing PHP</strong></h2>



<p class="wp-block-paragraph">We have Apache2 and MySQL installed as a part of the LAMP installation. PHP is needed in this 3rd step as a scripting language for LAMP. According to <a href="https://w3techs.com/technologies/details/pl-php" target="_blank" rel="noreferrer noopener">w3techs data</a>, PHP is used by <strong>78,9%</strong> of websites on the internet. This makes PHP a good choice for a server-side programming language for your website.</p>



<p class="wp-block-paragraph">Install PHP by typing the command :</p>



<pre class="wp-block-code"><code># apt install php php-mysql libapache2-mod-php</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="601" height="18" class="wp-image-234" src="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-2.png 601w, https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-2-300x9.png 300w" sizes="(max-width: 601px) 100vw, 601px" /></figure>



<p class="wp-block-paragraph">Explanation :</p>



<pre class="wp-block-code"><code>- php : php core package
- php-mysql : PHP module that allows PHP to communicate with MySQL-based database
- libapache2-mod-php : PHP module that enable Apache2 to handle PHP files</code></pre>



<p class="wp-block-paragraph">After PHP is installed, you can check the PHP version by typing the command :</p>



<pre class="wp-block-code"><code># php -v</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="462" height="79" class="wp-image-237" src="https://serverstadium.com/wp-content/uploads/2020/09/002-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002-1.png 462w, https://serverstadium.com/wp-content/uploads/2020/09/002-1-300x51.png 300w" sizes="(max-width: 462px) 100vw, 462px" /></figure>



<p class="wp-block-paragraph">To test the PHP installation and see the installed PHP&#8217;s complete info, make a new PHP file on <span class="has-inline-color has-vivid-cyan-blue-color">/var/www/html</span> directory with any text editor and name it <span class="has-inline-color has-vivid-red-color">info.php</span>. The content of the info.php must be like below :</p>



<pre class="wp-block-code"><code>&lt;?php
        phpinfo();
?&gt;</code></pre>



<p class="wp-block-paragraph">Save the file, and then access it from the web browser by URL :</p>



<pre class="wp-block-code"><code>http://YOUR_VM_IP_ADDRESS/info.php</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="947" height="678" class="wp-image-239" src="https://serverstadium.com/wp-content/uploads/2020/09/003-3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-3.png 947w, https://serverstadium.com/wp-content/uploads/2020/09/003-3-300x215.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/003-3-768x550.png 768w" sizes="(max-width: 947px) 100vw, 947px" /></figure>



<p class="wp-block-paragraph">As we can see info.php file displayed complete information for PHP that was installed on the Ubuntu ServerStadium Virtual Machine.</p>



<p class="wp-block-paragraph">Congratulations! You have now configured a LAMP stack on Ubuntu ServerStadium Virtual Machine.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Conclusion</strong></h2>



<p class="wp-block-paragraph">In this guideline, we have installed and configured LAMP stack on the Ubuntu Virtual Machine ServerStadium environment for serving PHP websites and applications using Apache2 as a web server and MySQL as a database management system.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-lamp-in-ubuntu/">Installing LAMP in Ubuntu</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
