开发者

How to install Symfony framework on shared hosting account?

I have a questions while install Symfony framework on my shared hosting account.(hostmonster)

I can access SSH now, but I can not access httpd file.

so, I do not know how to set below setting using command line.

**

<Directory "/$data_dir/symfony/web/sf">

 AllowOverride All

 Allow from All

</Directory>


<VirtualHost *:80>

  ServerName myapp.example.com

  DocumentRoot "/home/steve/myproject/web"

  DirectoryIndex index.php

  Alias /sf /$data_dir/symfony/web/sf

  <Directory "/home/steve/myproject/web">

   AllowOverride All

   Allow from All

  </Directory>

</VirtualHost>

**

,

I tried this,

**

chmod 777 /home1/myaccount/php/data/symfony/web

chmod 777 /home1/myaccount/public_html/symfony/web

**

But nothing changed.

when access mydomain.com, it show like this


#!/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');

Please advice me how should I do .?

Thanks!


You need to enable mod_rewrite on your apache instance. If you cannot access the httpd configuration file, then you should create a .htaccess file in your web root.

Here is an example .htaccess file typical with symfony installs:

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> 


If you are seeing

 #!/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');

when you head to yourdomain.com, you simply do not have PHP enabled. You may not even have it installed. A quick check is to create a file called info.php and put the following as it's contents

<?php phpinfo(); ?>

Upload info.php and navigate to yourdomain.com/info.php. If you are seeing the code you just entered you do not have php installed or enabled on your server. If you see a massive list of configuration items than I'm wrong.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