AdminLTE + symfony2 -> Unable to find file - php

I tried to install the adminlte bundle but with no luck. Ive always get:
Unable to find file "#AvanzuAdminThemeBundle/Resources/public/vendor/modernizr/modernizr.js" in . (which is being imported from "app\cache\dev/assetic/routing.yml").
things ive done:
Added this to the composer.json
{
"require": {
"avanzu/admin-theme-bundle": "~1.3"
}
}
then php composer.phar require avanzu/admin-theme-bundle
added new Avanzu\AdminThemeBundle\AvanzuAdminThemeBundle(), to the AppKernel
Copy everything with app/console assets:install --symlink
Then went to the base.html.twig and added
{% extends 'AvanzuAdminThemeBundle:layout:base-layout.html.twig' %}
If i start the server i get those error. The files are located here:
./vendor/avanzu/admin-theme-bundle/Resources/public/static/dev/scripts/modernizr.js
./vendor/avanzu/admin-theme-bundle/Resources/public/static/prod/scripts/modernizr.js
./web/bundles/avanzuadmintheme/static/dev/scripts/modernizr.js
./web/bundles/avanzuadmintheme/static/prod/scripts/modernizr.js
Whats my fault? Thanks!

You have to fetch all the vendors as well :
php app/console avanzu:admin:fetch-vendor
Here is the documentation.
Good luck!

Run the following command to create all the symlinks
php bin/console assets:install --symlink
OR
php app/console assets:install --symlink

Related

projet symfony dont display css and js and pictures

I created one project in symfony 2 I send it to my company but the project not working properly no fils css, no file js no pictures.
I'need my my laptop it works correctly.
So i connected remotly to my company
I excuted this command
php app/console assetic:dump
but I have this problem
There are no commands defined in the "assetic" namespace.
Did you mean this?
assets
I don't know why I have this problem with this command. But
php app/console assets:install it works correctly
Thanks stack overflow
In the documentation is written that be used with:
php app/console assetic:dump --env=prod --no-debug
maybe the directory seperator like \ and no /
https://symfony.com/doc/2.8/assetic/asset_management.html#dumping-asset-files-in-the-prod-environment
this command belongs to this bundle
https://github.com/symfony/assetic-bundle
I think above bundle is not installed.
check your composer.json or vendor folder.

Could not open file app/console Symfony 2.8

I am using Symfony 2.8 using Symfony 3 directory structure. After recent composer install it is complaining that
An error occurred when executing the "'cache:clear --no-warmup'" command: Could not open input file: app/console
I looked at the change log and could not find anything regarding this change is there anyway to fix this issue.
Do you have a console folder inside the app one ?
btw try to do php bin/console cache:clear --no-warmup
bin/console is the new directory in Symfony 3. It's maybe the same issue.
Create var directory.
Explanation:
vendor/sensio/distribution-bundle/Composer/ScriptHandler.php:462
protected static function useNewDirectoryStructure(array $options)
{
return isset($options['symfony-var-dir']) && is_dir($options['symfony-var-dir']);
}
So you need both to have symfony-var-dir in composer.json's extra and have this directory existing.

Symfony2.7.1 fresh installation. Failed to load resource

Symfony2 developers:
Recently, I am planning to get familiar with Symfony2, using it as api project. Current version is v2.7.1.
I already have apache installed as my local environment. So the installation root directory is:
//localhost/symfony
So I followed official guide to install it. Everything looks fine after installation. But when I view the page in development environment (app_dev.php).
//localhost/symfony/web/app_dev.php
Page content display as expected, but not styled. Then I open console and find some 404 response as follows:
Failed to load resource
//localhost/symfony/web/bundles/framework/css/structure.css
//localhost/symfony/web/bundles/framework/css/body.css
//localhost/symfony/web/bundles/framework/css/exception.css
//localhost/symfony/web/app_dev.php
//localhost/symfony/web/bundles/framework/css/structure.css
//localhost/symfony/web/bundles/framework/css/body.css
//localhost/symfony/web/bundles/framework/css/exception.css
I looked into project/web/bundles directory, found nothing inside but two empty file.
framework and sensiodistribution.
Fresh installation without any config change. I got this problem. Could you guys give some explanation why it occurs. Otherwise I didn't get the full package?
Do I miss those files inside project/web/bundles?
If the case in which i missed those file. So could you send me an archive file on current version 2.7.1?
You must run the command app/console assets:install to generate symlinks (or files) in /web/bundles
If these files exists then you probably have problem with URL Rewriting check your .htaccess or configure your host. You can also use command php app/console server:start and check there if it works
You can run composer install to install all necessary bundles and libraries and probably composer.json has defined postinstall commands.
If you use assetic then you can try to run php app/console assetic:dump more on http://symfony.com/doc/current/cookbook/assetic/asset_management.html
In Symfony 2.6 you have new asset manager read more on http://symfony.com/blog/new-in-symfony-2-6-smarter-assets-install-command
php app/console assets:install or php app/console assets:install --symlink
for Symfony 3.x the directory changed from app to bin so commands are:
php bin/console assets:install or php bin/console assets:install --symlink
Since I landed here from a Symfony 3 search this might be useful for Symfony 3 users having the same problem
Run php bin/console assets:install at the project root

How to generate entity classes from yaml files in doctrine 2

I am following this link to generate entities from yaml files.
Doctrine 2 ORM 2 documentation
I have installed doctrine2 using composer, using following command on CMD
D:\wamp\bin\php\php5.4.16>php.exe "D:\jsingh7 stuff\PHP\composer.phar"
install
Below is the directory structure that the composer has made in my
D:\wamp\bin\php\php5.4.16\vendor
I have very less knowledge about command prompt so facing issue in understanding that why the command in not working.
the command I am using is
C:\Users\jsingh7>php vendor/bin/doctrine orm:generate-entities --help
it shows - Could not open input file: vendor/bin/doctrine
Any guidance will be appreciated!
Thanks.
From your screenshots it looks like you are trying to find and run a doctrine script located in C:\Users\jsingh7\vendor\bin when it is actually installed in D:\wamp\bin\php\php5.4.16\vendor\bin.
Try:
C:\Users\jsingh7> php D:\wamp\bin\php\php5.4.16\vendor\bin\doctrine orm:generate-entities --help
Or perhaps better yet, install doctrine locally for your project (e.g. "myproject"):
Create a C:\Users\jsingh7\myproject\composer.json with the following contents:
{
"require": {
"doctrine/orm": "*"
}
}
Run the "composer install" command:
C:\Users\jsingh7\myproject> composer install
You should now be able to run the doctrine script locally:
C:\Users\jsingh7\myproject> php vendor/bin/doctrine orm:generate-entities --help

problems with symfony2 images (403 forbidden)

I uploaded symfony2 project to servergrove.com and after this created assets using
php app/console assets:install --symlink web
and also
php app/console assetic:dump --env=prod --no-debug
After these steps I can't access images in the web/bundles folder, I get a "403 forbidden" error.
The URL to my site is http://myserjtankian.com.preview-sg111.servergrove.com/
You may fix that using this command line (without --symlink web arg) :
php app/console assets:install
This will install assets as hard copies.
Hope it's helpful
Best regard

Categories