Skip to content
  • About
    • What is Symfony?
    • Community
    • News
    • Contributing
    • Support
  • Documentation
    • Symfony Docs
    • Symfony Book
    • Screencasts
    • Symfony Bundles
    • Symfony Cloud
    • Training
  • Services
    • SensioLabs Professional services to help you with Symfony
    • Platform.sh for Symfony Best platform to deploy Symfony apps
    • SymfonyInsight Automatic quality checks for your apps
    • Symfony Certification Prove your knowledge and boost your career
    • Blackfire Profile and monitor performance of your apps
  • Other
  • Blog
  • Download
sponsored by SensioLabs
  1. Home
  2. Documentation
  3. SymfonyCloud
  4. Troubleshooting
  • Platform.sh, the Official Symfony PaaS
  • Getting Started
  • Configuration
  • Environment Variables
  • Troubleshooting

Troubleshooting

Edit this page

Troubleshooting

How to access the Application Logs?

Display the application log file via:

1
$ symfony log app --tail

Any log messages generated by the application is sent to this app file. This includes language errors such as PHP Errors, Warnings, and Notices, as well as uncaught exceptions.

It also contains your application logs if you log on stderr.

Because Platform.sh manages this file for you (preventing disks to get filled and using very fast local drives instead of slower network disk), we recommend that applications always output their log to stderr. For Monolog, check config/packages/prod/monolog.yaml:

1
2
3
4
5
6
7
8
9
10
11
--- a/config/packages/prod/monolog.yaml
+++ b/config/packages/prod/monolog.yaml
@@ -11,7 +11,7 @@ monolog:
            members: [nested, buffer]
        nested:
            type: stream
-            path: "%kernel.logs_dir%/%kernel.environment%.log"
+            path: php://stderr
            level: debug
        buffer:
            type: buffer

If you log deprecations, don't forget to log them on stderr as well.

Oops! An Error Occurred

This error message comes from your application and is generated by the default Symfony's error template.

The server returned a "500 Internal Server Error"

A 500 error page in the production mode

If your application works locally but you see this message on Platform.sh it usually means you have a configuration error or missing a dependency.

To fix this issue you have to inspect application logs, the cause of the error is usually specified in the error message:

1
2
3
4
5
$ symfony logs all
[app] [14-Aug-2020 10:52:27 UTC] [critical] Uncaught PHP Exception Exception: [...]
[app]
[php.access] 2020-08-14T10:52:27Z GET 500 2.386 ms 2048 kB 419.11% /
[access] 78.247.136.119 - - [14/Aug/2020:10:52:27 +0000] "GET / HTTP/1.1" 500 843 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36"

If the error happens on a non production environment or on the main environment of a non production project you can also enable Symfony's dev/debug mode to inspect the cause of the error:

1
2
3
4
# Enable debug mode
$ symfony env:debug
# Disable debug mode
$ symfony env:debug --off

The server returned a "404 Not Found"

New Symfony applications comes without controllers by default. This means there's no page to show as a homepage. When running your project locally you should have been welcomed with this page:

The default Symfony welcome page in the development mode

But with this page when running on Platform.sh:

A 404 error page in the production mode

This is because Platform.sh runs in production mode and as such Symfony shown a generic 404 error. To fix this, you will have to create your first Symfony page.

If you already created a custom page, check that all your files are committed, that you ran symfony deploy and it succeeded.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
TOC
    Version

    Symfony footer

    ↓ Our footer now uses the colors of the Ukrainian flag because Symfony stands with the people of Ukraine.

    Avatar of Thiago Melo, a Symfony contributor

    Thanks Thiago Melo for being a Symfony contributor

    2 commits • 22 lines changed

    View all contributors that help us make Symfony

    Become a Symfony contributor

    Be an active part of the community and contribute ideas, code and bug fixes. Both experts and newcomers are welcome.

    Learn how to contribute

    Symfony™ is a trademark of Symfony SAS. All rights reserved.

    • What is Symfony?

      • Symfony at a Glance
      • Symfony Components
      • Case Studies
      • Symfony Releases
      • Security Policy
      • Logo & Screenshots
      • Trademark & Licenses
      • symfony1 Legacy
    • Learn Symfony

      • Symfony Docs
      • Symfony Book
      • Reference
      • Bundles
      • Best Practices
      • Training
      • eLearning Platform
      • Certification
    • Screencasts

      • Learn Symfony
      • Learn PHP
      • Learn JavaScript
      • Learn Drupal
      • Learn RESTful APIs
    • Community

      • SymfonyConnect
      • Support
      • How to be Involved
      • Code of Conduct
      • Events & Meetups
      • Projects using Symfony
      • Downloads Stats
      • Contributors
      • Backers
    • Blog

      • Events & Meetups
      • A week of symfony
      • Case studies
      • Cloud
      • Community
      • Conferences
      • Diversity
      • Documentation
      • Living on the edge
      • Releases
      • Security Advisories
      • SymfonyInsight
      • Twig
      • SensioLabs
    • Services

      • SensioLabs services
      • Train developers
      • Manage your project quality
      • Improve your project performance
      • Host Symfony projects

      Deployed on

    Follow Symfony

    Search by Algolia