Question

This is a very noob question. I'm basically just trying to run the "hello world" of Silex. I've installed the silex.phar file in my directory, setup the .htaccess file as such:

<IfModule mod_rewrite.c>
    Options -MultiViews

    RewriteEngine On
    #RewriteBase /projects/silex/  ###--> commented out because file is in root dir. <--##
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

and then run these two lines of code on the index.php file:

require_once __DIR__.'/silex.phar';

$app = new Silex\Application(); 

I am getting a 500 internal server error. ("File does not exist")

I am running php 5.3.8 on Linux.

Is there a PHP setting I should be looking for?

Was it helpful?

Solution

Turns out there is a bug called the phar-stub bug. It will tell you that Silex\Application could not be found. A workaround is using the following include line:

require_once 'phar://'.__DIR__.'/silex.phar/autoload.php';

source

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top