/en/deployment.rst

https://github.com/majna/docs · ReStructuredText · 58 lines · 43 code · 15 blank · 0 comment · 0 complexity · 476b9ad4cb535dee9384ec1ef7b3f63c MD5 · raw file

  1. Deployment
  2. ##########
  3. Once your application is complete, or even before that you'll want to deploy it.
  4. There are a few things you should do when deploying a CakePHP application.
  5. Set document root
  6. =================
  7. Setting the document root correctly on your application is an important step to
  8. keeping your code secure and your application safer. CakePHP applications,
  9. should have the document root set to the application's ``app/webroot``. This
  10. makes the application and configuration files inaccessible through a URL.
  11. Setting the document root is different for different webservers. See the
  12. :doc:`/installation/advanced-installation` documentation for webserver specific
  13. information.
  14. Update core.php
  15. ===============
  16. Updating core.php, specifically the value of ``debug`` is extremely important.
  17. Turning debug = 0 disables a number of development features that should never be
  18. exposed to internet at large. Disabling debug changes the following types of
  19. things:
  20. * Debug messages, created with :php:func:`pr()` and :php:func:`debug()` are
  21. disabled.
  22. * Core CakePHP caches are flushed every 99 years, instead of every 10 seconds as
  23. in development.
  24. * Error views are less informative, and give generic error messages instead.
  25. * Errors are not displayed.
  26. * Exception stack traces are disabled.
  27. In addition to the above, many plugins and application extensions use ``debug``
  28. to modify their behavior.
  29. Multiple CakePHP applications using the same core
  30. =================================================
  31. There are a few ways you can configure multiple applications to use the same
  32. CakePHP core. You can either use PHP's ``include_path`` or set the
  33. ``CAKE_CORE_INCLUDE_PATH`` in your application's ``webroot/index.php``.
  34. Generally using PHP's ``include_path`` is easier and more robust. CakePHP comes
  35. preconfigured to look on the ``include_path`` as well so it's simple to use.
  36. In your ``php.ini`` file locate the existing ``include_path`` directive, and
  37. either append to it or add an ``include_path`` directive::
  38. include_path = '.:/usr/share/php:/usr/share/cakephp-2.0/lib'
  39. This assumes you are running a \*nix server, and have CakePHP in
  40. ``/usr/share/cakephp-2.0``.
  41. .. meta::
  42. :title lang=en: Deployment
  43. :keywords lang=en: stack traces,application extensions,set document,installation documentation,development features,generic error,document root,func,debug,caches,error messages,configuration files,webroot,deployment,cakephp,applications