installation.md 3.33 KB
Newer Older
Sebastian Castro's avatar
Sebastian Castro committed
1 2 3
Installation and Production Instructions
========================================

Sebastien Rosset's avatar
Sebastien Rosset committed
4
*Last update : 2019/01/04*
5

Sebastian Castro's avatar
Sebastian Castro committed
6 7
Feel free to add some more informations if you solve installation issues !

Sebastien Rosset's avatar
Sebastien Rosset committed
8 9 10 11 12 13
Quick install
-------------

- **Debian script**: there is a script for debian installation named install_debian.sh in this docs directory ! After installation, go to http://localhost/GoGoCarto/web/app_dev.php/project/initialize to initialize your project.

- **Docker containers**: please follow the instructions [here](installation_docker.md).
Sebastian Castro's avatar
Sebastian Castro committed
14

Sebastian Castro's avatar
Sebastian Castro committed
15 16 17
Requirements
------------

18
1. Php (Sur Linux : php7.2-curl)
19
2. [Composer](https://getcomposer.org/download/)
Sebastian Castro's avatar
Sebastian Castro committed
20 21
3. [Nodejs](https://nodejs.org/en/download/)
4. [Git](https://git-scm.com/)
Sebastian Castro's avatar
Sebastian Castro committed
22
5. Web Server (Apache, Ngninx, [Wamp server](http://www.wampserver.com/) ...)
23
6. MongoDB (http://php.net/manual/fr/mongodb.installation.php) -> !!Version 3.4 or below!!!
Sebastian Castro's avatar
Sebastian Castro committed
24

25
The project is using php5. **If you want to use php7**, you will need to install the [MongoPhpAdapter](https://github.com/alcaeus/mongo-php-adapter)
26 27 28 29 30
To do so, please run :
```
composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter
```

Sebastien Rosset's avatar
Sebastien Rosset committed
31 32
Consider the [Docker installation](installation_docker.md) if you run into troubles installing these softwares.

Sebastian Castro's avatar
Sebastian Castro committed
33 34 35
Installation
------------

36
### Cloning repo (clone dev branch)
Sebastian Castro's avatar
Sebastian Castro committed
37 38
```
cd path-to-php-server-folder (default linux /var/www/html, windows c:/wamp/www... )
39 40
git clone https://github.com/pixelhumain/GoGoCarto
cd GoGoCarto/
Sebastian Castro's avatar
Sebastian Castro committed
41 42
```

43 44
### Installing dependencies
Php dependency (symfony, bundles...)
Sebastian Castro's avatar
Sebastian Castro committed
45
```
Sebastian Castro's avatar
Sebastian Castro committed
46
composer install
Sebastian Castro's avatar
Sebastian Castro committed
47
```
Sebastien Rosset's avatar
Sebastien Rosset committed
48
*During installation, app/config/parameters.yml file will be created, leave default fields*
Sebastian Castro's avatar
Sebastian Castro committed
49 50 51

Workflow dependencies (compiling sass and javascript)
```
Sebastian Castro's avatar
Sebastian Castro committed
52
npm install gulp
Sebastian Castro's avatar
Sebastian Castro committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
npm install
```

Start
-----
Dumping assets
```
php bin/console assets:install --symlink web
```

First build of Javascript and Css
```
gulp build
```

Start watching for file change (automatic recompile)
```
gulp watch
```


Generate Database
-----------------

77 78
Go to symfony console : http://localhost/GoGoCarto/web/app_dev.php/_console
Run the followings command
Sebastian Castro's avatar
Sebastian Castro committed
79
```
Sebastian Castro's avatar
Sebastian Castro committed
80
doctrine:mongodb:schema:create
Sebastian Castro's avatar
Sebastian Castro committed
81 82
doctrine:mongodb:generate:hydrators
doctrine:mongodb:generate:proxies
Sebastian Castro's avatar
Sebastian Castro committed
83
doctrine:mongodb:fixtures:load
Sebastian Castro's avatar
Sebastian Castro committed
84 85
```

86
The last command will generate a basic configuration
Sebastian Castro's avatar
Sebastian Castro committed
87

Sebastian Castro's avatar
Sebastian Castro committed
88
Then generate if necessary random point on the map :
Sebastian Castro's avatar
Sebastian Castro committed
89
app:elements:generate 200
Sebastian Castro's avatar
Sebastian Castro committed
90

91 92
Now initialize your project with following route
http://localhost/GoGoCarto/web/app_dev.php/project/initialize
Sebastian Castro's avatar
Sebastian Castro committed
93

Sebastian Castro's avatar
Sebastian Castro committed
94 95 96 97 98 99 100 101 102 103
Updating your install
---------------------

Each time you update GoGoCarto code, please run the following commands (first one is most important)
```
php bin/console db:migrate
gulp build
php bin/console cache:clear
```

Sebastian Castro's avatar
Sebastian Castro committed
104 105 106
Production
----------

Sebastian Castro's avatar
Sebastian Castro committed
107 108 109 110 111 112 113 114
1. Dump assetic in symfony console to update the web/templates files
```assetic:dump```

2. Generate compressed js and css files
```
gulp build
gulp production
```
Sebastian Castro's avatar
Sebastian Castro committed
115

Sebastian Castro's avatar
Sebastian Castro committed
116
3. enable gz compression in your web server
Sebastian Castro's avatar
Sebastian Castro committed
117

Sebastian Castro's avatar
Sebastian Castro committed
118
4. In the distant console (http://yoursite.com/web/app_dev.php/_console)
Sebastian Castro's avatar
Sebastian Castro committed
119 120 121
```
cache:clear --env=prod
```
122

123 124 125 126 127 128 129 130 131 132 133
5. Make sure that the var folder is writable ```chmod -R 771 var/```



Issues
-------

If you creating an element you ahev the issue "cannot load method bcmod from namespace ..."
You need to install the bc-math module
```
sudo apt install php7.0-bcmath
134 135 136 137 138
```

If memory limits while using composer
```
COMPOSER_MEMORY_LIMIT=-1 composer ...
139
```