denghp
- denghp 评论了教程 yii2-imagine配置
hi 你好:
我使用php composer.phar require --prefer-dist yiisoft/yii2-imagine
安装好了yii2-imagine插件,然后依赖库imagine/imagine也安装了,但是使用的时候还是报
PHP Fatal Error – yii\base\ErrorException Class 'Imagine\Image\ManipulatorInterface' not found
yii2扩展文件中也已经添加
'yiisoft/yii2-imagine' => array ( 'name' => 'yiisoft/yii2-imagine', 'version' => '9999999-dev', 'alias' => array ( '@yii/imagine' => $vendorDir . '/yiisoft/yii2-imagine', ), ),
vender目录结构:
denghp@denghp:~/webroot/yii2-demo$ ll vendor/
total 76
drwxrwxr-x 18 denghp denghp 4096 6月 27 22:50 ./
drwxrwxr-x 13 denghp denghp 4096 7月 22 23:18 ../
-rw-rw-r-- 1 denghp denghp 183 6月 23 22:37 autoload.php
drwxrwxr-x 3 denghp denghp 4096 6月 23 22:37 fzaninotto/
drwxr-xr-x 3 denghp denghp 4096 6月 27 22:49 imagine/
drwxrwxr-x 11 denghp denghp 4096 7月 22 23:22 yiisoft/
denghp@denghp:~/webroot/yii2-demo$ ll vendor/yiisoft/
total 52
drwxrwxr-x 11 denghp denghp 4096 7月 22 23:22 ./
drwxrwxr-x 18 denghp denghp 4096 6月 27 22:50 ../
-rw-rw-r-- 1 denghp denghp 7478 7月 22 22:56 extensions.php
drwxrwxr-x 27 denghp denghp 4096 6月 23 22:37 yii2/
drwxrwxr-x 2 denghp denghp 4096 6月 23 22:37 yii2-bootstrap/
drwxrwxr-x 2 denghp denghp 4096 6月 23 22:37 yii2-codeception/
drwxrwxr-x 2 denghp denghp 4096 6月 23 22:37 yii2-composer/
drwxrwxr-x 9 denghp denghp 4096 6月 23 22:37 yii2-debug/
drwxrwxr-x 2 denghp denghp 4096 6月 23 22:37 yii2-faker/
drwxrwxr-x 8 denghp denghp 4096 6月 23 22:37 yii2-gii/
drwxr-xr-x 2 denghp denghp 4096 6月 27 22:50 yii2-imagine/
drwxrwxr-x 2 denghp denghp 4096 6月 23 22:37 yii2-swiftmailer/不知道我哪里引用的不对?
- denghp 回答了问题 yii2 restful 测试时,地址问题?
楼主 你好 不知道你用nginx怎么配置restful api的虚拟域名访问的? 我配置如下,但是一直报404错误,困扰我很久了
server {charset utf-8; client_max_body_size 128M; set $fcgi_server 127.0.0.1:9000; listen 80; ## listen for ipv4 server_name api.denghp.com; root /home/denghp/webroot/yii2-advanced-api/api/web; index index.php; access_log /usr/local/nginx/logs/yii2_demo_api_access.log main; error_log /usr/local/nginx/logs/yii2_demo_api_error.log; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass $fcgi_server; } location ~ /\.(ht|svn|git) { deny all; }
}
访问地址,都试过
http://api.denghp.com/v1/countries
http://api.denghp.com/v1/country denghp@denghp:~/soft/yii2-app-advanced$ composer global require "fxp/composer-asset-plugin:1.0.0" Changed current directory to /home/denghp/.composer ./composer.json has been created Loading composer repositories with package information [ErrorException] Invalid argument supplied for foreach() require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [packages1] ... [packagesN]
为啥直接报这个错误呢?