File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,36 @@ Don't forget that deploying your application also involves updating any dependen
207
207
(typically via Composer), migrating your database, clearing your cache and
208
208
other potential things like pushing assets to a CDN (see `Common Post-Deployment Tasks `_).
209
209
210
+ Troubleshooting
211
+ ---------------
212
+
213
+ Deployments not Using the ``composer.json `` File
214
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
215
+
216
+ Symfony applications provide a ``kernel.project_dir `` parameter and a related
217
+ :method: `Symfony\\ Component\\ HttpKernel\\ Kernel\\ Kernel::getProjectDir> ` method
218
+ so you can perform file operations relative to your project's root directory.
219
+ The logic to find that directory is based on the location of the
220
+ ``composer.json `` file.
221
+
222
+ If your deployment method doesn't use Composer, you may have removed the
223
+ ``composer.json `` file and the application won't work on the production server.
224
+ The solution is to override the ``getProjectDir() `` method in the application
225
+ kernel and return your project's root directory::
226
+
227
+ // app/AppKernel.php
228
+ // ...
229
+ class AppKernel extends Kernel
230
+ {
231
+ // ...
232
+
233
+ public function getProjectDir()
234
+ {
235
+ return __DIR__.'/..';
236
+ }
237
+ }
238
+
239
+
210
240
.. _`Capifony` : https://github.com/everzet/capifony
211
241
.. _`Capistrano` : http://capistranorb.com/
212
242
.. _`sf2debpkg` : https://github.com/liip/sf2debpkg
You can’t perform that action at this time.
0 commit comments