Ubuntu https://www.novicedev.com/ en Installing LAMP stack in Ubuntu https://www.novicedev.com/blog/installing-lamp-stack-ubuntu <span>Installing LAMP stack in Ubuntu</span> <div class="field field--name-field-image field--type-image field--label-hidden field-item"> <img loading="lazy" src="/sites/novicedev/files/styles/blog_cover/public/2022-02/ubuntu-lamp.png?itok=-Cho65gv" width="772" height="434" alt="Installing LAMP stack in Ubuntu" title="Installing LAMP stack in Ubuntu" class="image-field" /> </div> <span><span>noviceadmin</span></span> <span>Tue, 12/10/2013 - 14:55</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field-item"><p>LAMP stack is a bundle of open-source software used to create one of the powerful web servers. The acronym stands for Linux, Apache, MySQL, and PHP. Diagram for LAMP stack:</p> <p>There are two ways to install LAMP stack in Ubuntu :</p> <h2>Installing each package individually</h2> <p>For installing each package individually follow the following steps:</p> <p>First of all install Apache web-server, generally recognized as the world's most popular Web server by executing this command to your terminal. For our example, we are using the latest Apache2.</p> <pre> <code class="language-php">sudo apt-get install apache2</code></pre> <p>Time to test open your browser and hit the following URL you will see a message saying "It works!”</p> <p>localhost/</p> <p>Second, install PHP open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. For our example, we are using the latest version of PHP i.e. PHP5</p> <pre> <code class="language-php">sudo apt-get install php5 libapache2-mod-php5</code></pre> <p>For connecting Apache2 and PHP5 we also install libraries in the above command. After this restart your Apache2 services by the following command.</p> <pre> <code class="language-php">sudo /etc/init.d/apache2 restart</code></pre> <p>Time to test create a file with the info.php name in your /var/www/ directory and write the following code in it.</p> <p>Creating file:</p> <pre> <code class="language-php">sudo gedit /var/www/info.php</code></pre> <pre> <code class="language-php">&lt;?php phpinfo(); ?&gt;</code></pre> <p>Save the file. Now open your browser and hit the following URL to see the given page.</p> <p>localhost/info.php</p> <p>Third, it’s time for our MySQL world's second most widely used open-source relational database management system. Execute the following command to your terminal.</p> <pre> <code class="language-php">sudo apt-get install mysql-server</code></pre> <p>For connecting MySQL and PHP5 we need to install libraries by executing the following command.</p> <pre> <code class="language-php">sudo apt-get install php5-mysql</code></pre> <p>Again we have to restart our Apache2 web server with the following command.</p> <pre> <code class="language-php">sudo /etc/init.d/apache2 restart</code></pre> <p>You can also install the User interface of MySQL by executing the following command in your terminal.</p> <pre> <code class="language-php">sudo apt-get install phpmyadmin</code></pre> <p>Time to test hit the following URL to your browser and see the given page.</p> <p>localhost/phpmyadmin</p> <p>Now we have completed our installation of the LAMP stack.</p> <h2>Installing complete LAMP stack with one command:</h2> <p>For installing the complete package in one go follow the following steps:</p> <p>First, we need to install an ubuntu’s tasksel tool which is used for installing multiple related packages as a coordinated "task" onto your system. For installing tasksel execute the following command in your terminal.</p> <pre> <code class="language-php">sudo apt-get install phpmyadmin</code></pre> <p>The second time for LAMP stack in one go execute the following command.</p> <pre> <code class="language-php">sudo tasksel install lamp-server</code></pre> <p>Now we get our completed LAMP stack in two steps.</p> </div> <div class="node-taxonomy-container"> <ul class="taxonomy-terms"> <li class="taxonomy-term"><a href="/topic/lamp" hreflang="en">LAMP</a></li> <li class="taxonomy-term"><a href="/topic/ubuntu" hreflang="en">Ubuntu</a></li> <li class="taxonomy-term"><a href="/topic/linux" hreflang="en">Linux</a></li> </ul> </div> <!--/.node-taxonomy-container --> <section id="node-article-comment" id="comments"> <div class="comment-form-wrap"> <h2 class="add-comment-title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=25&amp;2=comment&amp;3=comment" token="zIcYfyx9x2R_eMpsZ9_uvNrYo5LC9hJAkmbrmdnOI5c"></drupal-render-placeholder> </div> <!--/.comment-form --> </section> Tue, 10 Dec 2013 14:55:06 +0000 noviceadmin 25 at https://www.novicedev.com