Partie VIII. Installer Php et PhpMyAdmin
Précédent ACCUEIL Suivant

VIII. INSTALLER PHP ET PHPMYADMIN

8.1 - Installer les paquets

La CentOS 7 dispose du paquet "php" dans sa version 5.4. Procédez à l'installation des paquets nécessaires par la commande suivante :

# yum install php php-bcmath php-cli php-gd php-mbtring php-mcrypt php-mysql \
  php-pdo php-pear php-xml php-xmlrpc phpMyAdmin

Pour obtenir la dernière version de phpMyAdmin vous devez activer le dépot "epel".

8.2 - Configurer Php

Modifiez le fichier [/etc/php.ini] de la manière suivante :

Ligne 211 => short_open_tag = on
Ligne 375 => expose_php = off
Ligne 405 => memory_limit = 128M
Ligne 672 => post_max_size = 128M
Ligne 800 => upload_max_filesize = 20M
Ligne 878 => date.timezone = Europe/Paris

Redémarrez le service "httpd" :

# systemctl restart httpd.service

Créez le fichier [/var/www/html/info.php] de la manière suivante :

Ligne 1 => <?php
Ligne 2 =>     phpinfo();
Ligne 3 => ?>

Testez le fonctionnement de Php : http://<Votre adresse IP>/info.php :

Figure 38 - Test de fonctionnement de Php

Test de fonctionnement de Php

Php est opérationnel ...

8.3 - Configurer PhpMyAdmin

Modifiez le fichier [/etc/httpd/conf.d/phpMyAdmin] de la manière suivante :

Figure 39 - Fichier [/etc/httpd/conf.d/phpMyAdmin]

Fichier [/etc/httpd/conf.d/phpMyAdmin]

Soyez vigilant pour les lignes "Require ip ..." et "Allow from ..." ! Tenez compte de votre propre réseau.

Redémarrez le service "httpd" :

# systemctl restart httpd.service

Testez le fonctionnement de phpMyAdmin à l'aide d'un navigateur : http://<Votre adresse IP>/phpmyadmin.

Figure 41 - phpMyAdmin

phpMyAdmin

phpMyAdmin est opérationnel ...



Auteurs : Eddy et Stéphane Maas / 2013-2023
Précédent ACCUEIL Suivant