A Coder’s Corner

Blog de tecnologia y programación

Deploying a Symfony Project on GoDaddy Shared Hosting

Posted by gfaraj on April 25, 2008

Recently, I had the task of deploying my Symfony project on my GoDaddy shared Linux hosting. I ran into some problems, and I thought I would share in hope of helping any other poor soul who might run into the same problems.

First of all, you should follow the steps here. It does not require you to freeze the project to deploy it. I find that useful for projects that are not yet stable and need to deploy a “beta” version. Also, make sure you have PHP 5 as the default in your GoDaddy Hosting settings.

Next, you need to modify the .htaccess file. Go ahead and uncomment the RewriteBase line in the default symfony .htaccess file:

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  RewriteBase /

This should prevent ‘www.myhost.com/mymodule’ from getting a 404 error from GoDaddy. Now, at least you might get forwarded to your 404 module/action. This is, at least, some proof that you’re moving forward. If you turn on logging (logging is turned off for production configurations by default), you might see the following:

  1	Info Context	initialization
  2	Info Controller	initialization
  3	Info Routing	match route [default_index] "/:module"
  4	Info Request	request parameters array ( 'module' => 'index.php', 'action' => 'index',)
  5	Info Controller	dispatch request
  6	Info Controller	action "indexphp/index" does not exist

As you can see, the module/action resolution is very wrong. This, of course, results in Symfony forwarding to your 404 module/action. Well, it turns out that adding one line to your php5.ini fixes this.

  cgi.fix_pathinfo = 1

This worked nicely for me, and I hope it works for you. I’m posting my full php5.ini and .htaccess files for completeness.

Addendum
It has come to my attention that some people are still having problems after making the changes described here. You might want to try one more change. In your application’s config/settings.yml file, set the following setting:

prod:
  .settings:
     path_info_key: REDIRECT_URL


php5.ini

register_globals = off
allow_url_fopen = off

expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
memory_limit = 20000000
session.gc_maxlifetime = 72000

#log_errors = On
#error_log = php_error.log
#display_errors = On
#error_reporting  =  E_ALL

magic_quotes_gpc = false
cgi.fix_pathinfo = 1

[Zend]
zend_extension=/usr/local/zo/ZendExtensionManager.so
zend_extension=/usr/local/zo/4_3/ZendOptimizer.so

.htaccess

Options +FollowSymLinks +ExecCGI

  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]

# big crash from our front web controller
ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly"

