<?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>Yii Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/yii/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Tue, 19 May 2020 19:54:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to install Yii PHP framework on Ubuntu 20.04?</title>
		<link>https://www.osradar.com/how-to-install-yii-php-framework-ubuntu-20-04/</link>
					<comments>https://www.osradar.com/how-to-install-yii-php-framework-ubuntu-20-04/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Tue, 19 May 2020 22:54:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[focal]]></category>
		<category><![CDATA[Focal Fossa]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[yii php framework]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=20414</guid>

					<description><![CDATA[<p>Web programming has a very important place nowadays. And within the web technologies, the PHP language is one of the most popular. That&#8217;s why several frameworks bring together the development process. Today, I&#8217;ll show you how to install Yii PHP framework on Ubuntu 20.04 In order to be pragmatic and flexible, Yii PHP was born. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-yii-php-framework-ubuntu-20-04/">How to install Yii PHP framework on Ubuntu 20.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Web programming has a very important place nowadays. And within the web technologies, the PHP language is one of the most popular. That&#8217;s why several frameworks bring together the development process. Today, I&#8217;ll show you <strong>how to install Yii PHP framework on Ubuntu 20.04</strong></p>



<p>In order to be pragmatic and flexible, <a href="https://www.yiiframework.com/">Yii PHP</a> was born. It is a framework for object-oriented PHP development that uses the architectural pattern MVC. What makes it ideal for developing many web applications such as forums, information sites or virtual shopping.</p>



<p>With Yii PHP you will have no licensing problems because it is open source (<a href="http://www.linfo.org/bsdlicense.html">BSD Licence</a>) which makes it ideal for community, educational or long-range projects.</p>



<p>Yii is not so different from frameworks like Laravel or CakePHP but it provides another way of doing things. Let&#8217;s say similar but not the same.</p>



<p><a href="https://www.osradar.com/install-laravel-ubuntu-2004/" target="_blank" rel="noreferrer noopener">How to install Laravel on Ubuntu 20.04?</a></p>



<p><a href="https://www.osradar.com/how-to-install-cakephp-on-ubuntu-20-04/" target="_blank" rel="noreferrer noopener">How to install CakePHP on Ubuntu 20.04?</a></p>



<p>So, let us start.</p>



<h2>Install Yii PHP Framework on Ubuntu 20.04</h2>



<p>As it is a PHP framework, it is required that you have PHP installed on your computer. It also installs some PHP modules, as well as the unzip package.</p>



<pre class="wp-block-preformatted">:~$ sudo apt install php php-pdo php-intl php-xml php-zip php-mbstring phpunit php-mysql php-sqlite3 unzip</pre>



<h3>1.- Install Composer on Ubuntu 20.04</h3>



<p>The installation method recommended by the Yii development team is to use composite.</p>



<p>As we have explained, Composer is a PHP dependency manager that can be installed on Linux, very easily.</p>



<p><a href="https://www.osradar.com/install-php-composer-ubuntu-20-04/" target="_blank" rel="noreferrer noopener">How to install PHP Composer on Ubuntu 20.04?</a></p>



<p>Also, you can get more information about Composer with this post:</p>



<p><a href="https://www.osradar.com/using-composer-on-linux/" target="_blank" rel="noreferrer noopener">Using Composer on Linux</a></p>



<p>When Composer is installed and well configured, we can start the installation.</p>



<h3>2.- Installing Yii PHP framework on Ubuntu 20.04</h3>



<p>With Composer already installed, you can start the installation of Yii with the following command:</p>



<pre class="wp-block-preformatted">:~$ composer create-project --prefer-dist yiisoft/yii2-app-basic project</pre>



<p>You have to replace <strong>project</strong> with the name of your desired project.</p>



<p>Then the installation will start and when it is finished, you will see this screen.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="380" src="https://www.osradar.com/wp-content/uploads/2020/05/1-13-1024x380.png" alt="1.- Install Yii PHP framework on Ubuntu 20.04" class="wp-image-20417" srcset="https://www.osradar.com/wp-content/uploads/2020/05/1-13-1024x380.png 1024w, https://www.osradar.com/wp-content/uploads/2020/05/1-13-300x111.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/1-13-768x285.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/1-13-696x259.png 696w, https://www.osradar.com/wp-content/uploads/2020/05/1-13-1068x397.png 1068w, https://www.osradar.com/wp-content/uploads/2020/05/1-13.png 1214w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>1.- Install Yii PHP framework on Ubuntu 20.04</figcaption></figure>



<p>Optionally you can make npm handle Javascript dependencies and not Composer. If you want to do it, edit the file <code>composer.json</code></p>



<p>And in the end, add the following:</p>



<pre class="wp-block-preformatted">"replace": {<br>"bower-asset/jquery": "&gt;=1.11.0",<br>"bower-asset/inputmask": "&gt;=3.2.0",<br>"bower-asset/punycode": "&gt;=1.3.0",<br>"bower-asset/yii2-pjax": "&gt;=2.0.0"<br>},</pre>



<p>So, save the changes and close the file.</p>



<p>The next step is to <strong>serve</strong> the project, to prove that all is well. If you did the installation on a local computer, execute this command:</p>



<pre class="wp-block-preformatted">:~$ php yii serve
Server started on http://localhost:8080/
Document root is "/home/angelo/project/web"
Quit the server with CTRL-C or COMMAND-C.
[Mon May 18 22:39:44 2020] PHP 7.4.3 Development Server (http://localhost:8080) started</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="834" height="173" src="https://www.osradar.com/wp-content/uploads/2020/05/2-16.png" alt="2.- Serve projects on Yii" class="wp-image-20418" srcset="https://www.osradar.com/wp-content/uploads/2020/05/2-16.png 834w, https://www.osradar.com/wp-content/uploads/2020/05/2-16-300x62.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/2-16-768x159.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/2-16-696x144.png 696w" sizes="(max-width: 834px) 100vw, 834px" /><figcaption>2.- Serve projects on Yii</figcaption></figure>



<p>And this will make the project available from <code>http://localhost:8080</code></p>



<p>You can also specify a host and a port:</p>



<pre class="wp-block-preformatted">:~$ php yii serve 192.168.250.20 --port=1234</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="825" height="176" src="https://www.osradar.com/wp-content/uploads/2020/05/3-14.png" alt="3.- Serve the project on a different host and port" class="wp-image-20419" srcset="https://www.osradar.com/wp-content/uploads/2020/05/3-14.png 825w, https://www.osradar.com/wp-content/uploads/2020/05/3-14-300x64.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/3-14-768x164.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/3-14-696x148.png 696w" sizes="(max-width: 825px) 100vw, 825px" /><figcaption>3.- Serve the project on a different host and port</figcaption></figure>



<p>Finally, open your favorite web browser and go to <code>http://host:port</code> and you will see the following:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://www.osradar.com/wp-content/uploads/2020/05/4-12-1024x506.png" alt="4.- Yii PHP framework on Ubuntu 20.04" class="wp-image-20420" srcset="https://www.osradar.com/wp-content/uploads/2020/05/4-12-1024x506.png 1024w, https://www.osradar.com/wp-content/uploads/2020/05/4-12-300x148.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/4-12-768x379.png 768w, https://www.osradar.com/wp-content/uploads/2020/05/4-12-696x344.png 696w, https://www.osradar.com/wp-content/uploads/2020/05/4-12-1068x528.png 1068w, https://www.osradar.com/wp-content/uploads/2020/05/4-12.png 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>4.- Yii PHP framework on Ubuntu 20.04</figcaption></figure>



<p>So, Yii is ready to start developing web applications.</p>



<h2>Conclusion</h2>



<p>Yii is a less popular framework than CakePHP or Laravel, but equally powerful. Many websites are made with this framework and the results are fantastic for the developer and the end-user.</p>



<p>On the other hand, the installation of Yii is facilitated thanks to its compatibility with Composer.</p>



<p>So, share this post, join <a href="https://t.me/osradar" target="_blank" rel="noreferrer noopener">our Telegram Channel</a> and buy us a coffee 🙂</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-yii-php-framework-ubuntu-20-04/">How to install Yii PHP framework on Ubuntu 20.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-yii-php-framework-ubuntu-20-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to install Yii framework on CentOS 8?</title>
		<link>https://www.osradar.com/install-yii-framework-centos-8/</link>
					<comments>https://www.osradar.com/install-yii-framework-centos-8/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Tue, 14 Jan 2020 00:01:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Centos 8]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Yii]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=17542</guid>

					<description><![CDATA[<p>We know that web development occupies a lot of place in today’s world. In fact, more and more business applications are made with web technology. You can use NodeJS or a programming language like PHP. PHP is perhaps the most popular language for web development although there are other technologies that are increasing in popularity [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-yii-framework-centos-8/">How to install Yii framework on CentOS 8?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>We know that web development occupies a lot of place in today’s world.  In fact, more and more business applications are made with web technology. You can use NodeJS or a programming language like PHP. PHP  is perhaps the most popular language for web development although there are other technologies that are increasing in popularity at a constant rate like NodeJS. But there is no doubt that PHP is very popular. To make quality applications in PHP you have to use a framework and there are many of those, but today <strong>we will teach you how to install Yii PHP framework on <a href="https://www.osradar.com/tag/centos-8" target="_blank" rel="noreferrer noopener" aria-label="CentOS (opens in a new tab)">CentOS</a> 8.</strong></p>



<p>In order to be pragmatic and flexible, <a href="https://www.yiiframework.com/">Yii PHP</a>  was born. It is a framework for object-oriented PHP development that uses the architectural pattern MVC. What makes it ideal for developing many web applications such as forums, information sites or virtual shopping.</p>



<p>With Yii PHP you will have no licensing problems because it is open source (<a href="http://www.linfo.org/bsdlicense.html">BSD Licence</a>) which makes it ideal for community, educational or long-range projects.</p>



<h2>Install Yii PHP Framework on CentOS 8</h2>



<p>From the project&#8217;s website, we recommend using composer to perform the installation. This is because the framework has many dependencies and Composer is the best for it.</p>



<p>So the first step is to install Composer on CentOS 8</p>



<h3>Install Composer on CentOS 8</h3>



<p>Installing Composer on CentOS 8 is quite simple, but you have to install some previous packages.</p>



<p>So, open a terminal session and run the following:</p>



<pre class="wp-block-preformatted">:~$ sudo dnf install php php-json php-mbstring php-xmlrpc php-soap php-gd php-xml php-cli php-zip curl</pre>



<p>What have we just installed? Well, first of all, PHP so you can interpret Composer. Then, we installed a series of extensions that will also work for Yii. Finally, <a href="https://www.osradar.com/how-to-use-curl-command-linux/" target="_blank" rel="noreferrer noopener" aria-label="curl (opens in a new tab)">curl</a> is a utility that we will use to download Composer.</p>



<p>Then, we proceed to download and install it.</p>



<pre class="wp-block-preformatted">:~$ curl -sS https://getcomposer.org/installer | php</pre>



<p>Next, we will make Composer available from the terminal with the following commands:</p>



<pre class="wp-block-preformatted">:~$ sudo mv composer.phar /usr/local/bin/composer 
:~$ sudo chmod +x /usr/local/bin/composer 
:~$ source ~/.bashrc </pre>



<p>Now, you can check if everything went well with the next command: </p>



<pre class="wp-block-preformatted">:~$ composer -v </pre>



<p>If it shows you the version or helps you, it&#8217;s all right.</p>



<h3>Getting Yii framework on CentOS 8</h3>



<p>Once Composer is properly installed, we can install the Yii framework.</p>



<p>To do so, just use the following command:</p>



<pre class="wp-block-preformatted">:~$ composer create-project --prefer-dist yiisoft/yii2-app-basic example</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="552" src="https://www.osradar.com/wp-content/uploads/2020/01/1-6-1024x552.png" alt="1.- Installing Yii framework on CentOS 8" class="wp-image-17546" srcset="https://www.osradar.com/wp-content/uploads/2020/01/1-6-1024x552.png 1024w, https://www.osradar.com/wp-content/uploads/2020/01/1-6-300x162.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/1-6-768x414.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/1-6-696x375.png 696w, https://www.osradar.com/wp-content/uploads/2020/01/1-6-1068x576.png 1068w, https://www.osradar.com/wp-content/uploads/2020/01/1-6-779x420.png 779w, https://www.osradar.com/wp-content/uploads/2020/01/1-6.png 1310w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>1.- Installing Yii framework on CentOS 8</figcaption></figure>



<p>This command will download and configure the entire directory structure of Yii making it available to us. In this case, the project is called &#8220;<strong>example</strong>&#8220;, but obviously you can change this.</p>



<p>Remember that when you run this command, it will create a folder with the name of the project in the current location.</p>



<p>By default, Yii allows Composer to handle CSS/Javascript dependencies. If you want Composer not to do it and you want NPM, you have to do the following steps.</p>



<pre class="wp-block-preformatted">:~$ cd [your-project]
:~$ nano composer.json</pre>



<p>And add the following:</p>



<pre class="wp-block-preformatted">"replace": {
    "bower-asset/jquery": ">=1.11.0",
    "bower-asset/inputmask": ">=3.2.0",
    "bower-asset/punycode": ">=1.3.0",
    "bower-asset/yii2-pjax": ">=2.0.0"
},</pre>



<p>As I said, it&#8217;s not mandatory.</p>



<p>To check that everything is in order, we will serve the project.</p>



<p>From the project location, run the following command:</p>



<pre class="wp-block-preformatted">:~$ php yii serve</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="794" height="178" src="https://www.osradar.com/wp-content/uploads/2020/01/2-5.png" alt="2.- Serve the Yii application" class="wp-image-17545" srcset="https://www.osradar.com/wp-content/uploads/2020/01/2-5.png 794w, https://www.osradar.com/wp-content/uploads/2020/01/2-5-300x67.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/2-5-768x172.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/2-5-696x156.png 696w" sizes="(max-width: 794px) 100vw, 794px" /><figcaption>2.- Serve the Yii application</figcaption></figure>



<p>This will allow the project to be displayed in a web browser at <code>http:/localhost:8080</code>. Remember that this port has to be available in the firewall.</p>



<p>However, we can specify a different host and port:</p>



<pre class="wp-block-preformatted">:~$ php yii serve [Ip-address] --port=[port]</pre>



<p>Then open your browser and go to your project and you will see the following:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="506" src="https://www.osradar.com/wp-content/uploads/2020/01/3-5-1024x506.png" alt="3.- Yii framework on CentOS 8" class="wp-image-17547" srcset="https://www.osradar.com/wp-content/uploads/2020/01/3-5-1024x506.png 1024w, https://www.osradar.com/wp-content/uploads/2020/01/3-5-300x148.png 300w, https://www.osradar.com/wp-content/uploads/2020/01/3-5-768x379.png 768w, https://www.osradar.com/wp-content/uploads/2020/01/3-5-324x160.png 324w, https://www.osradar.com/wp-content/uploads/2020/01/3-5-696x344.png 696w, https://www.osradar.com/wp-content/uploads/2020/01/3-5-1068x528.png 1068w, https://www.osradar.com/wp-content/uploads/2020/01/3-5-850x420.png 850w, https://www.osradar.com/wp-content/uploads/2020/01/3-5.png 1354w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>3.- Yii framework on CentOS 8</figcaption></figure>



<p>So, that is it. You are ready to start creating fantastic web applications with Yii framework.</p>



<h2>Conclusion</h2>



<p>Yii is a less popular framework than Cake or Laravel, but equally powerful. Many websites are made with this framework and the results are fantastic for the developer and the end-user.</p>



<p>On the other hand, the installation of Yii is facilitated thanks to its compatibility with Composer.</p>



<p>Please share this post and join <a rel="noreferrer noopener" aria-label="our Telegram Channel (opens in a new tab)" href="https://t.me/osradar" target="_blank">our Telegram Channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-yii-framework-centos-8/">How to install Yii framework on CentOS 8?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-yii-framework-centos-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to install Yii PHP Framework on Debian 9 and Ubuntu 18.04?</title>
		<link>https://www.osradar.com/install-yii-php-framework-debian-9-ubuntu/</link>
					<comments>https://www.osradar.com/install-yii-php-framework-debian-9-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Sat, 17 Nov 2018 02:32:42 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[Yii Framework]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=7387</guid>

					<description><![CDATA[<p>Every day we find new and better web applications. This is because more and more are being developed for the web with languages like Python, Ruby or PHP. The latter has several powerful frameworks such as Yii. Today, I will show you how to install Yii PHP on Debian 9 and Ubuntu 18.04. In order [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-yii-php-framework-debian-9-ubuntu/">How to install Yii PHP Framework on Debian 9 and Ubuntu 18.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Every day we find new and better web applications. This is because more and more are being developed for the web with languages like Python, Ruby or PHP. The latter has several powerful frameworks such as Yii. Today, I will show you how to install Yii PHP on Debian 9 and Ubuntu 18.04.</p>
<p>In order to be pragmatic and flexible, <a href="https://www.yiiframework.com/" rel="noopener">Yii PHP</a> was born. It is a framework for object-oriented PHP development that uses the architectural pattern MVC. What makes it ideal for developing many web applications such as forums, information sites or virtual shopping.</p>
<p>With Yii PHP you will have no licensing problems because it is open source (<a href="http://www.linfo.org/bsdlicense.html" rel="noopener">BSD Licence</a>) which makes it ideal for community, educational or long-range projects.</p>
<p>So, let&#8217;s install Yii PHP Framework on Debian 9 and Ubuntu 18.04.</p>
<h1>Install Apache web server</h1>
<p>If you are going to start developing in PHP is necessary, install a web server. There are several options like <a href="https://www.osradar.com/how-to-configure-an-apache-virtual-host-on-debian-9/" rel="noopener">Apache web server</a> or <a href="https://www.osradar.com/how-to-configure-nginx-server-blocks-on-ubuntu-18-04/" rel="noopener">Ngnix</a>. Both valid and very good. However, for this tutorial, I will use the Apache web server.</p>
<p>Open a Terminal and run this command:</p>
<pre class="">:~$ sudo apt install apache2</pre>
<p>Then, enable and start the service.</p>
<pre class="">:~$ sudo systemctl enable apache2
:~ sudo systemctl start apache2</pre>
<p>Next, open a web browser and go to <code>HTTP://localhost</code>. If you see this, everything is OK.</p>
<p><figure id="attachment_7389" aria-describedby="caption-attachment-7389" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7389" src="https://www.osradar.com/wp-content/uploads/2018/11/0.png" alt="Apache default page" width="1366" height="671" srcset="https://www.osradar.com/wp-content/uploads/2018/11/0.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/0-300x147.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/0-768x377.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/0-1024x503.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/0-324x160.png 324w, https://www.osradar.com/wp-content/uploads/2018/11/0-533x261.png 533w, https://www.osradar.com/wp-content/uploads/2018/11/0-696x342.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/0-1068x525.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/0-855x420.png 855w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7389" class="wp-caption-text">Apache default page</figcaption></figure></p>
<h1>Install Yii PHP Framework</h1>
<p>Installing Yii PHP is simply because I will do it via <a href="https://getcomposer.org/" rel="noopener">Composer</a> which is a dependency manager for PHP that really does wonders. So, the first step is to install Composer.</p>
<p>Open a terminal and run:</p>
<pre class="">:~$ curl -sS https://getcomposer.org/installer | php</pre>
<p><figure id="attachment_7390" aria-describedby="caption-attachment-7390" style="width: 789px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7390" src="https://www.osradar.com/wp-content/uploads/2018/11/1-13.png" alt="1.- Installing Composer" width="789" height="119" srcset="https://www.osradar.com/wp-content/uploads/2018/11/1-13.png 789w, https://www.osradar.com/wp-content/uploads/2018/11/1-13-300x45.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/1-13-768x116.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/1-13-696x105.png 696w" sizes="(max-width: 789px) 100vw, 789px" /><figcaption id="caption-attachment-7390" class="wp-caption-text">1.- Installing Composer</figcaption></figure></p>
<p>Now, make composer available to all users from the terminal in the form of a command.</p>
<pre class="">:~$ sudo mv composer.phar /usr/local/bin/composer</pre>
<p><figure id="attachment_7391" aria-describedby="caption-attachment-7391" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7391" src="https://www.osradar.com/wp-content/uploads/2018/11/2-13.png" alt="2.- Installing Composer" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/11/2-13.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/2-13-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/2-13-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/2-13-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/2-13-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/2-13-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/2-13-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7391" class="wp-caption-text">2.- Installing Composer</figcaption></figure></p>
<p>Now, install Yii PHP Framework using Composer.</p>
<pre class="">:~$ composer create-project --prefer-dist yiisoft/yii2-app-basic example</pre>
<p><em>Note: You can change example for the name you want.</em></p>
<p><figure id="attachment_7392" aria-describedby="caption-attachment-7392" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7392" src="https://www.osradar.com/wp-content/uploads/2018/11/3-12.png" alt="3.- Install Yii PHP Framework" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/11/3-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/3-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/3-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/3-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/3-12-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/3-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/3-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7392" class="wp-caption-text">3.- Install Yii PHP Framework</figcaption></figure></p>
<p><figure id="attachment_7393" aria-describedby="caption-attachment-7393" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7393" src="https://www.osradar.com/wp-content/uploads/2018/11/4-13.png" alt="4.- Installing Yii PHP Framework" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/11/4-13.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/4-13-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/4-13-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/4-13-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/4-13-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/4-13-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/4-13-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7393" class="wp-caption-text">4.- Installing Yii PHP Framework</figcaption></figure></p>
<p>Now, move the created folder. In my case is <em>example.</em></p>
<pre class="">:~$ sudo mv example /var/www/html/</pre>
<p><figure id="attachment_7394" aria-describedby="caption-attachment-7394" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7394" src="https://www.osradar.com/wp-content/uploads/2018/11/5-12.png" alt="5.- Moving the created folder to apache document root" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/11/5-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/5-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/5-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/5-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/5-12-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/5-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/5-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7394" class="wp-caption-text">5.- Moving the created folder to apache document root</figcaption></figure></p>
<p>Next, move to the directory.</p>
<pre class="">:~$ cd /var/www/html/example</pre>
<p>To avoid dependency problems with Composer, it is necessary to edit a file inside the <em>example</em> folder.</p>
<pre class="">:~$ sudo nano composer.json</pre>
<p>And add the following:</p>
<pre class="">"replace": {
    "bower-asset/jquery": "&gt;=1.11.0",
    "bower-asset/inputmask": "&gt;=3.2.0",
    "bower-asset/punycode": "&gt;=1.3.0",
    "bower-asset/yii2-pjax": "&gt;=2.0.0"
},</pre>
<p>Like this:</p>
<p><figure id="attachment_7395" aria-describedby="caption-attachment-7395" style="width: 1368px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7395" src="https://www.osradar.com/wp-content/uploads/2018/11/6-1-1.png" alt="6.- Editing the composer file on the project folder" width="1368" height="747" srcset="https://www.osradar.com/wp-content/uploads/2018/11/6-1-1.png 1368w, https://www.osradar.com/wp-content/uploads/2018/11/6-1-1-300x164.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/6-1-1-768x419.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/6-1-1-1024x559.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/6-1-1-696x380.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/6-1-1-1068x583.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/6-1-1-769x420.png 769w" sizes="(max-width: 1368px) 100vw, 1368px" /><figcaption id="caption-attachment-7395" class="wp-caption-text">6.- Editing the composer file on the project folder</figcaption></figure></p>
<p>Now, let&#8217;s make a <a href="https://www.osradar.com/how-to-configure-an-apache-virtual-host-on-debian-9/" rel="noopener">Virtualhost</a> for Yii PHP.</p>
<p>Copy the Apache default site configuration file. Then, edit it.</p>
<pre class="">:~$ sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/yii.conf
:~$ sudo nano /etc/apache2/sites-available/yii.conf</pre>
<p>And add the following:</p>
<pre class=""> RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . index.php
 RewriteRule ^index.php/ - [L,R=404]</pre>
<p>One more thing, for all Yii applications the document root is <code>/var/www/html/PROJECT_FOLDER/web</code>. In my case, the VirtualHost file for Yii will be something like this.</p>
<p><figure id="attachment_7396" aria-describedby="caption-attachment-7396" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7396" src="https://www.osradar.com/wp-content/uploads/2018/11/6-11.png" alt="7.- Creating a VirtualHost for Yii PHP" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/11/6-11.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/6-11-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/6-11-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/6-11-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/6-11-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/6-11-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/6-11-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7396" class="wp-caption-text">7.- Creating a VirtualHost for Yii PHP</figcaption></figure></p>
<p>Then, it is necessary to assign the corresponding permissions to the folder. It is also necessary to change the owner of the folder to avoid permission problems.</p>
<pre class="">:~$ sudo chown -R www-data:www-data /var/www/html/example/
:~$ sudo chmod -R 777 /var/www/html/example/*</pre>
<p><figure id="attachment_7397" aria-describedby="caption-attachment-7397" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7397" src="https://www.osradar.com/wp-content/uploads/2018/11/7-11.png" alt="8.- Settings the appropriate permissions to project folder" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/11/7-11.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/7-11-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/7-11-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/7-11-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/7-11-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/7-11-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/7-11-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7397" class="wp-caption-text">8.- Settings the appropriate permissions to the project folder</figcaption></figure></p>
<p>Next, enable the VirtualHost, the rewrite module and finally, restart Apache.</p>
<pre class="">:~$ sudo a2ensite yii.conf
:~$ sudo a2enmod rewrite
:~$ sudo systemctl restart apache2</pre>
<p><figure id="attachment_7398" aria-describedby="caption-attachment-7398" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7398" src="https://www.osradar.com/wp-content/uploads/2018/11/8-11.png" alt="8.- Making the last configurations to Yii" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/11/8-11.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/8-11-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/8-11-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/8-11-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/8-11-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/8-11-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/8-11-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7398" class="wp-caption-text">9.- Making the last configurations to Yii</figcaption></figure></p>
<p>Now start the Yii service. By default, Yii uses port 8080 but you can specify another port if it is busy or unavailable.</p>
<pre class="">:~$ php yii serve --port=8888</pre>
<p><figure id="attachment_7399" aria-describedby="caption-attachment-7399" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7399" src="https://www.osradar.com/wp-content/uploads/2018/11/9-9.png" alt="10.- Starting Yii PHP" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/11/9-9.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/9-9-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/9-9-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/9-9-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/9-9-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/9-9-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/9-9-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7399" class="wp-caption-text">10.- Starting Yii PHP</figcaption></figure></p>
<p>Now, open your web browser and go to <code>HTTP://localhost:8888</code>.</p>
<p><figure id="attachment_7400" aria-describedby="caption-attachment-7400" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-7400" src="https://www.osradar.com/wp-content/uploads/2018/11/10-8.png" alt="11.- Yii default page" width="1366" height="671" srcset="https://www.osradar.com/wp-content/uploads/2018/11/10-8.png 1366w, https://www.osradar.com/wp-content/uploads/2018/11/10-8-300x147.png 300w, https://www.osradar.com/wp-content/uploads/2018/11/10-8-768x377.png 768w, https://www.osradar.com/wp-content/uploads/2018/11/10-8-1024x503.png 1024w, https://www.osradar.com/wp-content/uploads/2018/11/10-8-324x160.png 324w, https://www.osradar.com/wp-content/uploads/2018/11/10-8-533x261.png 533w, https://www.osradar.com/wp-content/uploads/2018/11/10-8-696x342.png 696w, https://www.osradar.com/wp-content/uploads/2018/11/10-8-1068x525.png 1068w, https://www.osradar.com/wp-content/uploads/2018/11/10-8-855x420.png 855w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-7400" class="wp-caption-text">11.- Yii default page</figcaption></figure></p>
<p>That message indicates that everything went right.</p>
<h1>Conclusion</h1>
<p>Yii e sun framework PHP for the development of simple and complex applications standing out for its high performance. It is open source and very well supported at the community level.</p>
<p>Please share this article through your social networks.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-yii-php-framework-debian-9-ubuntu/">How to install Yii PHP Framework on Debian 9 and Ubuntu 18.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-yii-php-framework-debian-9-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
