1

I have an existing project from my personal project repository. What I would like to do is clone this repository and setup the environment, and this is what I have done :

  • Installing php 7.0 and all the require extension.
  • Install mysql
  • install apache2
  • Set the sites-available for magento 2. and restart the apache2

now I have the project in my dir /var/www/html/myproject/. But I don't know where to go from this like, where is the setup for mysql credential ? and other setup to make the project up and running in my local environtment.

Right now when I got to my localhost I got HTTP ERROR 500 ? any help would be appreciated.

0

For some reason I'm able to do this on my own so here is the steps Note I'm using Ubuntu 16.04 for my local env :

  1. Make sure all the file permission is your user : sudo chown -R you-user:your-user .
  2. Create your database schema. You can do this via cli or mysqlbranch.
  3. Edit your app/etc/env.php and find these file :

    array (
    'host' => 'localhost',
    'dbname' => 'yourdatabase',
    'username' => 'root',
    'password' => 'root',
    'model' => 'mysql4',
    'engine' => 'innodb',
    'initStatements' => 'SET NAMES utf8;',
    'active' => '1',
    )
    
  4. Now make bin/magento executable sudo chmod +x bin/magento

  5. This is IMPORTANT STEP : disable your additional module first, and there will only magento original module only to feed and setup the database. You can first move all your module first out of the app/code and app/design.

  6. run bin/magento setup:install --admin-user="gujarat" --admin-password="wkwkwkw" --admin-email="gujarat@balala.com" --admin-firstname="gujarat" --admin-lastname="santana". This will take forever to install.

  7. bin/magento setup:upgrade. If you have trouble in this step, this is more likely because of your custom module move all your custom module first to another directory and run this command again.

  8. bin/magento setup:di:compile

  9. Set appropriate permission files and folder.

You should see your sites now, but don't forget to move all your custum module to its respected directory. And run the upgrade and compile command from 7 & 8 step.

| improve this answer | |
0

Go to Magento root app/etc/env.php set database

'host' => 'localhost',
    'dbname' => 'yourdatabasename',
    'username' => 'mysqlusername',
    'password' => 'mysqlpassword',
    'active' => '1',
)

also check what is the mode you are 'MAGE_MODE' => 'default'

clear /var/cache , /var/generate, var/page_cache

Enable app/boostrap.php - ini_set('display_errors', 1); check what is 500 error.

Mysql Export via command line.

mysqldump -u username -p database_name > database_name.sql

Mysql import via command line.

mysql u -username -p database_name < database_name.sql

Another important point:

First update both the web/unsecure/base_url and web/secure/base_url URLs in core_config_data

| improve this answer | |
  • how to install and import all the tables to the database ? any command or step for that thanks ? – Gujarat Santana Aug 1 '17 at 7:37
  • i updated the ans. please check it. – Rama Chandran M Aug 1 '17 at 7:52
  • is there any way to install the db from beginning without export from mysql ? like for example when installing magento from the fresh installation ? – Gujarat Santana Aug 1 '17 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.