这是一个非常低级的问题。我基本上只是想运行Silex的"hello world“。我已经在我的目录中安装了silex.phar文件,将.htaccess文件设置如下:
<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>然后在index.php文件上运行以下两行代码:
require_once __DIR__.'/silex.phar';
$app = new Silex\Application(); 我收到一个500内部服务器错误。(“文件不存在”)
我在Linux上运行php 5.3.8。
有没有我应该寻找的PHP设置?
发布于 2011-12-05 09:48:16
原来有一个叫phar-stub的bug。它会告诉您找不到Silex\Application。一种解决方法是使用以下包含行:
require_once 'phar://'.__DIR__.'/silex.phar/autoload.php';source
https://stackoverflow.com/questions/8376940
复制相似问题