我最近遇到了Sanota Project并希望尝试一下。我正在尝试按照here
提到的快速安装步骤安装所有sanota项目包当我运行网站php app/console server:run
时,我看到的只是白色屏幕。我在app_dev.log
我交叉检查了Appkernel.php
中是否启用了捆绑包,它们似乎是。
public function registerBundles()
{
$bundles = array(
// SYMFONY STANDARD EDITION
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
// DOCTRINE
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
// KNP HELPER BUNDLES
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(),
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
// USER
new FOS\UserBundle\FOSUserBundle(),
new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),
// PAGE
new Sonata\PageBundle\SonataPageBundle(),
new Application\Sonata\PageBundle\ApplicationSonataPageBundle(),
// NEWS
new Sonata\NewsBundle\SonataNewsBundle(),
new Application\Sonata\NewsBundle\ApplicationSonataNewsBundle(),
// MEDIA
new Sonata\MediaBundle\SonataMediaBundle(),
new Application\Sonata\MediaBundle\ApplicationSonataMediaBundle(),
// new Liip\ImagineBundle\LiipImagineBundle(),
new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
// Disable this if you don't want the audit on entities
new SimpleThings\EntityAudit\SimpleThingsEntityAuditBundle(),
// API
new FOS\RestBundle\FOSRestBundle(),
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
// E-COMMERCE
new Sonata\BasketBundle\SonataBasketBundle(),
new Application\Sonata\BasketBundle\ApplicationSonataBasketBundle(),
new Sonata\CustomerBundle\SonataCustomerBundle(),
new Application\Sonata\CustomerBundle\ApplicationSonataCustomerBundle(),
new Sonata\DeliveryBundle\SonataDeliveryBundle(),
new Application\Sonata\DeliveryBundle\ApplicationSonataDeliveryBundle(),
new Sonata\InvoiceBundle\SonataInvoiceBundle(),
new Application\Sonata\InvoiceBundle\ApplicationSonataInvoiceBundle(),
new Sonata\OrderBundle\SonataOrderBundle(),
new Application\Sonata\OrderBundle\ApplicationSonataOrderBundle(),
new Sonata\PaymentBundle\SonataPaymentBundle(),
new Application\Sonata\PaymentBundle\ApplicationSonataPaymentBundle(),
new Sonata\ProductBundle\SonataProductBundle(),
new Application\Sonata\ProductBundle\ApplicationSonataProductBundle(),
new Sonata\PriceBundle\SonataPriceBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
new FOS\CommentBundle\FOSCommentBundle(),
new Sonata\CommentBundle\SonataCommentBundle(),
new Application\Sonata\CommentBundle\ApplicationSonataCommentBundle(),
// SONATA CORE & HELPER BUNDLES
new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
new Sonata\CoreBundle\SonataCoreBundle(),
new Sonata\IntlBundle\SonataIntlBundle(),
new Sonata\FormatterBundle\SonataFormatterBundle(),
new Sonata\CacheBundle\SonataCacheBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Sonata\SeoBundle\SonataSeoBundle(),
new Sonata\ClassificationBundle\SonataClassificationBundle(),
new Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle(),
new Sonata\NotificationBundle\SonataNotificationBundle(),
new Application\Sonata\NotificationBundle\ApplicationSonataNotificationBundle(),
new Application\Sonata\SeoBundle\ApplicationSonataSeoBundle(),
new Sonata\DatagridBundle\SonataDatagridBundle(),
// Search Integration
//new FOS\ElasticaBundle\FOSElasticaBundle(),
// CMF Integration
new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
// DEMO and QA - Can be deleted
new Sonata\Bundle\DemoBundle\SonataDemoBundle(),
new Sonata\Bundle\QABundle\SonataQABundle(),
// Disable this if you don't want the timeline in the admin
new Spy\TimelineBundle\SpyTimelineBundle(),
new Sonata\TimelineBundle\SonataTimelineBundle(),
new Application\Sonata\TimelineBundle\ApplicationSonataTimelineBundle(), // easy extends integration
new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle()
);
无论我访问什么路线
/blog
/page
/media
/admin
我看到的只是白色屏幕而app_dev.log
没有错误。
我正在使用Ubuntu和xampp,所有其他symfony项目都运行良好,除了这个Sonata项目。我的xampp日志也没有提到可能导致此错误的任何错误。事实上,我清除了我的日志文件,因此只记录了与Sonata相关的错误,如果有的话,所有日志文件都是空的。
尝试使用composer
进行安装时 composer create-project sonata-project/sandbox:dev-2.4-develop
或
composer create-project sonata-project/sandbox:dev-2.3-develop
或
composer create-project sonata-project/sandbox:2.3.x-dev
我收到以下错误
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for doctrine/doctrine-migrations-bundle ~2.0@dev -> satisfiable by doctrine/doctrine-migrations-bundle[2.0.x-dev].
- doctrine/doctrine-migrations-bundle 2.0.x-dev requires symfony/symfony >=2.0,<2.1 -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see for more details.
Read for further common problems.
我也遵循these指示,但没有运气。
因为这是我第一次使用索纳塔,所以我可能会做错事。我真的很感激你的帮助。
答案 0 :(得分:1)
您必须将文件 composer.json ,第34行更改为:
"doctrine/doctrine-migrations-bundle": "1.0.*",
之后在沙箱文件夹中输入此命令:
composer update
答案 1 :(得分:0)
您尝试安装的项目的minimum-stability
设置为高于dev
的选项。因此作曲家将无法安装此项目。
首先尝试安装项目的稳定版本,然后通过将dev
更改为minimum-stability
来尝试升级到dev
版本。
composer create-project sonata-project/sandbox
我建议您也将prefer-stable
设置为true,这样其他软件包就不会全部切换到dev-master
分支。