Saturday, 21 February 2015

Install YII on Centos



Yii on Centos 6 Linux (64 bit) Installation



Now install PHP and Http packages

[[email protected] ~]# yum -y install unzip php-fpm php-mysql



Modify using a text editor, locate date.timezone in the file /etc/php.ini for the timezone that is appropriate for your server. I.e. date.timezone = America/New_York

sed -i 's/;date.timezone =/date.timezone = America\/New_York/g' /etc/php.ini

OR

[[email protected] /]# sudo nano /etc/php.ini

Setup php-fpm


sed -i 's/user = apache/user = nginx/g' /etc/php-fpm.d/www.conf
sed -i 's/group = apache/group = nginx/g' /etc/php-fpm.d/www.conf

OR

Open up the php-fpm configuration:
[[email protected] ~]# sudo nano /etc/php-fpm.d/www.conf

service php-fpm restart






Fresh install YII:

Check for the latest release of Yii under http://www.yiiframework.com/download/ 

[[email protected] ~]# cd /var/www
[[email protected] html]# wget http://yii.googlecode.com/files/yii-1.1.10.r3566.zip


Unzip and change the mode to 755 for all files in the extracted directory

[[email protected] www]# unzip yii-1.1.10.r3566.zip -d /var/www

[[email protected] www]# chown -R nginx:nginx /var/www/yii-1.1.10.r3566
[[email protected] www]#  chmod -R 755 /var/www/yii-1.1.10.r3566

chown nginx -R /var/www/DOMAIN/web/runtime chown nginx -R /var/www/DOMAIN/www/assets 

Create your test application 

[[email protected] www]# php /var/www/yii-1.1.10.r3566/framework/yiic.php webapp /var/www/html/test 

Using a browser go to your newly created Yii web application "test"

http://hostname/test/

Enjoy!

Attention for Users used


No comments:

Post a comment