Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update heroku.rst#8285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
DougHayward wants to merge1 commit intosymfony:masterfromDougHayward:patch-1
Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 5 additions & 30 deletionsdeployment/heroku.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -94,7 +94,7 @@ directory of the application and add just the following content:

.. code-block:: text

web: vendor/bin/heroku-php-apache2web/
web: vendor/bin/heroku-php-apache2public/

.. note::

Expand All@@ -104,14 +104,14 @@ directory of the application and add just the following content:

.. code-block:: text

web: vendor/bin/heroku-php-nginx -C nginx_app.confweb/
web: vendor/bin/heroku-php-nginx -C nginx_app.confpublic/

If you prefer working on the command console, execute the following commands to
create the ``Procfile`` file and to add it to the repository:

.. code-block:: terminal

$ echo "web: vendor/bin/heroku-php-apache2web/" > Procfile
$ echo "web: vendor/bin/heroku-php-apache2public/" > Procfile
$ git add .
$ git commit -m "Procfile for Apache and PHP"
[master 35075db] Procfile for Apache and PHP
Expand DownExpand Up@@ -227,38 +227,13 @@ application will respond:

You should be seeing your Symfony application in your browser.

.. caution::

If you take your first steps on Heroku using a fresh installation of
the Symfony Standard Edition, you may run into a 404 page not found error.
This is because the route for ``/`` is defined by the AcmeDemoBundle, but the
AcmeDemoBundle is only loaded in the dev environment (check out your
``AppKernel`` class). Try opening ``/app/example`` from the AppBundle.

Custom Compile Steps
~~~~~~~~~~~~~~~~~~~~

If you wish to execute additional custom commands during a build, you can leverage
Heroku's `custom compile steps`_. Imagine you want to remove the ``dev`` front controller
from your production environment on Heroku in order to avoid a potential vulnerability.
Adding a command to remove ``web/app_dev.php`` to Composer's `post-install-commands`_ would
work, but it also removes the controller in your local development environment on each
``composer install`` or ``composer update`` respectively. Instead, you can add a
`custom Composer command`_ named ``compile`` (this key name is a Heroku convention) to the
``scripts`` section of your ``composer.json``. The listed commands hook into Heroku's deploy
process:

.. code-block:: json

{
"scripts": {
"compile": [
"rm web/app_dev.php"
]
}
}

This is also very useful to build assets on the production system, e.g. with Assetic:
Heroku's `custom compile steps`_. The listed commands hook into Heroku's deploy
process, this is very useful for building assets on the production system, e.g. with Assetic:

.. code-block:: json

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp