Jul 032009
 

Though problems I’m going to discuss are for symfony 1.2, I guess it applicable to 1.0 and 1.1 as well.

I finally got symfony works on godaddy shared hosting, I guess if I were running any sort of dedicated hosting, these problem could not have happened, as I have full control.

The first problem hit me is PHP version, symfony needs PHP5, and godaddy supports PHP5 – good. However, it seems godaddy’s default PHP is still PHP4 so have to set alias to make sure symfony script is interpreted by PHP5 instead of PHP4:

alias symfony=’/usr/local/php5/bin/php /path/to/symfony-1.2.7/data/bin/symfony’

after this, I got the problem, saying:

/usr/local/php5/bin/php: Symbol `client_errors’ has different size in shared object, consider re-linking

and turned out it was because of mysql client lib problem – I don’t know the detail yet, but seems /usr/local/php5/bin/php and /web/cgi-bin/php5 are both linked to /usr/lib/mysql/libmysqlclient.so.15, which works for /web one but not the /usr one. I did some tests and found /usr/lib/libmysqlclient.so.14.0.0 works perfect with /usr/local/php5/bin/php, so put this into my .bash_profile:

LD_PRELOAD=/usr/lib/libmysqlclient.so.14.0.0

note that /usr/lib/libmysqlclient.so.10.0.0 doesn’t work well as it’s too old to support modern (new) password encrypt/authentication.

By now I can use symfony do the development job, but problem are still there while I’m trying to browse from browser, the first thing is rewrite rules – these lines should be uncommented from web/.htaccess:

RewriteBase /
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.html$
RewriteRule .* – [L]

then I met the problem (which took me longest time to solve) with error:
Empty module and/or action after parsing the URL “/index.php” (/).
actually I should have got it solve earlier if I search on the web, there is a great article talking about the solution, and my problem got solved just after 1st part of solution mentioned by the blog – adding following lines to “all” section of apps/frontend/config/factories.yml:

request:
  param:
    path_info_key: REQUEST_URI

be careful with intending, original blog seems not doing the right thing and put “request” and “param” in same level, which is wrong.

Alright, by this time you will be able to play with symfony on shared hosting with godaddy. 🙂

  11 Responses to “Symfony and Godaddy”

  1. thanks! I just needed the last tip to get my site working, the frontend app. but in my backend app, the same setting just doesn’t work. I will check the documentation for the factories.yml file.

  2. Hello, and thanks for the help. Actually putting the second fix in seems to be causing the relinking error, and that error goes away when I remove LD_PRELOAD from .bash_profile. However, in both cases, I get this error –

    “You must launch symfony command line with the symfony script”

    I did a bit of digging, and this is the first fail case message in symfony.php, supposed to be displayed when $sf_lib_dir is not set.

    Part two of my deployment headache is that the empty action/module error refuses to go away, even with the REQUEST_URI solution. However, when I check Symfony settings on the error page, I notice that the sf_lib_dir is correctly set.

    Any help would be welcome. Thanks

  3. I guess the error message from your first problem is misleading – does it mean “you should launch symfony in symfony directory”?

  4. Hi!

    Thanks a lot for your tips! It all worked for me except for one thing.. I can access my site through the dev interface (both frontend_dev.php and backend_dev.php). But I can’t access it via the production environment… It just keeps returning me a non-symfony “404 page not found” page… I guess it must have to be something in .htaccess.. A

    Any ideas?

    Thanks in advance!

  5. Geeze … I’ve been away from symfony for quite some time.

    Seriously, I don’t know the answer, and I don’t have time to dig into it now, wish you luck to get answer from somewhere else.

  6. Thanks for your comment, I did all the thinks you specified here.But Still i have the same issue.
    Empty module and/or action after parsing the URL

  7. Thanks! this post was very helpful, but besides changing factories.yml, I also had to change file extensions on GoDaddy, so .php used PHP 5.x instead of PHP 5.x FastCGI.

    I got that hint from the following link:
    http://cegeekbook.blogspot.com/2010/07/php-no-input-file-specified-godaddy.html

    Hope it helps.

  8. Guys, I moved to Linode and here is why, since Linode offer pretty good VPS in a reasonable price, I no longer have to fight with problems coming from shared Web hosting.

    However, still thanks everybody here for your comments.

  9. Found this article from search engine, one of the hotest article from my blog …

    I moved to Amazon AWS several months back (cannot recall the exact date, try search my blog for why, hehe), and I’m going to evaluate Symfony again for a hobby project :-P.

  10. […] Addendum: Hang from Flying Bug blog just posted some other interesting godaddy tweaks and corrected an indentation error in my original post. Much appreciated – go check out his blog as well: https://xiehang.com/blog/2009/07/03/symfony-and-godaddy/ […]

  11. Since you require composer installed on a server to install Symfony and other PHP frameworks, I don’t think you can do that on shared servers. Because you don’t get composer there. I wouldn’t recommend shared server anyway because of lack of security and performance issues. A better option is some affordable dedicated server like DigitalOcean, unless you know how to set it up. If you don’t have sysadmin experience for that, then you can use Cloudways PHP MySQL hosting platform where the server is configured automatically and you get managed digitalocean server. You also get composer pre-installed, so you can install any php framework or CMS you want.

Sorry, the comment form is closed at this time.