Frameworks 如何在共享主机帐户上安装Symfony framework?
在我的共享主机帐户上安装Symfony framework时,我有一个问题。(hostmonster) 我现在可以访问SSH,但无法访问httpd文件 所以,我不知道如何使用命令行设置下面的设置 ** ** 但一切都没有改变 当访问mydomain.com时,它显示如下Frameworks 如何在共享主机帐户上安装Symfony framework?,frameworks,symfony1,Frameworks,Symfony1,在我的共享主机帐户上安装Symfony framework时,我有一个问题。(hostmonster) 我现在可以访问SSH,但无法访问httpd文件 所以,我不知道如何使用命令行设置下面的设置 ** ** 但一切都没有改变 当访问mydomain.com时,它显示如下 #/usr/bin/env-php 您需要在apache实例上启用mod_rewrite。如果无法访问httpd配置文件,则应在web根目录中创建.htaccess文件 下面是symfony安装时典型的.htaccess文件示
#/usr/bin/env-php
您需要在apache实例上启用mod_rewrite。如果无法访问httpd配置文件,则应在web根目录中创建.htaccess文件
下面是symfony安装时典型的.htaccess文件示例:
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
#RewriteBase /
# we skip all files with .something
#RewriteCond %{REQUEST_URI} \..+$
#RewriteCond %{REQUEST_URI} !\.html$
#RewriteRule .* - [L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
Options+FollowSymLinks+ExecCGI
重新启动发动机
#如果遇到问题,请取消对以下行的注释
#无法使用脚本名称
#重写基/
#我们跳过了所有的文件
#重写条件%{REQUEST_URI}\+$
#重写条件%{REQUEST\u URI}!\。html$
#重写规则。*-[L]
#我们检查.html版本是否在这里(缓存)
重写规则^$index.html[QSA]
重写规则^([^.]+)$$1.html[QSA]
重写cond%{REQUEST_FILENAME}-F
#不,所以我们重定向到前端web控制器
重写规则^(.*)$index.php[QSA,L]
如果您看到
#!/usr/bin/env php
<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
chdir(dirname(__FILE__));
require_once(dirname(__FILE__).'/config/ProjectConfiguration.class.php');
include(sfCoreAutoload::getInstance()->getBaseDir().'/command/cli.php');
#/usr/bin/env-php
#!/usr/bin/env php
<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
chdir(dirname(__FILE__));
require_once(dirname(__FILE__).'/config/ProjectConfiguration.class.php');
include(sfCoreAutoload::getInstance()->getBaseDir().'/command/cli.php');
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
#RewriteBase /
# we skip all files with .something
#RewriteCond %{REQUEST_URI} \..+$
#RewriteCond %{REQUEST_URI} !\.html$
#RewriteRule .* - [L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
#!/usr/bin/env php
<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
chdir(dirname(__FILE__));
require_once(dirname(__FILE__).'/config/ProjectConfiguration.class.php');
include(sfCoreAutoload::getInstance()->getBaseDir().'/command/cli.php');
<?php phpinfo(); ?>