Symfony prod error 500

Display the application log file via:

Edit this page

Troubleshooting

How to access the Application Logs?

Display the application log file via:

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:

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:

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:

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.

Содержание

  1. Display only error 500, when you have the wrong configuration in debug mode. #36254
  2. Comments
  3. . Sorry for may very bad english .
  4. Блог веб-разработчика
  5. Symfony: настраиваем собственные обработчики ошибок (404, 500, unavailable.php)
  6. Настройка собственного действия и шаблона ошибки 404
  7. Выводим собственную страницу для ошибок 500
  8. Настраиваем собственный шаблон страницы при отключении нашего приложения (application)

Display only error 500, when you have the wrong configuration in debug mode. #36254

Symfony version(s) affected: 4.4.*

Description
When you have the wrong configuration, instead of showing exceptions, an 500 page is displayed.
This problem does not depend on the environment.

How to reproduce
Just set malformed *.ymal file something like this :

The text was updated successfully, but these errors were encountered:

What else would you expect? If the app is broken, a 500 is the correct display, isn’t it?
If you mean that you’d expect a nice customized error page, that’s not possible: because the config is broken, the nice error page cannot be configured.

In debug mode, it shows a LoaderLoadException , telling you which file contains malformed YAML.

You can’t compile the container, so you can’t register an ExceptionListener that would do anything else. I’m not sure how you could do anything else at the Symfony level. You could use your webserver (e.g. nginx or Apache) to intercept 500 errors and show something more end-user friendly, but I’d first try to change the workflow so I don’t need to handle broken YAML files in production.

. Sorry for may very bad english .

@nicolas-grekas I expect at least two things:

  1. possability to see errors in debug mode.
  2. possability to change error page.

This is a very annoying problem because not all errors are displayed.

@blowski It is on symfony level. error-hanlder composent overwrites all server and php configurations.

