Thursday, June 29, 2017

Yii2: Enable Gii on Remote Computer



Are you accessing yii2 framework remotely and want to access gii? Then this is the tutorial that you need to read. Gii is one of the tools in yii2 framework that is out of the box. Meaning, if you installed yii2 framework, gii is already installed. Gii is one of the easily way to be able to create CRUD instantly and to be able to create Models and Controllers instantly. But there are times that I can only access my server remotely.  In this lesson, viewers will be able to use gii on remote server and create CRUD instantly. 




1. When you access your site on remote computer and what to access gii, below image will likely occur. It says, Forbidden, you are not allowed to access this page. This means that our page is restricted. 



2. The solution is to configure the main-local.php. You will only need to add this codes to be able to use gii remotely. In this example, I'm restricting my allowable IP address to 10.10.*.*. This means that if my IP address for instance is 192.168.12.12, then I cannot use gii. So, you can actually change this IP subnets on your own. In this way, you are restricting gii to only allow IPs that I mentioned earlier, does more secure.



3. Now you can use gii on remote computers. Feel free to ask questions and comments on the box below. 


No comments:

Post a Comment