<?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 Framework Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/yii-framework/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Sat, 17 Nov 2018 00:40:29 +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 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>
<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>
<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>
<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>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>
<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>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>
<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>
<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>Now, move the created folder. In my case is <em>example.</em></p>
<pre class="">:~$ sudo mv example /var/www/html/</pre>
<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>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>
<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>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>
<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>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>
<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>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>
<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>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>
<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>Now, open your web browser and go to <code>HTTP://localhost:8888</code>.</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>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>