when you have error in routes/*.yaml if you have this page:

This page generated in SymfonyComponentErrorHandlerErrorRendererHtmlErrorRenderer and not correct pass $debug __construct parameter.

After small but very stupid fix something like this :

i have this page :

Источник

Блог веб-разработчика

О разработке веб-приложений на Symfony

Symfony: настраиваем собственные обработчики ошибок (404, 500, unavailable.php)

На каждом проекте не забываем настраивать обработчики ошибок, а то получим вот такие сюрпризы на продакшен сервере для страниц ошибок 404 и 500:

Настройка собственного действия и шаблона ошибки 404

1) Активируем опции error_404_module и error_404_action в конфигурационном файле settings.yml

2) Создаем наш шаблон ошибки 404 error404Success.php

3) Очищаем кеш проекта

Учтите, что в dev-режиме отработает обработчик ошибки 404 Symfony, а не наш. Такой небольшой нюанс.

Выводим собственную страницу для ошибок 500

За это отвечает файл error.html.php. Оригинал файла можно найти в исходниках Symfony «/symfony-1.2/lib/exception/data/error.html.php». Файл надо создать в папке нашего проекта «config/error/error.html.php»

Настраиваем собственный шаблон страницы при отключении нашего приложения (application)

Когда это может потребоваться? Например, Вам требуется обновить Ваш сайт, и это заберет некоторое время. В этом случае отключаем наш сайт и выводим красивую страничку, мол у нас проводятся «технические работы». Весьма полезная штука.

Что надо чтобы отключить/включить наше приложение:

1) Создаем свой шаблон unavailable.php и кладем его в одну из следующих директорий:
• /site/apps/frontend/config/unavailable.php
• /site/config/unavailable.php
• /site/config/web/errors/unavailable.php

Тут есть один момент. Можно спросить: «А зачем нам сохранять файл в папке frontend?». Это весьма полезная особенность, т.к. в этом случае мы можем изменить вывод этой страницы для www и wap, что очень важно.

2) Включаем опцию check_lock в файле settings.yml. После того как закончили все работы и включили приложение, не забудьте отключить эту опцию, т.к. при каждой загрузке страницы осуществляется проверка состояния приложения.

3) Отключаем наше приложение

4) Очищаем кеш проекта и наше приложение отключено

Для включения приложения выполняем следующие команды:

Источник

Comments

@ikakarov

Symfony version(s) affected: 4.4.*

Description
When you have the wrong configuration, instead of showing exceptions, an 500 page is displayed.
This problem does not depend on the environment.

How to reproduce
Just set malformed *.ymal file something like this :

# config/routes/annotations.yaml
;321-

@nicolas-grekas

What else would you expect? If the app is broken, a 500 is the correct display, isn’t it?
If you mean that you’d expect a nice customized error page, that’s not possible: because the config is broken, the nice error page cannot be configured…

@blowski

In debug mode, it shows a LoaderLoadException, telling you which file contains malformed YAML.

ParseException > InvalidArgumentException > LoaderLoadException
HTTP 500 Internal Server Error 

The file "config/routes/annotations.yaml" does not contain valid YAML in config/routes/annotations.yaml (which is loaded in resource "config/routes/annotations.yaml").

You can’t compile the container, so you can’t register an ExceptionListener that would do anything else. I’m not sure how you could do anything else at the Symfony level. You could use your webserver (e.g. nginx or Apache) to intercept 500 errors and show something more end-user friendly, but I’d first try to change the workflow so I don’t need to handle broken YAML files in production.

@ikakarov

!!! Sorry for may very bad english !!!

@nicolas-grekas I expect at least two things:

  1. possability to see errors in debug mode.
  2. possability to change error page.

This is a very annoying problem because not all errors are displayed.

@blowski It is on symfony level. error-hanlder composent overwrites all server and php configurations.

when you have error in routes/*.yaml if you have this page:
image

This page generated in SymfonyComponentErrorHandlerErrorRendererHtmlErrorRenderer and not correct pass $debug __construct parameter.

After small but very stupid fix something like this :

#vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php
...
 /**
     * @param bool|callable $debug        The debugging mode as a boolean or a callable that should return it
     * @param bool|callable $outputBuffer The output buffer as a string or a callable that should return it
     */
    public function __construct($debug = false, string $charset = null, $fileLinkFormat = null, string $projectDir = null, $outputBuffer = '', LoggerInterface $logger = null)
    {

        if (!is_bool($debug) && !is_callable($debug)) {
            throw new TypeError(sprintf('Argument 1 passed to "%s()" must be a boolean or a callable, "%s" given.', __METHOD__, is_object($debug) ? get_class($debug) : gettype($debug)));
        }

        if (!is_string($outputBuffer) && !is_callable($outputBuffer)) {
            throw new TypeError(sprintf('Argument 5 passed to "%s()" must be a string or a callable, "%s" given.', __METHOD__, is_object($outputBuffer) ? get_class($outputBuffer) : gettype($outputBuffer)));
        }
##< FORCE CHECK  DEBUG ENV
  if(getenv('APP_ENV') != 'prod' 
            OR getenv('APP_DEBUG') == 1
            OR (isset($_SERVER['APP_DEBUG']) AND $_SERVER['APP_DEBUG'] == 1) 
        ){
            $debug = true;
        }
##> FORCE CHECK  DEBUG ENV
        $this->debug = $debug;
        $this->charset = $charset ?: (ini_get('default_charset') ?: 'UTF-8');
        $this->fileLinkFormat = $fileLinkFormat ?: (ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'));
        $this->projectDir = $projectDir;
        $this->outputBuffer = $outputBuffer;
        $this->logger = $logI can't overwrite  `error_handler.error_renderer.html` service. In my case i just replace SymfonyComponentErrorHandlerErrorRenderer namesapce in composer whit my own file. ger;
    }
...

i have this page :
image

I can’t overwrite error_handler.error_renderer.html service. In my case i just replace SymfonyComponentErrorHandlerErrorRenderer namesapce in composer whit my own stupid fix class.

@blowski

Thanks for the update.

I just did the following:

  • clean install of Symfony 4.4
  • entered invalid Yaml in config/routes/annotations.yaml
  • load in the browser (Symfony webserver)

I get the «nice error page» you showed in your comment, which leads me to think you have a configuration problem. Can you use xdebug (or at least dd(debug_backtrace())) to figure out what’s being passed to HtmlErrorRenderer? It sounds like maybe you’ve got debug mode disabled in dev.

@ikakarov

@blowski like this ?

  0 => array:7 [▼
    "file" => "/repos/Tutorials/ApiPlatform/PaerOne/lesson1/start/vendor/symfony/error-handler/ErrorHandler.php"
    "line" => 707
    "function" => "__construct"
    "class" => "SymfonyComponentErrorHandlerErrorRendererHtmlErrorRenderer"
    "object" => SymfonyComponentErrorHandlerErrorRendererHtmlErrorRenderer {#3637 ▼
      -debug: null
      -charset: null
      -fileLinkFormat: null
      -projectDir: null
      -outputBuffer: null
      -logger: null
    }
    "type" => "->"
    "args" => array:1 [▼
      0 => false
    ]
  ]

@blowski

Yes, that’s really useful, thanks. Go back through the whole backtrace and figure out why debug is either null or false — it should be true in the dev environment.

Some pointers:

  1. The .env file should have a line like APP_ENV: dev.
  2. In public/index.php you should see something like if($_SERVER['APP_DEBUG']) { Debug::enable(); }.
  3. $_SERVER['APP_DEBUG'] is set in config/bootstrap.php.

@yceruto

Yes, you should be able to see the detailed exception page if the debug mode is enabled only. Please, check the @blowski’s comment above.

@ikakarov

@blowski Everything is standard. The problem is that SymfonyComponentErrorHandlerErrorRendererHtmlErrorRenderer does not pass parameters when there is a syntax error.

I think the problem is that error_handler.error_renderer.html expects a data request service as a $debug parameter when there is a syntax error.

    <services>
        <service id="error_handler.error_renderer.html" class="SymfonyComponentErrorHandlerErrorRendererHtmlErrorRenderer">
            <!-- < This is not possible to execute when we have sytax error  -->

            <argument type="service">
                <service>
                    <factory class="SymfonyComponentErrorHandlerErrorRendererHtmlErrorRenderer" method="isDebug" />
                    <argument type="service" id="request_stack" />
                    <argument>%kernel.debug%</argument>
                </service>
            </argument>
            <!-- This is not possible to execute when we have sytax error  >-->

            <argument>%kernel.charset%</argument>
            <argument type="service" id="debug.file_link_formatter" on-invalid="null" />
            <argument>%kernel.project_dir%</argument>
            <argument type="service">
                <service>
                    <factory class="SymfonyComponentErrorHandlerErrorRendererHtmlErrorRenderer" method="getAndCleanOutputBuffer" />
                    <argument type="service" id="request_stack" />
                </service>
            </argument>
            <argument type="service" id="logger" on-invalid="null" />
        </service>

        <service id="error_renderer.html" alias="error_handler.error_renderer.html" />
        <service id="error_renderer" alias="error_renderer.html" />
    </services>

@blowski

I can’t reproduce your problem from this side, so I can’t really do much to help debug. For me, with a clean install running in dev, I get a full error message.

Are you getting full error message only for malformed YAML, or for all other errors as well?

The only next steps I can think of are to try doing a clean install on your environment to see if there’s something weird going on that’s producing an edge case.

@yceruto

@ikakarov the html error renderer won’t work as service because there is a config error, so the container compilation process is broken. However, there is a fallback mechanism to catch that errors: see ErrorHandler::renderException() -> new HtmlErrorRenderer($this->debug).

You should see the exception page if $this->debug is true, and that will happen only if debug mode (Debug::enable()) is called on your front.

@blowski

@yceruto Thanks.

I don’t get why @ikakarov is not experiencing all sorts of weirdness if not in debug mode.

@xabbuh

I am going to close here for now due to the lack of feedback. Please let us know when you have more information and we can consider to reopen.

@Herz3h

I upgraded from symfony 3.4 to 4.4.10 and ever since, sometimes I get a nice error page showing the exception, and sometimes I just get the 500 error page. Luckily I have sentry to report me the errors, for instance now it shows error 500 without any additional info, and sentry reports:

Object of class DoctrineORMPersistentCollection could not be converted to string

Output of dd(debug_backtrace()) returns:

 [▼
    "file" => "/Users/home/project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php"
    "line" => 80
    "function" => "handleRaw"
    "class" => "SymfonyComponentHttpKernelHttpKernel"
    "object" => SymfonyComponentHttpKernelHttpKernel {#607 ▼
      #dispatcher: SymfonyComponentHttpKernelDebugTraceableEventDispatcher {#602 …8}
      #resolver: SymfonyComponentHttpKernelControllerTraceableControllerResolver {#518 ▼
        -resolver: SymfonyBundleFrameworkBundleControllerControllerResolver {#517 ▼
          #parser: SymfonyBundleFrameworkBundleControllerControllerNameParser {#647 ▼
            #kernel: AppKernel {#17 ▼
              #bundles: array:35 [▶]
              #container: Container0EKP23gappAppKernelDevDebugContainer {#63 …20}
              #rootDir: "/Users/home/project/app"
              #environment: "dev"
              #debug: true
              #booted: true
              #name: "app"
              #startTime: 1597215689.1078
              -projectDir: null
              -warmupDir: null
              -requestStackSize: 1
              -resetServices: true
            }
          }
...
]

After reading above, I don’t have any .env file, I tried adding one with value of: APP_ENV=dev and no difference. I have Debug::enable() and new AppKernel('dev', true) in app_dev.php

How can I fix this, it’s really annoying issue for me.

@Herz3h

After searching a bit in code, I found out that this line is maybe the reason it doesn’t catch exceptions. As of php 7, errors are not reported using traditional error mechanisms, but reported as exception of type Error.

To test this, I just changed Exception to Error, and the exception is displayed.

@ikakarov

#36254 (comment) — This solution is tested and worked, i just changed this

} catch (Exception $e) {

to this

 } catch (Exception|Error $e) {

at line 85. But this solution is not optimal, and I’m not convinced it will work everywhere.

@Herz3h

Still facing this annoying issue, should I open a new issue?

@msieracki00

Still facing this annoying issue, should I open a new issue?

Same issue for me

@stof

I upgraded from symfony 3.4 to 4.4.10

Can you check which Debug::enable() call you have in your front controller ? Symfony 4.4 contains 2 such classes:

  • the old one SymfonyComponentDebugDebug
  • the new one SymfonyComponentErrorHandlerDebug

Maybe the issue happens only when using the old Debug class (i.e. when upgrading Symfony without updating the front controller) ?

Herz3h, msieracki00, vanssata, Nek-, MJBGO, sebwr, GSpecDrum, AngryUbuntuNerd, buffcode, GeoffreyBidi, and 5 more reacted with thumbs up emoji
lasarian27 reacted with hooray emoji
Herz3h, Nek-, MJBGO, CharlyPoppins, mokabyls, sebwr, theredled, MartinStrekelj, GeoffreyBidi, Lukeboy25, and lasarian27 reacted with heart emoji

@Herz3h

Debug::enable

That was it, thank you very much!!

@stof

@nicolas-grekas looks like something is still wrong in the BC layer when using the old component. It might be good to fix it if possible.

@AkashicSeer

This comment has been minimized.

@MJBGO

I can confirm the problem coming from 4.0 to 4.4 :) The debug page is not shown when using

