【问题标题】:Symfony 5 on synology DSM 6.2.3-25426 Update 3Synology DSM 6.2.3-25426 更新 3 上的 Symfony 5
【发布时间】:2021-03-17 03:55:25
【问题描述】:

我想迁移到 Symfony 5 作为开发环境。我尝试在带有 DSM 6.2.3-25426 Update 3 的 Synology NAS 上使用 composer 进行安装。

PHP 7.3 作为 php 版本。

我按照 symfony 入门指南中的步骤进行操作,除了稍微更改 php 配置外,一切似乎都安装得很顺利。

但是,安装 symfony 演示应用程序后,我无法运行它。我在浏览器中使用synology的网络地址测试如下:http://192.168.x.x:8000,但是浏览器只是超时。我在 nas 上运行 apache 2.4,但希望使用推荐的“本地”symfony 网络服务器进行开发。

有什么想法吗?

这是我在这里的第一篇文章,希望我正确地遵循了发布指示。

在演示应用的文件夹中启动本地网络服务器会得到以下输出:

*Tailing Web Server log file (/root/.symfony/log/0680ffe11c930b95313342ec04d46c96d69954df.log)
Tailing PHP log file (/root/.symfony/log/0680ffe11c930b95313342ec04d46c96d69954df/7daf403c7589f4927632ed3b6af762a992f09b78.log)
 [OK] Web server listening
      The Web server is using PHP CLI 7.3.16
      https://127.0.0.1:8000
[Web Server ] Mar 16 16:46:14 |DEBUG  | PHP    Reloading PHP versions
[Web Server ] Mar 16 16:46:15 |DEBUG  | PHP    Using PHP version 7.3.16 (from .php-version from current dir: /volume1/web/symfdemo/.php-version)
[Application] Mar 16 15:31:54 |INFO   | PHP    Deprecated: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
[Application] Mar 16 15:31:54 |INFO   | PHP    User Deprecated: Auto-registration of the command "Symfony\Bundle\SwiftmailerBundle\Command\SendEmailCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
[Application] Mar 16 15:31:54 |INFO   | PHP    User Deprecated: Auto-registration of the command "Symfony\Bundle\SwiftmailerBundle\Command\DebugCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
[Application] Mar 16 15:31:54 |INFO   | PHP    User Deprecated: Auto-registration of the command "Symfony\Bundle\SwiftmailerBundle\Command\NewEmailCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
[Application] Mar 16 15:31:54 |INFO   | PHP    User Deprecated: Auto-registration of the command "Sensio\Bundle\GeneratorBundle\Command\GenerateCommandCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
[Application] Mar 16 15:31:54 |INFO   | PHP    User Deprecated: Auto-registration of the command "Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineCrudCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
[Application] Mar 16 15:31:54 |INFO   | PHP    User Deprecated: Auto-registration of the command "Sensio\Bundle\GeneratorBundle\Command\GenerateBundleCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
[Application] Mar 16 15:31:54 |INFO   | PHP    User Deprecated: Auto-registration of the command "Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineEntityCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
[Application] Mar 16 15:31:54 |INFO   | PHP    User Deprecated: Auto-registration of the command "Sensio\Bundle\GeneratorBundle\Command\GenerateControllerCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
[Application] Mar 16 15:31:54 |INFO   | PHP    User Deprecated: Auto-registration of the command "Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineFormCommand" is deprecated since Symfony 3.4 and won't be supported in 4.0. Use PSR-4 based service discovery instead.
[Web Server ] Mar 16 16:46:15 |INFO   | PHP    listening path="/volume1/@appstore/PHP7.3/usr/local/bin/php" php="7.3.16" port=42752*

【问题讨论】:

  • 请分享更多细节 - 您面临的具体问题是什么?该日志包含很多弃用消息,在我看来,它们毕竟与 Symfony 5 无关
  • 抱歉不清楚...在synology nas上安装symfony后,我安装了symfony演示应用程序,但无法通过浏览器从我的客户端开发机器访问它。原来我太专注于安装过程,以至于忘记在端口 8000 上打开防火墙...... sigh!

标签: php symfony symfony5 synology


【解决方案1】:

这看起来像您使用 symfony serve 启动服务器,该页面默认为 https://127.0.0.1:8000。上面控制台的输出还显示了它正在侦听的位置。

假设您的代码将退出开发阶段,我还应该更清楚地了解接下来的步骤。您需要仔细查看 Symfony Webserver Configurations 并评估您使用 Apache(或 Nginx)的最佳选择。

【讨论】:

  • 谢谢!将在我的第一次部署中查看它!
【解决方案2】:

抱歉,不清楚... 在 Synology NAS 上安装 symfony 后,我安装了 symfony 演示应用程序,但无法通过浏览器从我的客户端开发机器访问它。原来我太专注于安装过程,以至于忘记在 8000 端口打开防火墙……唉!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-10
    • 1970-01-01
    • 1970-01-01
    • 2015-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-21
    相关资源
    最近更新 更多