Step By step Yii2 on Heroku

Hey all,

I am struggle a problem to install yii2 on heroku;


Here is step by step what we have done.

installed yii-advanced on my localhost (development mode)

installed yii2-heroku extension from offical yii extension section ( by command: composer require --dev --prefer-dist purrweb/yii2-heroku "*"

prepared Yii2 to production mode by command: php /path/to/yii-application/init --env=Production --overwrite=All

tested localhost, and everythig was great

connected heroku dashboard and created a database (postgresql)

migrated yii

tested localhost, and database connection was ok

connected heroku from terminal (heroku login)

created an app on heroku

created git for the local files

and deployed files to heroku by command: git push heroku master

tested and everthing seems fine on heroku

but when navigate the my heroku app url it says:


You don’t have permission to access / on this server.

I have tried adding "frontend/web/index.php" to end of url, but nothing changed except:

Not Found

The requested URL /frontend/web/index.php was not found on this server.

So stucked in that stage, any help?


My aim is to create a step by step installing guide for whom desire to work on heroku new beginners

Hope you contribute for successfull deployment.

Hi @oratoran.

Could you describe how you create the heroko dino, please? What buildpacks do you install?

After install, it installed the laravel package?

You need to configure your Profile.
Example: web: …/vendor/bin/apache2 web/
I’m the end of the line, you need to setup your public folder app
See more on Deploy PHP on Heroku, on Heroku documentation.