105 Responses to “Deploying a Symfony Project on GoDaddy Shared Hosting”

  1. Michal Thomka said

    Thank you very much for this helpful post!

    Spent couple of hours trying to figure this out, it was already giving me quite a headache 😉

    All the best
    Michal

  2. gfaraj said

    Glad it helped you 🙂

  3. My top level directory on GoDaddy is my public html directory – this poses a security risk if all of my files are public.
    Is there a way to configure this on GoDaddy (economy plan), or set up .htaccess to prevent these files from being accessed?

  4. gfaraj said

    Unfortunately, GoDaddy has that retarded flaw. I have no idea if they have an option to change it. You could probably write a .htaccess rewrite rule to protect the files from being accessed though.

  5. bob said

    3r0rjZ hi nice site thanx http://peace.com

  6. Alexwebmaster said

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

  7. Franck said

    Thank you !

    Important: in sf1.2 “path_info_key: REDIRECT_URL” is in the factories.yml file not in the settings.yml

  8. Hi!
    Gimme url for downloading XRumer 5.0 Palladium crack!
    Thank you…
    Very-very much.
    I’m so need this program for advertise my web projects!!! This software is the best thing for online promo and mass posting, you know…

    And, dont send me XRumer 2.9 and XRumer 3.0 – that versions are too old!

    P.S. Google cant help me((((

  9. sapumal said

    Thank you very much. I had the exact problem and this method worked for me.

  10. Jen said

    The Symfony site mentions how shared hosting can be “unsafe”… is GoDaddy affected by the things they mention or can I use Symfony and not worry? I have GoDaddy shared as well and I’m able to navigate all over the place in SSH. I can see other user’s account names (but not their files)… I don’t really know enough about security to know if that means I’m vulnerable. Any help would be appreciated. 🙂

  11. Dreceinge said

    hmm. attractive )

  12. i must say, your blog is very good, i will be checking back to read more

  13. I really enjoyed reading your article, keep up posting such interesting stuff!

  14. Fairly good post, genuinely enlightening information. Never thought I’d discover the information I want right here. I’ve been scouring throughout the internet for some time now and was starting to get disappointed. Thankfully, I stumbled across your blog and acquired precisely what I had been browsing for.

  15. Apul said

    Where to put php.ini in godaddy server. I have set,

    /home/myname/public_html/article/web to my document root of domain http://www.mydomain.com

    Please suggest.

    Also, I am getting this error, after all the steps:
    Fatal error: Class ‘BaseFormPropel’ not found in /home/myname/public_html/article/lib/form/base/BaseArticleForm.class.php on line 12

    But, When I checked that using FTP, file was there.

    Please suggest.

  16. Sandeep Raul said

    Today i spent entire day fixing this issue: either the index page was shown for any directory or page not found error. Tried all possible stuff but nothing was working out. Luckily got this URL on Google and solved my problem.
    Thanks a ton!
    🙂

  17. Momo said

    Thanks! This helped a lot, and in the spirit of having this documented, I’d like to add that firstly, I had to make a php5.ini file since the default one was php.ini. If you are using php5 you must create this file. Also to have changes take affect, you have to launch your godaddy control panel, and go to content > processes and click End Web. Documented here

  18. Finally it’s working.

    I did tried everything and still it was not working. I did read this page 100 times but still it was not working. Luckily I read Momo’s comment and after that I just did what godaddy told us to do and now it’s working fine. Thanks to everybody and special thanks to Momo.

  19. mantegna said

    Lorem ipsum dolor sit amet consectetuer id ut consectetuer elit orci. Ut leo eu natoque Sed ante quam laoreet interdum nulla at. Suscipit eros In magnis metus Nam est Maecenas lobortis mauris facilisi. Pretium condimentum leo ligula id tempor vel Donec nulla tempus commodo. Sem in consequat sed quis consectetuer.

    Ipsum Aenean ut ipsum quis sed at feugiat dolor id semper. Cursus quis nibh sociis laoreet Fusce Vivamus rutrum Sed nulla at. Congue Suspendisse pellentesque ut quis orci Phasellus non mollis interdum consequat. Augue justo pretium id nibh adipiscing habitant ut tincidunt Nullam lorem. Orci faucibus lorem dictumst at Quisque tristique amet.

    In urna volutpat Aenean dictum hac ut ac dictumst Aenean Donec. Augue Sed magna wisi hac justo sociis felis at mauris Sed. Integer gravida Sed vel tristique velit Nullam lacinia Curabitur faucibus tincidunt. Ullamcorper neque dictum ut a penatibus id tempus nulla felis turpis. Et ipsum nec Vestibulum pede cursus gravida ante Maecenas Vivamus eu. Sapien justo elit massa.

    Sed at condimentum arcu malesuada ut ipsum Donec nunc felis Vestibulum. Pretium Integer id quis Fusce faucibus Praesent id egestas nec et. Ipsum Nunc libero mi odio ipsum semper Quisque egestas mauris adipiscing. Mauris Nulla mus Vestibulum dolor eros tortor nisl Donec Sed tellus. Eu vel Donec nibh ut consequat id Phasellus interdum sem turpis. Ut ornare et.

    Justo urna malesuada dictum augue Maecenas velit et buy tickets Aenean Vestibulum condimentum. Sed ridiculus interdum diam sed Pellentesque nisl et ultrices aliquam Quisque. Sed Aliquam feugiat fames libero massa condimentum pulvinar sed metus fringilla. Neque tortor Vestibulum tincidunt consectetuer auctor sed sem a Phasellus tempor. Aliquet interdum condimentum tortor nulla Sed et auctor eget porttitor dui. Fames Proin at Vestibulum a ante vitae condimentum Lorem Sed Cras. Vestibulum.

    Risus lorem aliquet tellus adipiscing ante Sed orci hac porta nibh. Et ut suscipit Nam natoque diam Suspendisse tellus id senectus tempus. Dictum tincidunt Nulla congue Sed laoreet Aenean ac Aenean commodo felis. Fusce congue dui at nec wisi Curabitur ante condimentum elit nunc. Curabitur elit nibh porttitor et tincidunt et Phasellus.

    Porttitor vitae rhoncus odio sollicitudin suscipit lacus sagittis justo tellus ac. At Quisque at fringilla laoreet et Vestibulum Aliquam euismod leo tellus. Quisque Vivamus at Proin id lorem wisi tellus Donec justo tincidunt. Commodo neque mollis vitae tellus ut Nam senectus id Nam pede. Sed ipsum sagittis senectus vel amet enim id nulla semper Morbi. Quisque dui malesuada a Phasellus Sed eget et et Nulla.

    Non pulvinar porttitor volutpat egestas est pellentesque quis nibh volutpat Quisque. Amet semper Aliquam congue orci pellentesque nibh neque nibh porta tellus. Sed tortor malesuada semper pretium sociis leo laoreet Maecenas Vivamus hendrerit. Phasellus ut penatibus eget dui elit felis dui in consectetuer Duis. Nulla et turpis metus non adipiscing.

  20. Tom @ Google serach redirecting fix…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  21. wehostia.com…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  22. web hosting…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  23. domains said

    domains…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  24. Epilogi Domain Name…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  25. Thakimhost said

    Thakimhost…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  26. singapore vps…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  27. furniture stores at tucson az…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  28. Cheapest hosting! Only 0.01 USD / 1st month. Just use the promo code: ‘1cent’…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  29. Jeff said

    I kinda like your blog. Would you mind telling the design theme and the settings? Thanks.

  30. which monitor should i buy…

    […]Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner[…]…

  31. here said

    I love your wp format, where did you get a hold of it?

  32. This is a amazing weblog, would you be interested in going through an interview regarding just how you developed it? If so e-mail me!

  33. address said

    Wow! This website is sick! How can I make it look like this .

  34. After I open up your Rss feed it appears to be a ton of garbage, is the problem on my part?

  35. It looks to me that this site doesnt load in a Motorola Droid. Are other folks getting the exact same problem? I like this webpage and dont want to have to skip it any time Im gone from my computer.

  36. account said

    Whilst I actually like this post, I believe there was an punctuational error shut towards the finish from the third section.

  37. Just to let you know your web page appears a little bit strange on Safari on my laptop with Linux .

  38. Cool post ! Thank you for, writing on my blog mate! Ill email you soon! I didnt know that!

  39. I enjoy your wp layout, where did you get a hold of it?

  40. optimism said

    pretty valuable stuff, all in all I imagine this is worthy of a bookmark, thank you

  41. I Am Going To have to come back again when my course load lets up – however I am taking your Feed so i could read your blog offline. Thanks.

  42. Have you given any thought at all with translating your webpage in to Chinese? I know a few of translaters right here that will would certainly help you do it for free if you want to make contact with me personally.

  43. Is it fine to insert a portion of this on my personal web site if I publish a reference point to this webpage?

  44. dub anime said

    You ought to really moderate the responses on this page

  45. The structure for your website is a bit off in Epiphany. Even So I like your web site. I might need to use a normal browser just to enjoy it.

  46. Re: The person who produced the statement that this was an excellent website actually needs to get their head examined.

  47. Re: Whomever produced the remark that this was a good internet site genuinely needs to have their brain examined.

  48. Have you given any kind of consideration at all with converting your current website into German? I know a small number of translaters right here which might help you do it for free if you want to get in touch with me personally.

  49. homepage said

    This blog is pretty cool! How was it made !

  50. Jesus Christ theres plenty of spammy comments on this web site. Have you ever before thought about trying to remove them or installing a plugin?

  51. I believe that one of your advertisements initiated my internet browser to resize, you may well want to get that on your blacklist.

  52. I tried looking at your blog with my mobile phone and the structure does not seem to be right. Might want to check it out on WAP as well as it seems most smartphone layouts are not really working with your web page.

  53. this month said

    Nearly all of the comments on this website dont make sense.

  54. Heya, I just hopped over to your site via StumbleUpon. Not somthing I might generally read, but I appreciated your thoughts none the less. Thank you for making some thing worthy of browsing.

  55. A cool post right there mate . Thank you for it .

  56. How did you make a site look this good! Email me if you can and share your wisdom. Id be thankful!

  57. I believe that one of your advertisements triggered my internet browser to resize, you might well need to set that on your blacklist.

  58. You should really moderate the remarks on this site

  59. This site has some extremely helpful information on it. Thank you for informing me.

  60. pretty valuable material, all in all I imagine this is worthy of a book mark, thanks

  61. TM said

    Mate! This blog site is awesome! How did you make it look this good .

  62. Weird , this page shows up with a dark color to it, what color is the primary color on your web-site?

  63. Whenever I initially commented I clicked on the Notify me whenever new comments are added checkbox and now each time a remark is added I get 4 email messages with the identical comment.

  64. I was basically curious about if you ever thought of adjusting the design of your blog? Its well written; I love what youve got to state. But maybe you could include a little more in the way of written content so people could connect to it better. Youve got a great deal of wording for only having one or two photos. Maybe you could space it out better?

  65. account said

    This website has some extremely helpful info on it. Thank you for sharing it with me.

  66. mlm said

    Cool post . Cheers for, posting on this blog page man. Ill email you some time. I did not realise that!

  67. Wanted to drop a remark and let you know your Rss feed is not working today. I tried including it to my Yahoo reader account and got nothing.

  68. I Will have to return again whenever my course load lets up – nonetheless I am taking your Rss feed so i could go through your site offline. Cheers.

  69. How come you dont have your web site viewable in mobile format? Can not view anything in my iPad.

  70. I experimented with viewing your web site with my ipod touch and the page layout doesnt seem to be right. Might wanna check it out on WAP as well as it seems most cellular phone layouts are not really working with your website.

  71. Re: The person who made the comment that this was a good web site truly needs to have their head evaluated.

  72. Mate! This blog is cool! How do you make it look this good .

  73. I tried taking a look at your web site in my iphone and the page layout doesnt seem to be right. Might wanna check it out on WAP as well as it seems most smartphone layouts are not working with your site.

  74. You should really control the comments listed here

  75. jay mabazza said

    4 years later, your patch still works!

  76. Lissa Needham said

    I quite like reading an article that can make men and women think. Also, thank you for allowing for me to comment!

  77. Gino said

    I have read so many articles regarding the blogger lovers but this piece of writing is genuinely a good article, keep
    it up.

  78. I always emailed this weblog post page to all my contacts, as if like
    to read it next my links will too.

  79. Thanks a bunch for sharing this with all of us you actually know what you are speaking about!
    Bookmarked. Kindly also consult with my site =). We
    may have a link change contract among us

  80. I don’t even know the way I ended up here, however I thought this publish was once good. I don’t understand who you might be but certainly you are going to
    a well-known blogger in the event you aren’t already. Cheers!

  81. Pretty great post. I just stumbled upon your weblog and wished to mention that I’ve really enjoyed browsing your weblog posts. After all I’ll be subscribing on
    your rss feed and I’m hoping you write once more very soon!

  82. We stumbled over here from a different web address and
    thought I may as well check things out. I like what I see so now i’m following you. Look forward to looking at your web page again.

  83. After going over a few of the articles on your
    web page, I honestly like your way of writing a blog. I bookmarked it to my bookmark website
    list and will be checking back in the near future.
    Please check out my web site too and let me know how you feel.

  84. Thurman said

    Greetings! I’m from Salt Lake City and completed the University of Oregon with a finance degree. My name’s Thurman
    and I always like to explore and talk about
    accounting. Excellent article on a issue I am really knowledgeable about.

  85. This put will take some time, so please be patient there are a
    lot of files to be transferred. You still have to work on SEO,
    but since Google loves new content and WordPress makes adding
    new content a breeze the SEO advantage goes to WordPress.
    Outlook of a website has become an imperative part of its success.

  86. […] have command-line access to the Godaddy Shared Hosting server, and I’ve tried following https://gfaraj.wordpress.com/2008/04/25/deploying-a-symfony-project-on-godaddy-shared-hosting/ but it seems to be using a much older version of Symfony. Any help? I’m willing to change […]

  87. Robert said

    Hiya! Quick question that’s totally off topic. Do you know how to make your site mobile friendly? My site looks weird when browsing from my iphone 4. I’m trying to find a theme or plugin that might be able to fix this
    issue. If you have any suggestions, please share. Many thanks!

  88. Hi there! I know this is kinda off topic nevertheless I’d figured I’d ask.

    Would you be interested in exchanging links or maybe guest
    authoring a blog article or vice-versa? My website goes over a lot of the same subjects as yours and I feel we could greatly benefit from each other.
    If you might be interested feel free to shoot me an email.
    I look forward to hearing from you! Fantastic blog
    by the way!

  89. It’s perfect time to make some plans for the longer
    term and it’s time to be happy. I’ve learn this submit and if
    I may just I desire to suggest you few fascinating things or tips.

    Maybe you could write next articles relating to this article.
    I desire to read more issues about it!

  90. Joe said

    I’m not sure why but this weblog is loading incredibly slow for me.
    Is anyone else having this issue or is it a issue on my end?
    I’ll check back later and see if the problem still exists.

  91. web page said

    Incredible! This blog looks just like my old one! It’s on a entirely
    different topic but it has pretty much the same layout and design. Outstanding
    choice of colors!

  92. I was curious if yyou ever considered changing the page layout of your site?
    Its very well written; I love what youve
    got to say. But maybe yyou could a little more in the way of content
    soo people could connect with it better. Youve got an awful lot of text
    for only having 1 or 2 images. Maybe you could space it out better?

  93. Hello to every , because I am really keen of reading this weblog’s post to be updated regularly.
    It consists of good stuff.

  94. […] You can exercise symfony on GoDaddy's common hosting plan… designation instructions are here https://gfaraj.wordpress.com/2008/04/25/deploying-a-symfony-project-on-godaddy-shared-hosting/ […]

  95. dui attorneys in Michigan

    Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner

  96. Yamaha Parts Online

    Deploying a Symfony Project on GoDaddy Shared Hosting « A Coder’s Corner

  97. you are in point of fact a good webmaster. The site loading speed is amazing.
    It sort of feels that you are doing any unique trick.
    Also, The contents are masterwork. you have performed a excellent job on this subject!

  98. marjie said

    Eli Lilly and Company knows better and we question why the web siteclassified Attention Deficit Disorder as a “disease,” and one thatpeople “have a remission” from. Kate Upton’s boyfriend Justin Verlander underwent a core muscle repair surgery following a December injury last Wednesday (January 15, 2014).What firms sagging skin is by simply including in your skin careregimen anti-oxidants that have been correctly formulated.

  99. Deploying a Symfony Project on GoDaddy Shared Hosting

    […]Drake needa get some mo liposuction[…]

  100. Tary said

    How’s things?, sometimes I get a 404 site message when I arrive at your website. I thought you may wish to know, best wishes

  101. Oliver Dev said

    You could have used Envoyer or git to deploy your symfony app easily. Also, why shared hosting. Shared servers have poor performance and security. A better option is vps, if you have sysadmin skills. Otherwise use platforms like Cloudways symfony hosting to host your symfony app on managed servers that are scalable and have better performance.

  102. Evan Dethridge said

    Hi there!

    You Need Leads, Sales, Conversions, Traffic for wordpress.com ? Will Findet…

    I WILL SEND 5 MILLION MESSAGES VIA WEBSITE CONTACT FORM

    Don’t believe me? Since you’re reading this message then you’re living proof that contact form advertising works!
    We can send your ad to people via their Website Contact Form.

    IF YOU ARE INTERESTED, Contact us => lisaf2zw526@gmail.com

    Regards,
    Dethridge

  103. Jennifer Jennings said

    Wow, looks great, especially the end. I was looking for that topic for a few days
    across the nest, but there was nothing valuable, only discovered this https://thecincinnatusstandard.com/sample-essay-on-corporate-social-responsibility-2/, but still so happy to reach your post in the end.
    I am keen on that subject, and I want to be always aware of the most recent news.
    That is a joy to read your article and eventually clarify myself.

  104. The article reveals some burning questions and issues that needs to be discussed and clarified.

    Furthermore, it’s essential to understand within the very detail.
    In the post, an individual can easily locate something basic,
    unusually for him, something which will be immensely
    useful. So I am thrilled with the data that I have just obtained.

    Thanks a lot!

  105. May I just say what a comfort to uncover an individual who truly knows what they’re talking about on the web. You certainly know how to bring an issue to light and make it important. More people really need to read this and understand this side of the story. I can’t believe you are not more popular since you surely possess the gift.

Leave a comment