0

I want to move symfony 1.4.18 from server A to server B

  • server A root directory is httpdocs
  • server B root directory is public_html

both servers are shared hosts.

  1. I downloaded all the files in server A httpdocs directory
  2. export the database from server A phpmyadmin
  3. upload all source files into server B root directory, that is under public_html
  4. create a Database and a new database user in server B, import the database into this new database
  5. change config\databases.yml into new database information

I also tried to change config\vhost.conf

php_admin_value open_basedir "/var/www/vhosts/www.oldsite.com/httpdocs:/tmp:/usr/local/php:/usr/share/pear"

into

php_admin_value open_basedir "/var/www/vhosts/www.newsite.com/public_html:/tmp:/usr/local/php:/usr/share/pear"

After all this I checked the new server B: it just shows all the files in the directory, but not the website.

Is there anything else I need to change?

nickleefly
  • 3,733
  • 1
  • 29
  • 31
  • Does it show even index.php? What exactly can you see? Don't forget to clear your cache directory. – Roman Newaza Jun 06 '12 at 09:49
  • Could you show us your vhost configuration for server B ? – j0k Jun 06 '12 at 09:55
  • What happens when you run the website on the new server - do you see it? If not, do you get any errors in your error logs? Also, enable the dev front controller and see if that works. – halfer Jun 06 '12 at 12:48
  • I see all the files in server B. the files are including .gitignore apps/ cache/ config/ data/ lib/ log/ plugins/ symfony and test/ . but there is a folder called web in the ftp root directory. but I cant see from new website – nickleefly Jun 06 '12 at 13:50
  • (Just so you know, if you need to call someone by name, use @halfer. However you get auto-notified here, since it is your question.) – halfer Jun 06 '12 at 13:51
  • @halfer I think there is configuration need to change somewhere. no idea how to enable the dev front controller. could you explain more specificly – nickleefly Jun 06 '12 at 13:53
  • Ah, looks like you've copied your whole project into your `public_html`. Either you can access it by putting `/web/index.php` at the end of your URL, or copy all the files up one level, and move the web files into the web folder. The shared-host configuration is likely to be the same as your previous host - how did you configure that? – halfer Jun 06 '12 at 13:53
  • The dev controller is probably named 'frontend_dev.php', but that's not your primary problem at the moment. The item above ^ is! – halfer Jun 06 '12 at 13:54
  • @j0k the vhost.conf is DocumentRoot /var/www/vhosts/hairrepublic.com/httpdocs/web Options +FollowSymlinks php_admin_value open_basedir "/var/www/vhosts/yourwebsite.com/httpdocs:/tmp:/usr/local/php:/usr/share/pear" – nickleefly Jun 06 '12 at 13:55
  • @Roman Newaza it doesnt show index.php in server B – nickleefly Jun 06 '12 at 13:55
  • (Btw, it is best to edit config files _into your question_ so the whole is more readable; ping someone here by name if you need to afterwards.) – halfer Jun 06 '12 at 13:58
  • I don't know is this is the problem, In server configuration, the document root directory should be public_html/web/ And be carefull thar your put the directive DirectoryIndex index.php – Curlas Jun 06 '12 at 13:58
  • as @Curlas says, your vhost has to be `public_html/web/` instead of `httpdocs/web/` on server B. – j0k Jun 06 '12 at 14:04
  • @j0k - I think symfony 1.3/1.4 has a feature to put all the non `web` files one level above `public_html`, and to rename `web` to `public_html`. That would be much better, for security reasons (you don't want the whole tree browseable). However I've not tried this. – halfer Jun 06 '12 at 14:14
  • 2
    This might be of use: http://symfony-world.blogspot.co.uk/2010/01/configuring-symfony-application-on.html – halfer Jun 06 '12 at 14:15
  • @halfer you're right. This is of course the issue. But never tried .. – j0k Jun 06 '12 at 14:15
  • Yes indeed, exactly what I said: all non-`web` folders move one level up (so they are the same level as `public_html`) and `web` is renamed to `public_html` (unless you are permitted to change your docroot, which appears to be the case - keep it the same if so). Read the article I linked to. – halfer Jun 06 '12 at 14:19
  • (Btw, don't leave a zip file in public view like that - it probably contains your db passwords. Remove it, and change your db passwords!) – halfer Jun 06 '12 at 14:21
  • @j0k I changed vhost.conf into this DocumentRoot /var/www/vhosts/newwebsite.com/public_html/web Options +FollowSymlinks php_admin_value open_basedir "/var/www/vhosts/newwebsite.com/public_html:/tmp:/usr/local/php:/usr/share/pear" still got the same result – nickleefly Jun 06 '12 at 14:21
  • @halfer will check the link u sent. – nickleefly Jun 06 '12 at 14:22
  • I can't see a front controller (index.php, frontend_dev.php) nor a web folder in your site folder listing, @xiuyu_li? – halfer Jun 06 '12 at 14:22
  • @halfer yea that was my question. I have web folder in the server B. butI cant see web folder when i access server B. i uploaded all the source files from server A to server B. what is the problem? – nickleefly Jun 06 '12 at 14:28
  • You missed some files on server A? A symfony application simply won't work without front controllers. – halfer Jun 06 '12 at 14:31
  • @halfer my config/ProjectConfiguration.class.php is different from the link u sent. mine is like `sfConfig::add(array( //'sf_i18n' => true, 'sf_charset' => 'utf-8', 'sf_upload_dir_name' => str_replace(sfConfig::get('sf_web_dir').'/', '', sfConfig::get('sf_upload_dir')) ));` – nickleefly Jun 06 '12 at 14:42
  • There's a comment in that, so it may or may not make a difference (depending on how many lines it spans). See my earlier comment where I said **it is best to edit config files into your question so the whole is more readable; ping someone here by name if you need to afterwards**. – halfer Jun 06 '12 at 14:44
  • (That said, that won't make a difference to my basic point - find your front controllers!) – halfer Jun 06 '12 at 14:45
  • (Your rsync/ssh password is also visible, together with your website address. Someone can now take down your website). – halfer Jun 06 '12 at 14:53
  • @halfer I know where is comment, in the source its like `public function setup() {sfConfig::add(array('sf_charset' => 'utf-8', 'sf_upload_dir_name' => str_replace(sfConfig::get('sf_web_dir').'/', '', sfConfig::get('sf_upload_dir')) ));` – nickleefly Jun 06 '12 at 14:53
  • @halfer they havent finished the server configuration i think – nickleefly Jun 06 '12 at 15:04

0 Answers0