" assets:install"命令失败,并显示错误“目标目录” Web”。不存在”,为什么呢? [英] "assets:install" command fails with error "The target directory "web" does not exist", why?
问题描述
我正在Docker容器中运行Symfony3应用程序。我用所有资源(js,css,图像)创建了一个 CommonBundle
。此资源链接到另一条路径,如下所示:
I am running a Symfony3 application inside a Docker container. I have created a CommonBundle
with all the resources (js, css, images). This resources are symlinked to another path as shown below:
$ docker exec -u www-data -it dockeramp_php_1 ls -la oneview_symfony/src/CommonBundle/Resources/public
total 8
drwxrwsr-x 2 www-data www-data 4096 Feb 23 21:09 .
drwxr-sr-x 5 www-data www-data 4096 Feb 23 20:54 ..
lrwxrwxrwx 1 root www-data 32 Feb 23 21:09 css -> /var/www/html/public_html/styles
lrwxrwxrwx 1 root www-data 32 Feb 23 21:09 images -> /var/www/html/public_html/images
lrwxrwxrwx 1 root www-data 28 Feb 23 21:08 js -> /var/www/html/public_html/js
目录 oneview_symfony / web
确实存在,并且可以通过 www-data
进行写入,如下所示:
The directory oneview_symfony/web
does exists and it's writable by www-data
as shown below:
$ docker exec -u www-data -it dockeramp_php_1 ls -la oneview_symfony/web
total 64
drwxrwsr-x 3 www-data www-data 4096 Feb 23 20:50 .
drwxrwsr-x 9 www-data www-data 4096 Feb 23 21:16 ..
-rwxrwxr-x 1 www-data www-data 3319 Feb 23 16:45 .htaccess
-rwxrwxr-x 1 www-data www-data 631 Feb 23 16:45 app.php
-rwxrwxr-x 1 www-data www-data 843 Feb 23 16:45 app_dev.php
-rwxrwxr-x 1 www-data www-data 2092 Feb 23 16:45 apple-touch-icon.png
drwxr-sr-x 2 www-data www-data 4096 Feb 23 20:50 bundles
-rw-rw-rw- 1 www-data www-data 21486 Feb 23 20:50 config.php
-rwxrwxr-x 1 www-data www-data 6518 Feb 23 16:45 favicon.ico
-rwxrwxr-x 1 www-data www-data 116 Feb 23 16:45 robots.tx
我是尝试在 composer.json $上安装资产
相对
或 symlink
转换值c $ c>文件:
I am trying to install the assets relative
or symlink
switching values on the composer.json
file:
{
...
"extra": {
...
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
}
}
我正在尝试bish运行以下命令并最终出现以下错误的资产:
I am trying to publish the assets running the following command and ending up with the error below:
$ docker exec -u www-data -it dockeramp_php_1 php oneview_symfony/bin/console assets:install
[InvalidArgumentException]
The target directory "web" does not exist.
我在这里缺少什么?
在这里有类似的问题,但到目前为止还没有答案。
There is a similar issue here but without answer so far.
推荐答案
可以改用以下命令:
$ docker exec -u www-data -it dockeramp_php_1 php oneview_symfony/bin/console assets:install web
如果这不起作用,请尝试使用 web
目录的完整路径。
让我们知道是否可行。不知道是否能解决问题,但是请尝试。
If that doesn't work, try the full path to the web
directory.
Let us know if that works. Not sure if that will fix the problem, but please try it.
这篇关于" assets:install"命令失败,并显示错误“目标目录” Web”。不存在”,为什么呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!