Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony project on CPanel account

For a bit of history - this is the first time I attempted to setup a test symfony project, just to have a play with it.

The symfony project was setup in the following location:

~/symfony_projects/myproject/

Now, with cpanel, the httpd.conf is automatically generated (but I'm sure you knew that), and it uses ~/public_html/ as the web root and splits it up by domain name (virtual hosts) - so for this example, lets say it's ~/public_html/example.com/.

So the symfony project is all setup now, the next problem was trying to figure out how to setup the server so it points to the /web part of the project - this is where I found it tricky.

I tried doing the following:

ln -sf ~/public_html/libs/Symfony/data/web/sf ~/symfony_projects/myproject/web/sf
ln -sf ~/symfony_projects/myproject/web/* ~/public_html/example.com

That unfortunately didn't work though. When trying to go to http://www.example.com it just gave me a 500 error.

Any other options here? Taking into consideration that I cannot modify the httpd.conf. And even if I could, it's auto-generated and would rather not (in cpanel).

* Update *

I just tried what was suggested by @Dan, but with the same issue - getting HTTP Error 500 (Internal Server Error). So, it looks like something else is the issue.

I checked my error_logs but didn't see anything useful there. Is there any other way I can check to see what the problem is?

* Another Update *

Just tried http://example.com/frontend_dev.php and it works perfectly - gives no errors at all, which makes it kind of hard to debug the production controller.

So the Development controller works flawlessly and the production is spitting out the 500 error - any ideas? :/

like image 994
xil3 Avatar asked Nov 15 '22 03:11

xil3


1 Answers

I just copy everything out of web/ (including css/, js/, etc. subfolders) one level higher, then edit the index.php/yourapp_dev.php files' require statements to reflect the change in path. Add some rewrite rules to forbid direct access to the rest of the directories and you're all set on servers where you can't change the document root.

like image 123
Dan Grossman Avatar answered Dec 19 '22 23:12

Dan Grossman