Configuring php-sdk-gae using symfony2

I am trying to run symfony2 using the hello world sample set inside php-sdk-gae.

I follow the instructions given in https://developers.google.com/appengine/docs/php/ and I can run the demo with the development controller (for example: setting app.yaml as follows:

application: helloworld version: 1 runtime: php api_version: 1 handlers: - url: /bundles static_dir: helloWorld/web/bundles - url: /favicon.ico static_files: helloWorld/web/favicon.ico upload: helloWorld/web/favicon.ico - url: /.* script: helloWorld/web/app_dev.php 

It works fine, and I can get Hello World after starting the server and loading / hello / World page

But when I try to start it using the production controller (app.php instead of app_dev.php), I get an internal server error.

 Request URL:http://mysite.local:8080/hello/World Request Method:GET Status Code:500 Internal Server Error 

The only key in the console window where I started the server, showing the lines ...

 ERROR:root:php failure (255) with: Status: 500 Internal Server Error X-Powered-By: PHP/5.4.15 Content-type: text/html 

If I make some changes to the app.php files, I understand that it works perfectly with the following AppKernel boot lines:

 $kernel = new AppKernel('prod', true); $kernel = new AppKernel('dev', false); $kernel = new AppKernel('dev', true); 

But not with the default configuration for the production environment ('prod', false).

I start the GAE server with this command: google_appengine / dev_appserver.py --php_executable_path = / home / jon / php-sdk-gae / php-5.4.15 / installdir / bin / php-cgi helloWorld /

I am new to GAE and I wonder where I can find the logs to get more information about this error.

+6
source share
4 answers

There is also a problem with caching.

Perhaps the problem is this, I tried in the localhost project with the development version, everything is in order. And when he is deployed at GAE, he fails.

Maybe this helps. http://www.ideato.it/planet-ideato/symfony2-su-google-app-engine/

-1
source

There is an uncaught exception in your work environment. This is the cause of the http 500 error.

Let me quickly explain AppKernel :: __ construct

 $kernel = new AppKernel($environment, $debug); 

The first argument is the environment, the second is the debugging option.

If you set debug to true, symfony will try to catch the exceptions and show you a good stracktrace.

This covers the first and third cases where you are not getting an http 500 error (caused by an uncaught exception).

 $kernel = new AppKernel('prod', true); $kernel = new AppKernel('dev', true); 

Now you indicate that the error is NOT thrown into the dev environment with the debug value set to false.

 $kernel = new AppKernel('dev', false); 

This means that an exception exists in the dev environment.

Now you need to check the production log file to see which exception was thrown.

Use tail -f to see the real-time changes made to this file in your shell (i.e. bash), or if they are not available, open the file in your editor and look at the exceptions at the end.

 tail -f app/logs/prod.log 

In the standard version of symfony2, logfiles can be found in

 app/logs/%kernel.environment%.log 

... with% kernel.environment% is one of dev / prod / test

+3
source

The problem is with the .htaccess file shipped with Symfony 2.2

I can easily use the application in symfony 2.0, and my application with Symfony 2.2 also works if I replace the web / .htaccess file that comes with Symfony 2.2 with the one that comes with Symfony 2.0

Perhaps this is due to a change made to avoid duplication of content (/app.php/something and / something), because since Symfony 2.2, / app.php redirects (301) the request.

+1
source

I believe the problem is the lack of write support in the file system imposed by GAE. In addition, symfony seems to rely on the tempnam () function, which is disabled in versions below 1.9.18, which is not available to the public at the moment when I write this.

0
source

Source: https://habr.com/ru/post/945723/


All Articles