logo
Ask your Symfony questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$50
Symfony Installation Help

I need help on transferring an existing Symfony installation from one dedicated host to a new dedicated host. I have run the check_configuration.php file and all is good on the Apache server environment end (minus the accelerator). The database file is uploaded, a user has been created to access the database, and the files have all been uploaded.

My config:
I've edited the databases.yml file with the proper credentials
I've edited the propel.ini file to reflect the changes with the propel.database.createUrl and propel.database.url

I'm getting a blank page and I've checked my access logs, but don't see anything that helps me out. I've tried accessing the backend.php and I get the same result.

I'm unsure if my VirtualHost settings are correct and I'm not sure if that would be causing the database to not connect. The server is a dedicated Linux box from Singlehop running Cpanel and WHM. If you can answer the question without logging into the server, that would be ideal. I will raise the value of the question if a server login is required because of the extra work involved.

This question has been answered.

Morgan Long | 05/18/10 at 10:50am Edit


(35) Responses

See a threaded view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    05/18/10
    11:02am
    Arturo Linares says:

    Apparently symfony is crashing. Try entering in dev mode to see what's going on. Edit web/index.php and set the environment to 'dev' to see the errors.

  • avatar
    Last edited:
    05/19/10
    11:42am
    José Antonio says:

    Hello Morgan,

    You should check this options before access to your application.

    1. The ProjectConfiguration class access to the rigth Symfony's lib directory address.


    <?php
    require_once '/path/to/symfony/lib/autoload/sfCoreAutoload.class.php';
    sfCoreAutoload::register();

    class ProjectConfiguration extends sfProjectConfiguration {
    public function setup() {

    }
    }


    2. Check if all the PHP's libraries that you uses in the firts server are loaded in this one. For example, MCrypt, XSL or any other.

    3. Check if the server show you the errors in the (Apache) configuration file.

    Meabe you can fix your problem with this advices.

    Sorry my english.

    Previous versions of this answer: 05/18/10 at 11:06am | 05/18/10 at 11:06am

  • avatar
    Last edited:
    05/18/10
    11:07am
    Eduardo Raffoul says:

    Can you show us your VirtualHost setting? Do you have the file structure of the symfony project as symfony creates it or did you move some folder outside your /httdocs/web/public folder? What version of symfony are you using, did you tried to run the configure:database command?

    By the way, try to access via dev environment. You have to do this (just for this test)



    //In /web/frontend_dev.php
    // Comment this

    if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
    {
    die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
    }


    You have to comment the code above so you can access to the dev environment in the server. Remember to uncomment it after you try.

    So check what happens when you access this way.

  • avatar
    Last edited:
    05/18/10
    11:09am
    casivaagustin says:

    - Check the configuration of the virtual host, check that the paths of sf libs works fine.

    - Recheck The database credential in databases.yml and propel.ini

    - Clean the Cache, Rebuild All clases (build-all or build-form, model, filter) and then reclean the chache (cc).

    - Set the correct permision on cache, log and uploads folder (project:permissions maybe help)

    If does not works, please put the Vhost configuration, database.yml, propel.ini, and check the dev environment for see debug info and paste for us.

    Cheers

  • avatar
    Last edited:
    05/19/10
    11:42am
    Jakub Zalas says:

    Also, check if apache has permissions to write to the cache and log directories.

  • avatar
    Last edited:
    05/18/10
    11:33am
    glkz says:

    Also, check php memory limit. Try to set the php memory limit 64M or greater.

    Previous versions of this answer: 05/18/10 at 11:33am

  • avatar
    Last edited:
    05/18/10
    11:28am
    Morgan Long says:

    Checked the frontend_dev and I got the "You are not allowed to access this file. Check frontend_dev.php for more information." message. Same for backend_dev.php.

  • avatar
    Last edited:
    05/18/10
    11:32am
    Morgan Long says:

    Sorry, overlooked the frontend_dev log. Here's the log info:
    May 18 10:11:55 symfony [info] {sfPatternRouting} Connect "/"
    May 18 10:11:55 symfony [info] {sfPatternRouting} Connect "/symfony/:action/*"
    May 18 10:11:55 symfony [info] {sfPatternRouting} Connect "/:module"
    May 18 10:11:55 symfony [info] {sfPatternRouting} Connect "/:module/:action/*"
    May 18 10:11:55 symfony [info] {sfPatternRouting} Connect "/captcha"
    May 18 10:11:55 symfony [info] {sfPatternRouting} Connect "/captcha/:random"
    May 18 10:11:55 symfony [info] {sfPatternRouting} Connect "/captcha_demo"
    May 18 10:11:55 symfony [info] {sfFrontWebController} Initialization
    May 18 10:11:55 symfony [info] {sfPatternRouting} Match route [homepage] for "/"
    May 18 10:11:55 symfony [info] {sfWebRequest} Request parameters array ( 'module' => 'content', 'action' => 'home',)

  • avatar
    Last edited:
    05/18/10
    11:33am
    Eduardo Raffoul says:

    But you have to comment the lines that im showing you. Access the web/frontend_dev.php file (in an editor) and comment the lines that i showed you above, after you do it it should look like this:

    <?php

    // this check prevents access to debug front controllers that are deployed by accident to production servers.
    // feel free to remove this, extend it or make something more sophisticated.
    /*
    if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
    {
    die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
    }
    */

    require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

    $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true);
    sfContext::createInstance($configuration)->dispatch();

  • avatar
    Last edited:
    05/18/10
    11:38am
    Morgan Long says:

    Sorry about that. The dev file was already commented. Result:

    Warning: session_start() [function.session-start]: SAFE MODE Restriction in effect. The script whose uid is 503 is not allowed to access /tmp owned by uid 0 in /home/digtess1/public_html/lib/symfony/storage/sfSessionStorage.class.php on line 92

    Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home/digtess1/public_html/lib/symfony/storage/sfSessionStorage.class.php on line 92

  • avatar
    Last edited:
    05/18/10
    11:42am
    Morgan Long says:

    Memory limit is set to 64M

  • avatar
    Last edited:
    05/18/10
    11:42am
    Morgan Long says:

    Permissions are written correctly.

  • avatar
    Last edited:
    05/18/10
    11:52am
    Eduardo Raffoul says:

    It looks like a problems permission. Before checking anything else on server, ¿Did you run the 'symfony fi' command?

    Try executing (via cli):
    php symfony fi
    php symfony cc

  • avatar
    Last edited:
    05/18/10
    12:03pm
    Eduardo Raffoul says:

    By the way, if your server gives you a sudo user, run the fi command with the sudo user:
    sudo php symfony fi

  • avatar
    Last edited:
    05/18/10
    12:10pm
    Morgan Long says:

    Executed both.

    Below is the VirtualHost from the httpd.conf for this directory. Maybe that will shed some light on things.

    <VirtualHost 173.236.56.42:80>
    ServerName digtess.org
    ServerAlias www.digtess.org www.digtess.com digtess.com
    DocumentRoot /home/digtess1/public_html
    ServerAdmin morgan@aligningchange.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/digtess.org combined
    CustomLog /usr/local/apache/domlogs/digtess.org-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User digtess1 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
    suPHP_UserGroup digtess1 digtess1
    </IfModule>
    <IfModule !mod_disable_suexec.c>
    SuexecUserGroup digtess1 digtess1
    </IfModule>
    ScriptAlias /cgi-bin/ /home/digtess1/public_html/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/digtess1/digtess.org/*.conf"

    </VirtualHost>

  • avatar
    Last edited:
    05/18/10
    12:23pm
    Morgan Long says:

    I'm getting this error when I php symfony cc:
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_sqlite.so: undefined symbol: sqlite3_libversion in Unknown on line 0

    Is the sqlite extension required? I thought only pdo.so was required.

  • avatar
    Last edited:
    05/18/10
    12:29pm
    Jakub Zalas says:


    Warning: session_start() [function.session-start]: SAFE MODE Restriction in effect. The script whose uid is 503 is not allowed to access /tmp owned by uid 0 in /home/digtess1/public_html/lib/symfony/storage/sfSessionStorage.class.php on line 92

    Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home/digtess1/public_html/lib/symfony/storage/sfSessionStorage.class.php on line 92


    Looks like you don't have permissions to write into /tmp directory. By default session files are stored there. You can modify it with ini_set:


    ini_set('session.save_path', '/home/digtess1/tmp');


    Replace '/home/digtess1/tmp' with directory you have access to.

  • avatar
    Last edited:
    05/18/10
    12:31pm
    Jakub Zalas says:

    A bit more of explanation: you cannot write to /tmp because safe mode is turned on. Otherwise other users of the system could read your session files.

  • avatar
    Last edited:
    05/18/10
    12:37pm
    Morgan Long says:

    I think you're on to something there. The prior developer modified that class file to add this:

    if(isset($_COOKIE['local_companyid']) && $_COOKIE['local_companyid']!="")
    {
    $this->write("companyid",$_COOKIE['local_companyid']);
    }


    I created a directory within public_html for tmp files. Now I'm getting a 404 error. index.php forwards to /default/error404.

  • avatar
    Last edited:
    05/18/10
    12:41pm
    Jakub Zalas says:

    Use development controller to see what's wrong ('*_dev.php'). Alternatively you can check apache's error log file.

  • avatar
    Last edited:
    05/18/10
    12:50pm
    Eduardo Raffoul says:

    So, if fi and cc commands doesn't resolve your problem you must check permissions on your server. As Jakub Zalas remarks, the key here is the /tmp permission. If you cant change the permission on that directory, you have to change the location where symfony stores the session files.

    And about the sqlite extension, it is mandatory (obviously) if you're using sqlite. I just made a test. I commented in my local php.ini the pdo_sqlite.so extension and everything works fine. So i have to ask, what database are you using?

  • avatar
    Last edited:
    05/18/10
    12:53pm
    Morgan Long says:

    Of course I just realized that storing sessions in the public_html folder is probably not the safest way of handling them. I checked my PHP config and safe mode is turned off. What am I missing here to get those sessions to write to that directory without changing the structure of sfSessionStorage.class.php?

    The frontend_dev is telling me I have a database connection error. I'm going to mess with that for a bit and see if I can get it running.

  • avatar
    Last edited:
    05/18/10
    12:57pm
    Jakub Zalas says:

    It could be that you just have different database configuration for your dev environment.

    Don't use public_html location for your session files. It can be any location in your home directory which is not public.

  • avatar
    Last edited:
    05/18/10
    12:57pm
    Jakub Zalas says:

    BTW you don't have to change sfSessionStorage to change the session location path. You can put that ini_set line in your controller.

  • avatar
    Last edited:
    05/18/10
    12:58pm
    Morgan Long says:

    I commented on the permissions problem below.

    The sqlite extension is on in my web php.ini file. I went ahead and turned on all of the pdo extensions because I wasn't sure which one I would need. I think possibly I need to go to the server php.ini and not the web php.ini to activate that extension. I will try that.

  • avatar
    Last edited:
    05/18/10
    12:59pm
    glkz says:


    Of course I just realized that storing sessions in the public_html folder is probably not the safest way of handling them. I checked my PHP config and safe mode is turned off. What am I missing here to get those sessions to write to that directory without changing the structure of sfSessionStorage.class.php?


    You can change the cookie path from apps/{app_name}/config/factories.yml

    all:
    storage:
    param:
    class: sfSessionStorage
    session_cookie_path: /home/username/tmp

    After this, clear cache.

  • avatar
    Last edited:
    05/18/10
    1:02pm
    Eduardo Raffoul says:

    Im not sure what do you mean with 'web php.ini'. But is not a good practice to activate all the extensions, as it will slow down your server. Maybe the cli's php.ini is not the same of server's php.ini, and that's causing a problem when you execute a command via cli. But, again, if you're using a database different than sqlite you don't need it.

  • avatar
    Last edited:
    05/18/10
    4:52pm
    Morgan Long says:

    Sorry for the delayed response. Some things have come up this afternoon.

    I think I've narrowed down the problem to possibly a virtual host setup problem.

    I added the DocumentRoot path to my httpd.conf file to point to the web/ folder as suggested in the Symfony documentation, but that doesn't seem to do any good. I rebuilt the conf file and restarted the Apache service.

    Also, what are the permissions supposed to be for the config/ folder?

  • avatar
    Last edited:
    05/18/10
    4:58pm
    Eduardo Raffoul says:

    I dont see anything weird in your vhost.conf ¿Did you try with the solution proposed for Jakub Zalas and glkz, of changing the session_cookie_path?

  • avatar
    Last edited:
    05/18/10
    5:11pm
    Eduardo Raffoul says:

    I see now something that makes me think (in bold)

    <VirtualHost 173.236.56.42:80>
    ServerName digtess.org
    ServerAlias www.digtess.org www.digtess.com digtess.com
    DocumentRoot /home/digtess1/public_html
    ServerAdmin morgan@aligningchange.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/digtess.org combined
    CustomLog /usr/local/apache/domlogs/digtess.org-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User digtess1 # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
    suPHP_UserGroup digtess1 digtess1
    </IfModule>
    <IfModule !mod_disable_suexec.c>
    SuexecUserGroup digtess1 digtess1
    </IfModule>
    ScriptAlias /cgi-bin/ /home/digtess1/public_html/cgi-bin/


    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/digtess1/digtess.org/*.conf"

    </VirtualHost>

    Are you sure that that is the right DocumentRoot path? It should point to your /web directory in your symfony project, i'd like you to check that.

  • avatar
    Last edited:
    05/18/10
    8:01pm
    Morgan Long says:

    Went to the httpd.conf file for that virtual host and added /web to make it DocumentRoot /home/digtess1/public_html/web

    The path still doesn't seem to be correct. Whenever I go to my IP address with that ~digtess1 directory, I get a 404 error. So I figure at the very least it should be detecting an index.php file (DirectoryIndex is set to index.php).

    I'm beginning to wonder if it's easier to just do a fresh Symfony project install, then copy my app, config, and web files to their respective folders.

  • avatar
    Last edited:
    05/18/10
    8:16pm
    Eduardo Raffoul says:

    Why dont you try with a simple vhost.conf file, like this, just to check:


    <VirtualHost 173.236.56.42:80>
    ServerName digtess.org
    DocumentRoot "/path/to/your/project/web"
    DirectoryIndex index.php

    <Directory "/path/to/your/project/web">
    AllowOverride All
    Allow from All
    </Directory>

    Alias /sf /path/to/your/project/lib/vendor/symfony/data/web/sf

    <Directory "/path/to/your/project/lib/vendor/symfony/data/web/sf">
    AllowOverride All
    Allow from All
    </Directory>

    </VirtualHost>


  • avatar
    Last edited:
    05/19/10
    9:47am
    Morgan Long says:

    I can't find the second part with the Alias in my file structure. I'm looking in project_root_directory/lib/vendor/symfony/data/web/sf and that folder doesn't exist.

    I created an include for my httpd.conf file and added the first part of that and it didn't help. I also went through and deleted the .htaccess files in case they were conflicting with the httpd.conf.

  • avatar
    Last edited:
    05/19/10
    11:29am
    Eduardo Raffoul says:

    Honestly, it's not clear enough to me what the problem might be. If you want, i could access to your server and check it personally. If you want, contact me at eraffoul (at) gmail (dot) com.

  • avatar
    Last edited:
    05/19/10
    11:36am
    Morgan Long says:

    I think we're going another route. Thanks for your help. I've selected you as the winner.

This question has expired.





Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.