{"id":15841,"date":"2025-10-13T18:37:00","date_gmt":"2025-10-13T13:07:00","guid":{"rendered":"https:\/\/www.skynats.com\/?p=15841"},"modified":"2025-10-14T11:39:18","modified_gmt":"2025-10-14T06:09:18","slug":"how-to-install-yii-framework-on-ubuntu-using-apache","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-install-yii-framework-on-ubuntu-using-apache\/","title":{"rendered":"How to Install Yii Framework on Ubuntu Using Apache"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Yii is a modern, high-performance PHP framework that makes developing web applications faster and more secure. With its elegant MVC architecture, built-in tools, and extensive features, Yii is a popular choice for both small and large projects. In this guide, we\u2019ll walk you through How to install Yii Framework on Ubuntu and running it with Apache in just a few simple steps.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 1: Update Your System<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, make sure your system packages are up to date.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt upgrade<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 2: Install Apache, PHP, and Required Extensions<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Yii requires PHP 7.4 or later along with some common extensions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install apache2 php php-cli php-mbstring php-xml php-curl php-zip php-intl unzip -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable Apache\u2019s rewrite module:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2enmod rewrite\nsudo systemctl enable apache2\nsudo systemctl restart apache2<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 3: Install Composer<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Composer is the PHP dependency manager that handles Yii installation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>composer --version<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Step 4: Create a New Yii Project<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Move to your web root and create a new Yii application using Composer.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/html\ncomposer create-project --prefer-dist yiisoft\/yii2-app-basic yiitest<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Step 5: Configure Apache for Yii<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new Apache configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/apache2\/sites-available\/yiitest.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:80>\n    ServerName yourdomain.com\n    DocumentRoot \/var\/www\/html\/yiitest\/web\n&lt;Directory \/var\/www\/html\/yiitest\/web>\n        AllowOverride All\n        Require all granted\n    &lt;\/Directory>\n\n    ErrorLog ${APACHE_LOG_DIR}\/yiitest-error.log\n    CustomLog ${APACHE_LOG_DIR}\/yiitest-access.log combined\n&lt;\/VirtualHost><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable the new site and restart Apache:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2ensite yiitest.conf\nsudo systemctl reload apache2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note: You can secure your Yii application using a free SSL certificate if you want.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Step 6: Verify Installation<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open your browser and go to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;yourdomain.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see the Yii welcome page as shown below, confirming that your installation is successful.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"446\" sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/10\/image-1024x446.png\" alt=\"Install Yii Framework on Ubuntu\" class=\"wp-image-15842\" srcset=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/10\/image-1024x446.png 1024w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/10\/image-300x131.png 300w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/10\/image-768x335.png 768w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/10\/image-1536x669.png 1536w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/10\/image-1200x523.png 1200w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2025\/10\/image.png 1600w\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Conclusion<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ve successfully installed the Yii Framework on <a href=\"https:\/\/ubuntu.com\/\" target=\"_blank\" rel=\"noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\">Ubuntu<\/mark><\/a> using Apache! Your server is now ready for developing fast, secure, and scalable PHP applications. From here, you can start building custom modules, explore Yii\u2019s powerful features, and deploy production-ready web applications with confidence.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you face any issues while you install Yii Framework on Ubuntu or need help configuring your Apache server for optimal performance, our team is here to help. We specialize in <a href=\"https:\/\/www.skynats.com\/server-management\/\">Server Management services<\/a>, including framework setup, web server optimization, and complete Linux server administration. Contact our 24\/7 technical experts to ensure your Yii framework runs smoothly and securely on your Ubuntu environment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yii is a modern, high-performance PHP framework that makes developing web applications faster and more secure. With its elegant MVC architecture, built-in tools, and extensive features, Yii is a popular choice for both small and large projects. In this guide, we\u2019ll walk you through How to install Yii Framework on Ubuntu and running it with [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1134,1010,302],"class_list":["post-15841","post","type-post","status-publish","format-standard","hentry","category-blog","tag-install-yii-framework-on-ubuntu-using-apache","tag-linux-server-management-services","tag-server-management-services"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=15841"}],"version-history":[{"count":2,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15841\/revisions"}],"predecessor-version":[{"id":15844,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15841\/revisions\/15844"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=15841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=15841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=15841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}