Reputation: 8370
I'm trying to work with Symfony2 with the new PHP 5.4 and its built-in server. I downloaded Symfony2 and unziped it on my server and added this router.php file like mentioned here:
<?php
if (isset($_SERVER['SCRIPT_FILENAME'])) {
return false;
} else {
require 'Symfony/web/app.php';
}
?>
The webserver itself works because if I replace router.php
with something simple like phpinfo();
it outputs it correct but with the mentioned router.php
script the site remains white/blank. If I open developer tools it returns 500 Server error
.
I start the server like that:
/home/php54/php -S 0.0.0.0:88 router.php
On my shell I have no output of a error message.
Upvotes: 6
Views: 7030
Reputation: 562
/home/php54/php -S 0.0.0.0:88 router.php
You are trying to run server on privileged port, so either change port or run this as privileged user (not recommended).
Also you have modified router script and I think you've messed up with file paths. You are not specifying docroot in your command, so your current directory is your docroot (so it should be your project's web/ directory). But then path to the front controller in router.php is wrong (Symfony/web/app.php
).
You should really follow carefully instructions from my blog post. So:
wget https://raw.github.com/gist/1507820/b9583ab7f7f5e0e4e29806c38c6c361220b6468f/router.php
,php -S 0.0.0.0:8000 router.php
.This should work.
You can also try patch from my pull request which adds simple command that just runs built-in PHP server.
Upvotes: 7
Reputation: 3413
I don't have a php 5.4 environment handy, but load app_dev.php instead of app.php, as debugging will be set to true and errors will be reported.
Upvotes: 0