{"id":41080,"date":"2022-06-01T12:30:52","date_gmt":"2022-06-01T17:30:52","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=41080"},"modified":"2022-10-05T02:36:14","modified_gmt":"2022-10-05T07:36:14","slug":"how-to-setup-apache-php-mongodb-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/","title":{"rendered":"How To Setup Apache, PHP &#038; MongoDB on Ubuntu 20.04"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"size-full wp-image-41564 alignnone\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg\" alt=\"how to set up apache php and mongodb on ubuntu 20.04\" width=\"742\" height=\"372\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04-300x150.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04-150x75.jpg 150w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/p>\n<p>In this tutorial, we are going to explain in step-by-step detail how to setup Apache, PHP, and MongoDB on Ubuntu 20.04<\/p>\n<p>We will install the Apache Web server, the latest PHP version, and the MongoDB database server. The purpose of this post is to explain how can these three different types of services be configured on one server for future development tasks and the building of an amazing application. MongoDB is a free open-source, NoSQL backend database server, which works perfectly with Apache Web server and PHP as a scripting language.<\/p>\n<p>This setup and environment will take up to 15 minutes. Let&#8217;s get started!<\/p>\n<p><!--more--><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69eb15f429a7a\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69eb15f429a7a\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#Step-1-Update-the-System\" >Step 1. Update the System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#Step-2-Install-Apache-Web-Server\" >Step 2. Install Apache Web Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#Step-3-Install-PHP-8-with-MongoDB-Module\" >Step 3. Install PHP 8 with MongoDB Module<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#Step-4-Install-MongoDB-Database-Server\" >Step 4. Install MongoDB Database Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#Step-5-Create-PHPINFO-file\" >Step 5. Create PHPINFO file<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Fresh install of Ubuntu 20.04<\/li>\n<li>User privileges: root or non-root user with sudo privileges<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Step-1-Update-the-System\"><\/span>Step 1. Update the System<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before the installation of these three different services we are going to update the system packages to the latest versions available:<\/p>\n<pre>sudo apt update -y &amp;&amp; sudo apt upgrade -y<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-2-Install-Apache-Web-Server\"><\/span>Step 2. Install Apache Web Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To install the Apache webserver execute the command below:<\/p>\n<pre>sudo apt install apache2<\/pre>\n<p>After successfull installation, start and enable the service<\/p>\n<pre>sudo systemctl start apache2 &amp;&amp; sudo systemctl enable apache2<\/pre>\n<p>To check if everything is OK, execute the following command for the status of the Apache2 service:<\/p>\n<pre>sudo systemctl status apache2<\/pre>\n<p>You should receive the following output:<\/p>\n<pre>root@vps:~# sudo systemctl status apache2\r\n\u25cf apache2.service - The Apache HTTP Server\r\n     Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\r\n     Active: active (running) since Thu 2022-04-14 19:54:33 UTC; 40min ago\r\n       Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\r\n   Main PID: 675 (apache2)\r\n      Tasks: 6 (limit: 4617)\r\n     Memory: 23.1M\r\n     CGroup: \/system.slice\/apache2.service\r\n             \u251c\u2500675 \/usr\/sbin\/apache2 -k start\r\n             \u251c\u2500925 \/usr\/sbin\/apache2 -k start\r\n             \u251c\u2500926 \/usr\/sbin\/apache2 -k start\r\n             \u251c\u2500927 \/usr\/sbin\/apache2 -k start\r\n             \u251c\u2500928 \/usr\/sbin\/apache2 -k start\r\n             \u2514\u2500930 \/usr\/sbin\/apache2 -k start\r\n\r\nApr 14 19:54:31 test.vps systemd[1]: Starting The Apache HTTP Server...\r\n\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-3-Install-PHP-8-with-MongoDB-Module\"><\/span>Step 3. Install PHP 8 with MongoDB Module<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>First, we need to add the PHP repository and choose Apache from the list. Execute the following command:<\/p>\n<pre>sudo apt install software-properties-common\r\n\r\nsudo add-apt-repository ppa:ondrej\/php<\/pre>\n<p>Once, the repo is added, update the system and install the PHP along with other modules including the MongoDB module.<\/p>\n<pre>sudo apt install php8.0 libapache2-mod-php8.0 php8.0-cli php8.0-mongodb php8.0-common php8.0-imap php8.0-redis php8.0-snmp php8.0-xml php8.0-zip php8.0-mbstring php8.0-cgi php8.0-curl php8.0-gd -y<\/pre>\n<p>Check the installed PHP version with the following command:<\/p>\n<pre>php -v<\/pre>\n<p>You should receive the following output:<\/p>\n<pre>root@vps:~# php -v\r\nPHP 8.0.17 (cli) (built: Mar 20 2022 17:04:09) ( NTS )\r\nCopyright (c) The PHP Group\r\nZend Engine v4.0.17, Copyright (c) Zend Technologies\r\n    with Zend OPcache v8.0.17, Copyright (c), by Zend Technologies\r\n\r\n<\/pre>\n<p>To check if the MongoDB PHP module is installed successfully execute the command below:<\/p>\n<pre>php -m | grep mongodb<\/pre>\n<p>You should receive the following output<\/p>\n<pre>root@vps:~# php -m | grep mongodb\r\n<b>mongodb<\/b>\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-4-Install-MongoDB-Database-Server\"><\/span>Step 4. Install MongoDB Database Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>First, add the GPG keys:<\/p>\n<pre>wget -qO - https:\/\/www.mongodb.org\/static\/pgp\/server-4.4.asc | sudo apt-key add -<\/pre>\n<p>Then, we need to add the MongoDB repository:<\/p>\n<pre>echo \"deb [ arch=amd64,arm64 ] https:\/\/repo.mongodb.org\/apt\/ubuntu focal\/mongodb-org\/4.4 multiverse\" | sudo tee \/etc\/apt\/sources.list.d\/mongodb-org-4.4.list<\/pre>\n<p>Once this is done, update the system and install the MongoDB database server.<\/p>\n<pre>sudo apt-get install gnupg\r\nsudo apt update -y\r\nsudo apt upgrade -y\r\n\r\nsudo apt-get install mongodb-org=4.4.8 mongodb-org-server=4.4.8 mongodb-org-shell=4.4.8 mongodb-org-mongos=4.4.8 mongodb-org-tools=4.4.8 -y\r\n<\/pre>\n<p>After this start and enable the MongoDB service:<\/p>\n<pre>sudo systemctl start mongod &amp;&amp; sudo systemctl enable mongod<\/pre>\n<p>To check the status of MongoDB execute the command below:<\/p>\n<pre>sudo systemctl status mongod<\/pre>\n<p>You should receive the following output:<\/p>\n<pre>root@host:~# sudo systemctl status mongod\r\n\u25cf mongod.service - MongoDB Database Server\r\n     Loaded: loaded (\/lib\/systemd\/system\/mongod.service; enabled; vendor preset: enabled)\r\n     Active: active (running) since Sun 2022-04-17 07:36:21 UTC; 2s ago\r\n       Docs: https:\/\/docs.mongodb.org\/manual\r\n   Main PID: 81644 (mongod)\r\n     Memory: 57.1M\r\n     CGroup: \/system.slice\/mongod.service\r\n             \u2514\u250081644 \/usr\/bin\/mongod --config \/etc\/mongod.conf\r\n\r\nApr 17 07:36:21 test.vps systemd[1]: Started MongoDB Database Server.\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Step-5-Create-PHPINFO-file\"><\/span>Step 5. Create PHPINFO file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We need to create a PHP info file in the document root of the Apache webserver.<\/p>\n<p>Let&#8217;s say that the document root is located at <b>\/var\/www\/html<\/b> directory on your server.<\/p>\n<pre>cd \/var\/www\/html\r\n\r\nsudo nano phpinfo.php<\/pre>\n<p>Paste the following lines of code.<\/p>\n<pre>&lt;?php\r\nphpinfo();\r\n?&gt;\r\n<\/pre>\n<p>After this restart the apache service again:<\/p>\n<pre>sudo systemctl restart apache2<\/pre>\n<p>Access the website at <b>http:\/\/YourServerIPAddress\/phpinfo.php<\/b> or <b>http:\/\/YourDomainName\/phpinfo.php<\/b><\/p>\n<p>Find the MongoDB extensions with the &#8220;CTRL+F&#8221; and type &#8220;mongodb&#8221; in the search area.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-41562 size-full\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/setup-apache-php-mongodb-on-ubuntu-20-04.webp\" alt=\"set up apache php mongodb on ubuntu 20.04\" width=\"853\" height=\"533\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/setup-apache-php-mongodb-on-ubuntu-20-04.webp 853w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/setup-apache-php-mongodb-on-ubuntu-20-04-300x187.webp 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/setup-apache-php-mongodb-on-ubuntu-20-04-150x94.webp 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/setup-apache-php-mongodb-on-ubuntu-20-04-768x480.webp 768w\" sizes=\"(max-width: 853px) 100vw, 853px\" \/><\/p>\n<p>That&#8217;s it. You successfully installed, Apache2, PHP8.0, and MongoDB on <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting\/\">Ubuntu VPS<\/a> along with the required extensions.<\/p>\n<p>Of course, if you find it difficult to set up such a configuration with many services and modules, you can always <a href=\"https:\/\/www.rosehosting.com\/support\/\">contact our technical support<\/a> and they will do the rest. We are available 24\/7 and we will make your server run smoothly in no time.<\/p>\n<p>If you liked this post on how to set up Apache, PHP, and MongoDB on Ubuntu 20.04, please share it with your friends on social networks or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we are going to explain in step-by-step detail how to setup Apache, PHP, and MongoDB on Ubuntu &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How To Setup Apache, PHP &#038; MongoDB on Ubuntu 20.04\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#more-41080\" aria-label=\"Read more about How To Setup Apache, PHP &#038; MongoDB on Ubuntu 20.04\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":41564,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1698],"tags":[37,605,50,1839],"class_list":["post-41080","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-ubuntu","tag-apache","tag-mongodb","tag-php","tag-ubuntu-20-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How To Setup Apache, PHP &amp; MongoDB on Ubuntu 20.04 | RoseHosting<\/title>\n<meta name=\"description\" content=\"How To Setup Apache, PHP &amp; MongoDB on Ubuntu 20.04 | RoseHosting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Setup Apache, PHP &amp; MongoDB on Ubuntu 20.04\" \/>\n<meta property=\"og:description\" content=\"How To Setup Apache, PHP &amp; MongoDB on Ubuntu 20.04 | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-01T17:30:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-05T07:36:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg?v=1653304513\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How To Setup Apache, PHP &#038; MongoDB on Ubuntu 20.04\",\"datePublished\":\"2022-06-01T17:30:52+00:00\",\"dateModified\":\"2022-10-05T07:36:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/\"},\"wordCount\":502,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg\",\"keywords\":[\"apache\",\"mongodb\",\"php\",\"Ubuntu 20.04\"],\"articleSection\":[\"Tutorials\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/\",\"name\":\"How To Setup Apache, PHP & MongoDB on Ubuntu 20.04 | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg\",\"datePublished\":\"2022-06-01T17:30:52+00:00\",\"dateModified\":\"2022-10-05T07:36:14+00:00\",\"description\":\"How To Setup Apache, PHP & MongoDB on Ubuntu 20.04 | RoseHosting\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg\",\"width\":742,\"height\":372,\"caption\":\"how to set up apache php and mongodb on ubuntu 20.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Setup Apache, PHP &#038; MongoDB on Ubuntu 20.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How To Setup Apache, PHP & MongoDB on Ubuntu 20.04 | RoseHosting","description":"How To Setup Apache, PHP & MongoDB on Ubuntu 20.04 | RoseHosting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/","og_locale":"en_US","og_type":"article","og_title":"How To Setup Apache, PHP & MongoDB on Ubuntu 20.04","og_description":"How To Setup Apache, PHP & MongoDB on Ubuntu 20.04 | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2022-06-01T17:30:52+00:00","article_modified_time":"2022-10-05T07:36:14+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg?v=1653304513","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How To Setup Apache, PHP &#038; MongoDB on Ubuntu 20.04","datePublished":"2022-06-01T17:30:52+00:00","dateModified":"2022-10-05T07:36:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/"},"wordCount":502,"commentCount":1,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg","keywords":["apache","mongodb","php","Ubuntu 20.04"],"articleSection":["Tutorials","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/","name":"How To Setup Apache, PHP & MongoDB on Ubuntu 20.04 | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg","datePublished":"2022-06-01T17:30:52+00:00","dateModified":"2022-10-05T07:36:14+00:00","description":"How To Setup Apache, PHP & MongoDB on Ubuntu 20.04 | RoseHosting","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/05\/how-to-setup-apache-php-and-mongodb-on-ubuntu-20.04.jpg","width":742,"height":372,"caption":"how to set up apache php and mongodb on ubuntu 20.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-setup-apache-php-mongodb-on-ubuntu-20-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Setup Apache, PHP &#038; MongoDB on Ubuntu 20.04"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/41080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=41080"}],"version-history":[{"count":11,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/41080\/revisions"}],"predecessor-version":[{"id":43294,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/41080\/revisions\/43294"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/41564"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=41080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=41080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=41080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}