Symfony and Godaddy
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.
5 Comments
Other Links to this Post
RSS feed for comments on this post. TrackBack URI
By manuq, 2009-07-10 @ 11:29
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.
By Abhinav, 2009-09-18 @ 04:28
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
By Hang, 2009-09-20 @ 19:37
I guess the error message from your first problem is misleading – does it mean “you should launch symfony in symfony directory”?
By Tiago Carvalho, 2010-03-02 @ 19:05
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!
By Hang, 2010-03-02 @ 22:17
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.