M
M
Maila2017-10-18 22:51:51
MySQL
Maila, 2017-10-18 22:51:51

How to properly deploy a project on hosting?

The host address is entered in main-local:

<?php
return [
    'components' => [
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=mysql.hostinger.ru;dbname=u470880980_1',
            'username' => 'u470880980_1',
            'password' => 'указан паролль',
            'charset' => 'utf8',
        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',
            // send all mails to a file by default. You have to set
            // 'useFileTransport' to false and configure a transport
            // for the mailer to send real emails.
            'useFileTransport' => true,
        ],
    ],
];


There are tables on Open Server and I copied them into PhMypadmin. But when you go to PhMypadmin on hostinger, there is already a different user and u470880980_1 and the name u470880980 in the database name cannot be changed. i.e. I went into a new account and imported the tables.

59ea087b821f9301646778.jpeg

Now, if you go by the name of the site, a list of folders appears. 59e7aaaaa9997973665013.jpeg

If you go to dir fronted/web, the following error is displayed:

59e7b0c91083a319378905.jpeg

Still, it's not entirely clear: on the local server, domains for 'fronted' and 'backend' were registered separately. Here how? Need to create a subdomain for the backend? And will, in this case, changes to fronted be displayed when editing pages in bakeend?

In general, problem 2 was solved. For some reason, there were no Schema and QueryBuilder files in vendor\yiisoft\yii2\db\mysql. On the questions guide site there is info that: 'We do not maintain the information_schema database. All requests to it are denied because it causes high CPU usage.' There are no messages in FireZilla that some file was not transferred. In general, these 2 files were added to the server, the page opened.

The question remains: how to set up domains correctly for backend and fronted? Now there are 2 hosting accounts on the hosting - one works with a paid domain. The second is this site. those. to it for backend it is necessary to create a subdomain?
How to deploy the project in this case? I'm reading the Yii2 manual - and so I understand that you need to create .htaccess in the root of the site (it's empty now) and write the paths to the frontend and backend there? What exactly needs to be written?
In the Open Server settings I had Apache-2-4-x64 PhP -5.6-x64 MsSQL -5.5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zlatoslav Desyatnikov, 2017-10-20
@pxz

It looks like you don't have any dependencies installed.
Run
composer install --no-scripts

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question