Question

As a learning exercise I used Symfony to update an existing application for a local non-profit. Development was in a Windows environment. Now that the application has been installed on their ISP's shared host I start to learn about chroot on a FastCGI server. There are errors such as this:

PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/home/projectmana/www2.projectmana.org/app/logs/prod.log" could not be opened: failed to open stream: No such file or directory' in /www2.projectmana.org/app/cache/prod/classes.php:4823

The ISP responds with:

Bad path. PHP is chrooted in /home/projectmana/.

OK. I get it that this is the problem. Web searches so far have not provided a clue as to how to proceed. (I've gained greater appreciation for Symfony wanting to avoid shared hosting.) Is there a solution that I, a relative novice and a volunteer, can implement in my code, or does the application have to find a new home?

Was it helpful?

Solution 2

The solution in this instance was to override the locations of the cache and logs directories according to the cookbook. This, however, by itself causes the cache:clear command to fail. The answer to that problem will have to appear in another question if I can't find it on my own.

Update

The other solution here cannot work because any php setting in .htaccess when Apache server is running FastCGI will cause a server error. Clearing the cache was never solved so the site was moved to a non-CGI host.

OTHER TIPS

You've got to set the doc_root variable according to your chrooted directory:

doc_root = "/home/projectmana"
cgi.fix_pathinfo = 0

You do this in the php.ini file - which seems to be not an option for you since you're on a shared server environment. When using Apache as a webserver, you can use a .htaccess file and set the proper PHP directives there via php_value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top