在php.ini中,找到disable_functions选项,看看后面是否有proc_open函数被禁用了,如果有的话,去掉即可,disable_functions中proc_open,proc_get_status去掉,http://www.cnblogs.com/crisenchou/p/6237781.html
find / -name "php.ini"
vim /usr/local/php/etc/init.d/php.ini->把display_error=Off改成On
重启php-->/etc/init.d/php-fpm restart
Warning: require(/home/www/yii2-blog/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /home/www/yii2-blog/vendor/composer/autoload_real.php on line 66
Fatal error: require(): Failed opening required '/home/www/yii2-blog/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:') in /home/www/yii2-blog/vendor/composer/autoload_real.php on line 66
这个问题说明你修改了yii安装目录,没有安装在wwwroot中,此时找到fastcgi.conf
find / -name "fastcgi.conf"
vim /usr/local/nginx/conf/fastcgi.conf最后一行把$document_root修改成你的代码目录
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/www/hxq/:/tmp/:/proc/";
重启nginx-->/usr/local/nginx/sbin/nginx -s reload
#yii框架使用代码
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php?$args;
}
这步我费了好大力气才搞定的,Yii2就是安装“fxp/composer-asset-plugin”插件。
composer global require "fxp/composer-asset-plugin:~1.1"
上面的是官网的命令,我使用该命令一直无法成功。我是使用的下面的命令才成功
composer global require "fxp/composer-asset-plugin:@dev"
https://github.com/myloveGy/yii2-ace-admin
只要对定义 @bower的地方做下修改就好了。
vim vendor/yiisoft/yii2/base/Application.php
public function setVendorPath($path)
{
$this->_vendorPath = Yii::getAlias($path);
Yii::setAlias('@vendor', $this->_vendorPath);
//Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower');注释掉
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . 'bower-asset');
Yii::setAlias('@npm', $this->_vendorPath . DIRECTORY_SEPARATOR . 'npm');
}
如果此文对你有所帮助,请随意打赏鼓励作者^_^
微信公众号
微信
最新评论
总共0条评论