SymfonyComponentDebugDebug

instead of

SymfonyComponentErrorHandlerDebug

@xabbuh

I am not able to reproduce the described issue. Can someone of you please create a small example application that allows to do so?

@xabbuh

I am going to close here for now due to the lack of feedback. Please let us know when you have more information and we can consider to reopen.

Learn how to implement a custom 500 error page for exceptions in the production environment in Symfony 1.4

«Oops, an error ocurred», memorable message of exceptions shown in Symfony 1.4 based projects when they’re specifically on the production environment. The default error page of Symfony is pretty informative to the user, it basically says that what they were trying to do couldn’t be achieved for «x» reason. 

Normally, you don’t want to show the reason of the exception to the user, you only want to notice him that something is failing, however is pretty important to show an error page that is related to the design of your entire project, that’s why in Symfony 1.4 is possible to override the default 500 error page by a custom one. In this article, we’ll show you how to override it by simply creating a new file in a specific directory of your project.

Creating custom 500 error page

To customize the 500 error page used by symfony in the production environment, you will need to create a new directory named error inside the /config folder of your entire app or per sub-app level e.g yourproject/config (for a non sub app specific error page) or if you have sub applications yourproject/apps/<my-app>/config. Inside this directory, you only need to create an empty PHP file with the name error.html.php. For example, in our project we have 2 sub applications, however we want a single error page for both of them, so we’ll place the error template in the config/error directory of the project:

