15-03-2019

This commit is contained in:
2019-03-15 20:20:37 +01:00
parent 53d2ce1c0d
commit 941984f1ee
52 changed files with 6416 additions and 70 deletions

View File

@@ -1,3 +1,7 @@
# d
# Installer Apache (homebrew)
### Installation:
@@ -82,7 +86,15 @@ Editer le fichier *httpd-vhosts.conf*:
#### Redirection de port:
wiki.js tourne sur localhost:3000 Pour le rendre disponible sur wiki.silverbook.local:
wiki.js tourne sur localhost:3000
Pour le rendre disponible sur wiki.silverbook.local:
Editer le fichier *httpd.conf* et activer les modules `mod_proxy` et `mod_proxy_http`:
```bash
LoadModule proxy_module lib/httpd/modules/mod_proxy.so
LoadModule proxy_http_module lib/httpd/modules/mod_proxy_http.so
```
Editer le fichier *hosts*:
@@ -101,6 +113,7 @@ Editer le fichier *httpd-vhosts.conf*:
ProxyPassReverse / http://localhost:3000/
ProxyPreserveHost On
</VirtualHost>
```

View File

@@ -0,0 +1,120 @@
# Installer mysql
### Installation:
```bash
$ brew update
$ brew install mariadb
$ brew services start mariadb
```
`/usr/local/Cellar/mariadb/10.2.11`
### Arrêter MySQL:
```bash
$ brew services stop mariadb
```
### Démarrer MySQL:
```bash
$ brew services start mariadb
ou
$ mysql.server start
```
### Fix the 2002 MySQL Socket error:
```bash
$ sudo mkdir /var/mysql
$ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
```
### Version:
```bash
$ mysql -v -u root -p
```
### Après une m-à-j:
arrêter puis démarrer
### Bases:
Les bases sont stockées ici: `/usr/local/var/mysql`
### Fichier de configuration:
my.cnf:
```
#osx (Homebrew): /usr/local/etc/my.cnf
[mysqld]
#innodb_force_recovery = 1
```
### Erreurs:
```bash
$ mysql -v -u root -p
mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2 "No such file or directory")
Fatal error in defaults handling. Program aborted
```
Le répertoire `/usr/local/etc/my.cnf.d` n'existe plus, il faut le recréer et y créer un fichier:
```bash
$ mkdir /usr/local/etc/my.cnf.d
$ touch wont_prune.txt
```
Les fichiers [logs](https://dev.mysql.com/doc/refman/5.7/en/server-logs.html) (domain.err) sont avec les bases:
```bash
#osx (Homebrew):
$ cd /usr/local/var/mysql
total 388560
drwxr-xr-x 32 bruno admin 1024 28 nov 16:53 .
drwxrwxr-x 13 bruno admin 416 16 fév 2018 ..
-rw-rw---- 1 bruno admin 16384 28 nov 08:08 aria_log.00000001
-rw-rw---- 1 bruno admin 52 28 nov 08:08 aria_log_control
drwx------ 48 bruno admin 1536 1 déc 17:05 funnymac
drwx------ 53 bruno admin 1696 1 déc 17:05 ghost_prod
-rw-r----- 1 bruno admin 15114 28 nov 08:08 ib_buffer_pool
-rw-rw---- 1 bruno admin 50331648 3 déc 07:19 ib_logfile0
-rw-rw---- 1 bruno admin 50331648 24 oct 12:51 ib_logfile1
-rw-rw---- 1 bruno admin 79691776 3 déc 07:19 ibdata1
-rw-rw---- 1 bruno admin 12582912 28 nov 16:53 ibtmp1
-rw-rw---- 1 bruno admin 0 24 jul 2017 multi-master.info
drwx------ 89 bruno admin 2848 1 déc 17:05 mysql
drwx------ 3 bruno admin 96 24 jul 2017 performance_schema
drwx------ 41 bruno admin 1312 1 déc 17:05 phpmyadmin
-rw-rw---- 1 bruno admin 1271878 3 déc 07:19 silverbook.home.err
-rw-rw---- 1 bruno admin 5 28 nov 16:53 silverbook.home.pid
```
### Liens:
[:fa-link: https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-macos-sierra/ ](https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-macos-sierra/)
[:fa-link: https://coolestguidesontheplanet.com/how-to-change-the-mysql-root-password/ ](https://coolestguidesontheplanet.com/how-to-change-the-mysql-root-password/)
[:fa-link: http://apple.stackexchange.com/questions/255671/error-mysql-server-pid-file-could-not-be-found](http://apple.stackexchange.com/questions/255671/error-mysql-server-pid-file-could-not-be-found)
### Package MySQL
[:fa-link: Télécharger depuis mysql.com](http://dev.mysql.com/downloads/mysql/)
[:fa-link: Installation](https://dev.mysql.com/doc/refman/5.7/en/osx-installation.html)
###

View File

@@ -1,79 +1,599 @@
# Installer mysql
# mysql
### Installation:
### Connexion à la base:
#### Se connecter à MySQL:
```bash
$ brew update
$ brew install mariadb
$ brew services start mariadb
$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 18
Server version: 10.3.11-MariaDB Homebrew
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
```
`/usr/local/Cellar/mariadb/10.2.11`
### Arrêter MySQL:
#### Connexion à la base wordpress4 par lutilisateur root:
```bash
$ brew services stop mariadb
$ mysql -u root -D wordpress4 -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 17
Server version: 10.3.11-MariaDB Homebrew
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [wordpress4]>
```
### Démarrer MySQL:
#### Quitter MySQL:
```bash
$ brew services start mariadb
ou
$ mysql.server start
MariaDB [wordpress4]> exit
Bye
```
### Fix the 2002 MySQL Socket error:
### Types de bases (moteur de stockage):
[InnoDB](https://dev.mysql.com/doc/refman/5.5/en/innodb-storage-engine.html)
Conseil: enable innodb_file_per_table = 1 option to put indexes and data for individual tables into distinct files.
Requête pour trouver les tables InnoDB parmi toutes les bases:
```mysql
mysql> SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE engine = 'innodb';
```
Constitution de Mysql (par défaut):
```bash
$ sudo mkdir /var/mysql
$ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
bruno@silverbook:/usr/local/var/mysql$
-rw-r----- 1 bruno admin 15114 28 nov 08:08 ib_buffer_pool
-rw-rw---- 1 bruno admin 50331648 3 déc 10:35 ib_logfile0
-rw-rw---- 1 bruno admin 50331648 24 oct 12:51 ib_logfile1
-rw-rw---- 1 bruno admin 79691776 3 déc 10:35 ibdata1
-rw-rw---- 1 bruno admin 12582912 28 nov 16:53 ibtmp1
-rw-rw---- 1 bruno admin 1272770 3 déc 10:35 silverbook.home.err
-rw-rw---- 1 bruno admin 5 28 nov 16:53 silverbook.home.pid
```
### Version:
- ibdata1: fichier de 10Mo extensible. InnoDB y stocke tout (bases,tables, index...) pour éviter la fragmentation.
- ib_logfile0, ib_logfile1: 2 fichiers log de 5Mo.
- ibtmp1
- ib_buffer_pool:
- silverbook.home.err: fichier log des erreurs
http://forum.wgpower.net/technique/innodb-fichier-ibdata1-trop-37009_1.html
https://vdachev.net/2007/02/22/mysql-reducing-ibdata1/
https://stackoverflow.com/questions/3456159/how-to-shrink-purge-ibdata1-file-in-mysql
[MyISAM](https://dev.mysql.com/doc/refman/5.5/en/myisam-storage-engine.html)
#### Connaitre le type de bases par défaut:
<u>mysql> show engine;</u>
```bash
$ mysql -v -u root -p
MariaDB [(none)]> show engines;
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | Stores tables as CSV files | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MyISAM | YES | Non-transactional engine with good performance and small data footprint | NO | NO | NO |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
| InnoDB | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
8 rows in set (0.007 sec)
```
### Après une m-à-j:
arrêter puis démarrer
### Erreurs:
#### ENGINE utilisé pour une table:
<u>mysql> SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = 'database';</u>
```bash
$ mysql -v -u root -p
mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (Errcode: 2 "No such file or directory")
Fatal error in defaults handling. Program aborted
MariaDB [(none)]> SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = 'zenphoto';
+------------------+--------+
| TABLE_NAME | ENGINE |
+------------------+--------+
| _menu | InnoDB |
| .tags | InnoDB |
| .plugin_storage | InnoDB |
| _images | InnoDB |
| .pages | MyISAM |
| .menu | InnoDB |
| _plugin_storage | InnoDB |
| .admin_to_object | InnoDB |
| _tags | InnoDB |
.../...
| .captcha | InnoDB |
| .news | InnoDB |
| .comments | MyISAM |
| _admin_to_object | InnoDB |
| _comments | InnoDB |
| _pages | InnoDB |
+------------------+--------+
32 rows in set (0.012 sec)
```
Le répertoire `/usr/local/etc/my.cnf.d` n'existe plus, il faut le recréer et y créer un fichier:
```bash
$ mkdir /usr/local/etc/my.cnf.d
$ touch wont_prune.txt
```
### Bases:
Les bases sont stockées ici: `/usr/local/var/mysql`
#### Voir toutes les bases:
### Liens:
<u>mysql> SHOW DATABASES;</u>
[:fa-link: https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-macos-sierra/ ](https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-macos-sierra/)
```bash
MariaDB [(none)]> SHOW DATABASES;
[:fa-link: https://coolestguidesontheplanet.com/how-to-change-the-mysql-root-password/ ](https://coolestguidesontheplanet.com/how-to-change-the-mysql-root-password/)
+--------------------+
| Database |
+--------------------+
| funnymac |
| ghost_prod |
| information_schema |
| mgpt |
| mysql |
| performance_schema |
| phpmyadmin |
| piwik |
| python |
| ssi |
| wordpress4 |
| wordpress5 |
| xhprof |
| xhprof_gui |
| yeswiki |
| zenphoto |
+--------------------+
[:fa-link: http://apple.stackexchange.com/questions/255671/error-mysql-server-pid-file-could-not-be-found](http://apple.stackexchange.com/questions/255671/error-mysql-server-pid-file-could-not-be-found)
16 rows in set (0.007 sec)
```
### Package MySQL
#### Utiliser une base existante:
[:fa-link: Télécharger depuis mysql.com](http://dev.mysql.com/downloads/mysql/)
<u>mysql> USE database;</u>
[:fa-link: Installation](https://dev.mysql.com/doc/refman/5.7/en/osx-installation.html)
```bash
MariaDB [(none)]> USE ssi
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [ssi]>
```
#### Supprimer une base:
<u>mysql> DROP DATABASE database</u>
```bash
MariaDB [(none)]> DROP DATABASE zenphoto
```
### Tables:
#### Voir les tables de la base courante:
<u>mysql [database]> SHOW TABLES;</u>
```bash
MariaDB [zenphoto]> SHOW TABLES;
+--------------------+
| Tables_in_zenphoto |
+--------------------+
| .admin_to_object |
| .administrators |
| .albums |
| .captcha |
| .comments |
| .images |
.../...
| _news |
| _news2cat |
| _news_categories |
| _obj_to_tag |
| _options |
| _pages |
| _plugin_storage |
| _search_cache |
| _tags |
+--------------------+
32 rows in set (0.000 sec)
```
#### Structure dune table:
<u>mysql [database]> DESCRIBE table;</u>
```bash
MariaDB [zenphoto]> DESCRIBE _tags;
+-------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+----------------+
| id | int(11) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(255) | NO | UNI | NULL | |
+-------+------------------+------+-----+---------+----------------+
2 rows in set (0.030 sec)
```
#### Renommer une table:
mysql [database]> ALTER TABLE table AS new_table;
```bash
MariaDB [zenphoto]> ALTER TABLE _tags RENAME AS _new-tags;
```
#### Vérification des tables :
<u>2 solutions:</u>
**1) CHECK TABLE table;**
```bash
MariaDB [zenphoto]> CHECK TABLE _tags;
+----------------+-------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+----------------+-------+----------+----------+
| zenphoto._tags | check | status | OK |
+----------------+-------+----------+----------+
1 row in set (0.043 sec)
```
**2) [mysqlcheck](https://mariadb.com/kb/en/library/mysqlcheck/)**
mysqlcheck verrouille chaque table en lecture seule (la base est alors inaccessible pour les autres processus pendant ce temps) pour vérification ou réparation.
```bash
$ mysqlcheck -u root -ppassword zenphoto
zenphoto..admin_to_object OK
zenphoto..administrators OK
zenphoto..albums OK
zenphoto..captcha OK
zenphoto..comments OK
zenphoto..images OK
zenphoto..menu OK
.../...
zenphoto._news2cat OK
zenphoto._news_categories OK
zenphoto._obj_to_tag OK
zenphoto._options OK
zenphoto._pages OK
zenphoto._plugin_storage OK
zenphoto._search_cache OK
zenphoto._tags OK
```
#### Optimiser:
Les bases InnoDB ne supportent pas loption OPTIMIZE.
A la place,MySQL crée une nouvelle table, y copie toutes les lignes, efface lancienne table, renomme la nouvelle et lance ANALYSE
```bash
mysqlcheck -u root -ppassword -o --all-databases
funnymac.download OK
funnymac.downloads OK
funnymac.eggs OK
funnymac.ipod OK
funnymac.ipod_news OK
funnymac.ipod_vers OK
funnymac.liens OK
funnymac.livre OK
funnymac.note OK
funnymac.numeric_info Table is already up to date
funnymac.numeric_log OK
funnymac.numeric_vers OK
funnymac.tips OK
funnymac.truc OK
funnymac.vote OK
ghost_prod.accesstokens
note : Table does not support optimize, doing recreate + analyze instead
status : OK
```
#### Réparer des tables :
[MySQL Server logs](https://dev.mysql.com/doc/refman/5.7/en/server-logs.html)
La 1ere chose à faire en cas de problèmes est de consulter les fichiers logs. Ceux-çi sont généralement avec les tables:
```bash
#osx (Homebrew):
$ cd /usr/local/var/mysql
total 388560
drwxr-xr-x 32 bruno admin 1024 28 nov 16:53 .
drwxrwxr-x 13 bruno admin 416 16 fév 2018 ..
-rw-rw---- 1 bruno admin 16384 28 nov 08:08 aria_log.00000001
-rw-rw---- 1 bruno admin 52 28 nov 08:08 aria_log_control
drwx------ 48 bruno admin 1536 1 déc 17:05 funnymac
drwx------ 53 bruno admin 1696 1 déc 17:05 ghost_prod
-rw-r----- 1 bruno admin 15114 28 nov 08:08 ib_buffer_pool
-rw-rw---- 1 bruno admin 50331648 3 déc 07:19 ib_logfile0
-rw-rw---- 1 bruno admin 50331648 24 oct 12:51 ib_logfile1
-rw-rw---- 1 bruno admin 79691776 3 déc 07:19 ibdata1
-rw-rw---- 1 bruno admin 12582912 28 nov 16:53 ibtmp1
drwx------ 9 bruno admin 288 1 déc 17:05 mgpt
-rw-rw---- 1 bruno admin 0 24 jul 2017 multi-master.info
drwx------ 89 bruno admin 2848 1 déc 17:05 mysql
drwx------ 3 bruno admin 96 24 jul 2017 performance_schema
drwx------ 41 bruno admin 1312 1 déc 17:05 phpmyadmi
-rw-rw---- 1 bruno admin 1271878 3 déc 07:19 silverbook.home.err
-rw-rw---- 1 bruno admin 5 28 nov 16:53 silverbook.home.pid
```
<u>Pour réparer, 2 solutions:</u>
**1) REPAIR TABLE:**
- ne nécessite pas larrêt de MySQL
- uniquement base MyISAM
```bash
MariaDB [zenphoto]> REPAIR TABLE _tags;
+----------------+--------+----------+---------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+----------------+--------+----------+---------------------------------------------------------+
| zenphoto._tags | repair | note | The storage engine for the table doesn't support repair |
+----------------+--------+----------+---------------------------------------------------------+
1 row in set (0.006 sec)
```
Si lerreur persiste, **vider le cache** (Flush all cache)
**2) mysqlcheck -r:**
- nécessite un arrêt du service MySQL
- uniquement base MyISAM
[MyISAM](https://dev.mysql.com/doc/refman/5.5/en/myisam-storage-engine.html):
```bash
$ mysqlcheck -u root -ppassword -r zenphoto .comments
zenphoto..comments OK
```
[InnoDB](https://dev.mysql.com/doc/refman/5.5/en/innodb-storage-engine.html):
```bash
$ mysqlcheck -u root -ppassword -r zenphoto _tags
zenphoto._tags
note : The storage engine for the table doesn't support repair
```
Pour les tables InnoDB, il faut [forcer la récupération](https://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html):
1) Arrêter **mysqld**:
2) Sauvegarder **mysql**:
```bash
#Linux
/var/lib/mysql/
#osx (Homebrew)
/usr/local/var/mysql/
```
3) Ajouter au fichier de configuration MySQL my.cnf:
```
#osx (Homebrew): /usr/local/etc/my.cnf
[mysqld]
innodb_force_recovery = 4
```
4) Redémarrer **mysqld**:
5a) Faire un dump des tables de la base avec **SELECT ... INTO OUTFILE**:
```mysql
MariaDB [zenphoto]> SELECT * FROM _tags INTO OUTFILE '/tmp/corrupted.txt';
Query OK, 170 rows affected (0.011 sec)
# Pour exporter au format csv:
MariaDB [zenphoto]> SELECT * FROM _tags INTO OUTFILE '/tmp/corrupted.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n';
Query OK, 170 rows affected (0.006 sec)
```
5b) Faire. un dump de toutes les tables:
```bash
$ mysqldump -A -u root -ppassword > '/tmp/dump.sql';
```
6) Parfois cela peut suffire. Sinon,
7) Supprimer les tables / bases corrompues (DROP ...)
8) Arrêter **mysqld**:
9) Supprimer les ib*:
```bash
#Linux
/var/lib/mysql/ib*
#osx (Homebrew)
/usr/local/var/mysql/ib*
```
10) Quitter le mode force recovery:
```
[mysqld]
#innodb_force_recovery = 0
```
11) Redémarrer **mysqld**:
12) Restaurer les bases:
```bash
$ mysql -u root -ppassword < dump.sql
```
https://www.nixpal.com/mysql-innodb-corruption-repair-guide/
#### Vérifier et réparer:
Vérifier toutes les bases et réparer les tables corrompues:
```bash
$ mysqlcheck -u root -p -A --auto-repair
Enter password:
funnymac.download OK
funnymac.downloads OK
…/…
```
#### Erreur de syntaxe:
Les commandes doivent se terminer par un **;**
```bash
MariaDB [(none)]> mysqlcheck zenphoto
->
-> \c
MariaDB [(none)]>
```
Sinon taper **\c** pour revenir.
#### Tache CRON pour maintenance MySQL
```bash
echo "0 4 * * Sun root mysqlcheck -u maintenance --optimize --all-databases" > /etc/cron.d/mysqlcheck
```
```bash
$ mysql_upgrade -u root -ppassword
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
```
###

View File

@@ -1,3 +1,7 @@
# PHP 7.2
Installer PHP 7.2 (Homebrew)

View File

@@ -0,0 +1,133 @@
# PHP 7.3
### Changer de version de PHP:
```bash
$ brew unlink php@7.3 && brew link --force --overwrite php@5.6
```
On installe un petit utilitaire [PHP Switcher Script](https://gist.github.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2)
```bash
$ curl -L https://gist.githubusercontent.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2/raw > /usr/local/bin/sphp
$ chmod +x /usr/local/bin/sphp
```
Ensuite. pour changer de version:
```bash
$ sphp 7.3
```
Par exemple, pour passer de 7.2.13. à 7.3.0_1:
```bash
$ sphp 7.3
Switching to php@7.3
Switching your shell
Unlinking /usr/local/Cellar/php@7.2/7.2.13... 25 symlinks removed
Unlinking /usr/local/Cellar/php/7.3.0_1... 0 symlinks removed
Linking /usr/local/Cellar/php/7.3.0_1... 24 symlinks created
You will need sudo power from now on
Switching your apache conf
Password:
Restarting apache
PHP 7.3.0 (cli) (built: Jan 3 2019 10:08:00) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.0, Copyright (c) 1999-2018, by Zend Technologies
All done!
```
Il y a un autre utilitaire (<u>brew-php-switcher</u>):
```bash
$ brew info brew-php-switcher
brew-php-switcher: stable 2.0, HEAD
Switch Apache / Valet / CLI configs between PHP versions
https://github.com/philcook/php-switcher
Not installed
```
### Extensions:
#### Liste des extensions (Homebrew):
```bash
$ brew search php73
```
#### Installer des extensions:
Elles s'installent via [PECL](https://pecl.php.net) (requiert autoconf, `brew install autoconf`).
- ```bash
$ pecl uninstall -r xdebug
$ pecl install xdebug
$ pecl install yaml
$ pecl install redis
$ pecl install apcu
$ pecl install memcached
$ pecl install imagick
# Pour une version spécifique:
$ pecl install xdebug-2.7.0beta1
```
Pour les activer, créez un fichier de configuration dans `/usr/local/etc/php/7.3/conf.d/`
```bash
bruno@silverbook:/usr/local/etc/php/7.3/conf.d$ l
total 32
drwxr-xr-x 6 bruno admin 192 4 jan 19:32 .
drwxr-xr-x 9 bruno admin 288 3 jan 19:34 ..
-rw-r--r-- 1 bruno admin 72 4 jan 16:09 ext-opcache.ini
-rw-r--r-- 1 bruno admin 172 4 jan 18:58 ext-xdebug.ini
-rw-r--r-- 1 bruno admin 81 4 jan 18:43 ext-yaml.ini
-rw-r--r-- 1 bruno admin 87 13 déc 07:12 fix-jit.ini
bruno@silverbook:/usr/local/etc/php/7.3/conf.d$ nano ext-xdebug.ini
[xdebug]
zend_extension="/usr/local/lib/php/pecl/20180731/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
```
### Erreurs:
#### Warning: preg_replace(): JIT compilation failed: no more memory in
Il s'agit d'un [bug](https://bugs.php.net/bug.php?id=77260) connu de PHP 7.3.
2 solutions:
- désinstaller php 7.3
`$ brew uninstall php@7.3`
- désactiver la compilation PCRE JIT dans le php.ini
`pcre.jit=0`
Pour désactiver la compilation PCRE JIT, on peut aussi créer un fichier `fix-jit.ini` dans `/usr/local/etc/php/7.3/conf.d`et y ajouter:
```php
; My php.ini settings
; Fix for PCRE "JIT compilation failed" error
[Pcre]
pcre.jit=0
```