installation.md 3.09 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)
Sebastian Castro's avatar
Sebastian Castro committed
19
20
21
2. [Composer](https://getcomposer.org/download/) 
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/) ...)
Sebastian Castro's avatar
Sebastian Castro committed
23
6. MongoDB (http://php.net/manual/fr/mongodb.installation.php)
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
45
```

### Installing dependencies 
Php dependency (symfony, bundles...) 
```
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
94
95
96

Production
----------

Sebastian Castro's avatar
Sebastian Castro committed
97
98
99
100
101
102
103
104
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
105

Sebastian Castro's avatar
Sebastian Castro committed
106
3. enable gz compression in your web server
Sebastian Castro's avatar
Sebastian Castro committed
107

Sebastian Castro's avatar
Sebastian Castro committed
108
4. In the distant console (http://yoursite.com/web/app_dev.php/_console)
Sebastian Castro's avatar
Sebastian Castro committed
109
110
111
```
cache:clear --env=prod
```
112

113
114
115
116
117
118
119
120
121
122
123
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
124
125
126
127
128
```

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