Symfony 1.4 custom error page

As next, you only need to write your HTMl template in the error.html.php, note that you will be able as well to do PHP stuff related to Symfony 1.4 as well. For example, using an open source 500 error page, the content of our error.html.php template could be something like:

<?php // yourproject/config/error/error.html.php ?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <!-- Simple HttpErrorPages | MIT License | https://github.com/AndiDittrich/HttpErrorPages -->
        <meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1" />
        <title>We've got some trouble | 500 - Webservice currently unavailable</title>
        <style type="text/css">/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}/*! Simple HttpErrorPages | MIT X11 License | https://github.com/AndiDittrich/HttpErrorPages */body,html{width:100%;height:100%;background-color:#21232a}body{color:#fff;text-align:center;text-shadow:0 2px 4px rgba(0,0,0,.5);padding:0;min-height:100%;-webkit-box-shadow:inset 0 0 100px rgba(0,0,0,.8);box-shadow:inset 0 0 100px rgba(0,0,0,.8);display:table;font-family:"Open Sans",Arial,sans-serif}h1{font-family:inherit;font-weight:500;line-height:1.1;color:inherit;font-size:36px}h1 small{font-size:68%;font-weight:400;line-height:1;color:#777}a{text-decoration:none;color:#fff;font-size:inherit;border-bottom:dotted 1px #707070}.lead{color:silver;font-size:21px;line-height:1.4}.cover{display:table-cell;vertical-align:middle;padding:0 20px}footer{position:fixed;width:100%;height:40px;left:0;bottom:0;color:#a0a0a0;font-size:14px}</style>
    </head>
    <body>
        <div class="cover">
            <h1>Webservice currently unavailable <small>Error 500</small></h1>
            <p class="lead">An unexpected condition was encountered. 
                <br />Our service team has been dispatched to bring it back online.
            </p>
        </div>
    </body>
</html>

Finally, clear the cache of your symfony project using:

php symfony cc

And everytime an exception is thrown in the production environment, you will see the custom error page:

Note

Don’t forget that to test the page, you will need to be in the prod environment (without frontend_dev.php), not dev environment. Otherwise you will see always the stack trace of Symfony.

Custom Error Page Symfony 1.4

Happy coding !

#php #windows #symfony #url #iis

Вопрос:

так что в настоящее время я сталкиваюсь с проблемой.

  • IIS 10 и Symfony 5

Я пытаюсь развернуть свое приложение symfony на сервере Microsoft.

Поэтому я сталкиваюсь с ошибкой 500, см. экран

1

2

И файл web.config

 <configuration>
<system.webServer>
<defaultDocument>
<files>
    <clear />
    <add value="index.php" />
</files>
</defaultDocument>
    <rewrite>
        <rules>
            <rule name="Rewriter" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="false" />
                <conditions>
                    <add input="{R:1}" pattern="^(index.php|favicon.ico)" ignoreCase="false" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                </conditions>
                <action type="Rewrite" url="./index.php/{R:1}" appendQueryString="true" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
 

Я указал свой сайт на общедоступный файл.

Включена анонимная аутентификация.

очистите кэш в dev и prod уже сделано

Кажется, он находит страницу, но не может получить к ней доступ или что-то в этом роде. Если у кого-то есть какие-то зацепки, это может помочь, так как я занимаюсь этим уже 3 дня. Спасибо

ПРАВКА 1 :

Когда я набираю этот URL-адрес

http://192.168.1.87:89/login

Он понимает, что должен позвонить ей контролеру

[2021-08-06T12:49:37.795538 00:00] запрос.ИНФОРМАЦИЯ: Согласованный маршрут «вход». {«route»:»login»,»route_parameters»:{«_route»:»login»,»_controller»:»AppControllerDynamicConnectionController::index»},»request_uri»:»http://192.168.1.87:89/login»,»method»:»GET»} []

Может быть, это проблема с неправильной настройкой PHP?

Изменить 2

Решение от samwu

Измените время активности на 600 и перезапустите сервер.

Не сработало

3

Правка 3 :

Наконец, я изменил файл web.config на

 <configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="Rewriter" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="false" />
                <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                </conditions>
                <action type="Rewrite" url="./index.php" appendQueryString="true" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
 

И я внес изменения, как предложил samwu, и знаю, что у меня новая ошибка, на этот раз касающаяся Mysql.

Предупреждение PHP: Неперехваченное исключение PDO: PDO::__construct(): Ошибка при чтении пакета приветствия. PID=12136 в C:inetpubwwwrootlasernetSymfonyvendordoctrinedballibDoctrineDBALDriverPDOConnection.php:39

И

Следующее исключение PDO: SQLSTATE[HY000] [2006] Сервер MySQL исчез в C:inetpubwwwrootlasernetSymfonyvendordoctrinedballibDoctrineDBALDriverPDOConnection.php:39

И

Фатальная ошибка PHP: Максимальное время выполнения в 30 секунд превышено в C:inetpubwwwrootlasernetSymfonyvendordoctrinedballibDoctrineDBALDriverPDOConnection.php на линии 42

Однако моя база данных mysql хорошо доступна, база данных работает правильно, когда я запускаю приложение Symfony локально.

Комментарии:

1. Ошибка 500 является общим сообщением об ошибке и охватывает практически все, что может пойти не так с PHP-скриптом. Проверьте журналы ошибок вашего сервера, чтобы узнать точное сообщение об ошибке.

Ответ №1:

Эта проблема должна быть вызвана таймаутом FastCGI, попробуйте выполнить следующие действия, чтобы решить проблему:

  1. Откройте диспетчер iis.
  2. выберите функцию быстрой настройки CGI.
  3. выберите свою версию php-cgi.exe и нажмите «Изменить» на панели действий.
  4. установите значение тайм-аута 600 действий.

После внесения всех изменений вам необходимо перезапустить сервер iis и повторить попытку.

Комментарии:

1. Спасибо за ваш ответ, я действительно внес изменения, о которых вы мне говорили, и это все еще не работает. Он говорит мне: «невозможно получить доступ к этой странице».

2. Вы можете попробовать открыть дело с помощью : support.microsoft.com

Понравилась статья? Поделить с друзьями:
  • Symfony form error template
  • Symfony form add error
  • Symfony error logging
  • Symfony custom error page
  • Symfony console error