yii2 advanced application template setup

We will be documenting all the issues we encounter during the course of developing a yii2 advanced template powered web application here.
1. PHP Parse error: syntax error, unexpected ‘[‘, expecting ‘)’ in vendor/yiisoft/yii2/Yii.php on line 25
2. mcrypt_create_iv(): Cannot open source device

1. when running “yii migrate”
error:
PHP Parse error: syntax error, unexpected ‘[‘, expecting ‘)’ in vendor/yiisoft/yii2/Yii.php on line 25

fix: this is because, though we have compiled our php54 but we avoided to mess it up with the system default php53. and Yii detects the default system php and used the 5.3 version.
So to fix this issue, we just temporally make php default pointing to php54 (many ways to do it)

2. when running “http://domain/frontend/web/index.php”
PHP Warning – yii\base\ErrorException

mcrypt_create_iv(): Cannot open source device

fix: this is because we have run php-fpm in chroot to /opt/php-5.4.36. and we need to fix the random devices.
$ mkdir /opt/php-5.4.36/dev
$ mknod -m 0666 /opt/php-5.4.36/dev/null c 1 3
$ mknod -m 0666 /opt/php-5.4.36/dev/random c 1 8
$ mknod -m 0666 /opt/php-5.4.36/dev/urandom c 1 9

Leave a Reply

Your email address will not be published. Required fields are marked *

four × 1 =