One more note about Symfony installation

Just got into weird trouble. I’ve installed symfony on server and I was assured it must work. Everything seems to be working, create a new symfony project, app, module, etc. I pointed httpdocs to web folder with ln -s command and then tried to take a look from browser on my domain:

What did I see? Just empty page. Absolutely blank and VERY white 🙂
I’ve been playing with php.ini and figured out that error notification was turned off. Once this was fixed what I’ve seen instad of blank screen was:

open_basedir restriction in effect. File(/var/www/vhosts/domain/apps/frontend/config/config.php) is not within the
allowed path(s)

I’ve spent some time trying to figure out what is open_basedir and found out that it’s related with safe_mode stuff. It’s definitely that I have safe_mode turned on. But how? When I took a look into php.ini there was clearly that safe_mode is turned off.
But when I’m taking a look into phpinfo() data I saw that globally safe_mode is turned off but locally it’s turned on.
I spent more time investigating this and figured out that local stuff is stored in /var/www/vhosts/domain/conf/httpd.includes file
which contains both apache and php configuration parameters. Holly s.. 🙂
I did not expect this may be such a complicated. I removed lines with open_basedir and restrarted apache httpd -k restart.
And rock’n’roll!

I understand that this is quite specific problem but who knows maybe you’ll get into such trouble as well and it will help you.

Thanks for your attention!

3 replies on “One more note about Symfony installation”

open_basedir is completely separate thing, it is not actually related to safe_mode. You’d better put all your symfony stuff into one folder (i.e. ‘app’) and add a value (separate it by ‘:’) to open_basedir in your httpd.conf as ‘/var/www/vhosts/domain/app’. That will allow your scripts to open all files and folders under …/app/ (like /var/www/vhosts/domain/app/apps/….)
Turnig open_basedir off makes your server unprotected, you really don’t want that somebody will read your .passwd file, do you? 8) .
Regards, Alex 😉

Leave a Reply

Your email address will not be published. Required fields are marked *