Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 14/01/2016, à 00:47

tomstbe

RESOLU: accès phpmyadmin et moodle impossible

Bonjour,

j'ai besoin pour un projet de travail d'installer phpmyadmin et moodle.
Après installation de Apache2/MySql/PHP5 j'ai installer phpmyadmin et suivi le processus d'installation de moodle , une vidéo youtube montre également comment l'installer (vidéo installation moodle). Une fois arrivé à l'étape 7 "complete setup" la suite de l'installation s'effectue en allant sur http://localhost/moodle .
Lorsque je tape cette adresse dans Firefox ou Chromium au lieu que la page s'affiche correctement seul le code PHP s'affiche comme celà:

 <?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Moodle frontpage.
 *
 * @package    core
 * @copyright  1999 onwards Martin Dougiamas (http://dougiamas.com)
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

if (!file_exists('./config.php')) {
    header('Location: install.php');
    die;
}

require_once('config.php');
require_once($CFG->dirroot .'/course/lib.php');
require_once($CFG->libdir .'/filelib.php');

redirect_if_major_upgrade_required();

$urlparams = array();
if (!empty($CFG->defaulthomepage) && ($CFG->defaulthomepage == HOMEPAGE_MY) && optional_param('redirect', 1, PARAM_BOOL) === 0) {
    $urlparams['redirect'] = 0;
}
$PAGE->set_url('/', $urlparams);
$PAGE->set_course($SITE);
$PAGE->set_other_editing_capability('moodle/course:update');
 

J'ai le même type d'erreur avec phpmyadmin.

Je sens que la solution pour avoir les pages d'accueil de phpmyadmin et moodle s'affichant normalement dans mes browser est simple, mais la j'avoue que je bloque.

Merci d'avance pour votre aide.

Tomstbe

Dernière modification par tomstbe (Le 14/01/2016, à 18:07)

Hors ligne

#2 Le 14/01/2016, à 01:07

pires57

Re : RESOLU: accès phpmyadmin et moodle impossible

Est ce la même pour tout les codes PHP? Peut tu créer un fichier test.PHP dans /var/www/HTML/ puis rentrer le code suivant:

<?php
phpinfo();
?>

Essaye d'accéder a la page via le navigateur.

Dernière modification par pires57 (Le 14/01/2016, à 01:27)


Utilisateur d'Archlinux, Ubuntu et Kali Linux
Administrateur système et réseau spécialisé Linux.
LinkedIn

Hors ligne

#3 Le 14/01/2016, à 01:24

tomstbe

Re : RESOLU: accès phpmyadmin et moodle impossible

Pour accéder à mes autres fichiers php je vais sur localhost/projects.
En mettant le fichier test.php que tu m'as donné dans le dossier projects, puis en y accédant via un navigateur par localhost/projects/test.php, j'obtiens une page vierge.

Hors ligne

#4 Le 14/01/2016, à 01:30

pires57

Re : RESOLU: accès phpmyadmin et moodle impossible

PHP est case sensitive, j'ai corriger mon script, il y avait des majuscule. Peut tu retenter ?
De quel manière as tu installé phpmyadmin? Dépôt officiel ? Site de phpmyadmin?


Utilisateur d'Archlinux, Ubuntu et Kali Linux
Administrateur système et réseau spécialisé Linux.
LinkedIn

Hors ligne

#5 Le 14/01/2016, à 01:49

tomstbe

Re : RESOLU: accès phpmyadmin et moodle impossible

J'ai installé phpmyadmin à partir du dépôt officiel. je peux toujours tenter une réinstallation et te dire ce qu'il se passe au cours de l'installation et après.

Pour le fichier test.php.
Je l'ai modifié, cela n'a rien changé j'obtiens toujours une page vierge.
En regardant un peu je me suis rendu compte que je l'avais créer en tant que "root"

 -rw-r--r-- 1 root  root    20 janv. 14 00:40 test.php 

Je l'ai donc supprimé pour le créer en tant que ribet (mon nom d'utilisateur)

 -rw-rw-r-- 1 ribet ribet   20 janv. 14 00:44 test.php 

la encore ça n'a rien changé

Hors ligne

#6 Le 14/01/2016, à 10:07

J5012

Re : RESOLU: accès phpmyadmin et moodle impossible

peux-tu afficher ici le contenu httpd.conf ?

cat /etc/apache2/httpd.conf

si tu as installé php5 par le depot, tu devrais avoir qqchose du genre :

#LoadModule php5_module modules/libphp5.so

<FilesMatch "\.ph(p[2-6]?|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>

Hors ligne

#7 Le 14/01/2016, à 10:21

tomstbe

Re : RESOLU: accès phpmyadmin et moodle impossible

Bonjour J5012,

je n'ai pas de fichier httpd.conf dans le dossier /etc/apache2/, dont voici le contenu:

  -rw-r--r--   1 root root  7115 janv.  7  2014 apache2.conf
drwxr-xr-x   2 root root  4096 janv. 13 22:43 conf-available/
drwxr-xr-x   2 root root  4096 janv. 13 22:43 conf-enabled/
-rw-r--r--   1 root root  1782 janv.  3  2014 envvars
-rw-r--r--   1 root root 31063 janv.  3  2014 magic
drwxr-xr-x   2 root root 12288 janv. 13 21:03 mods-available/
drwxr-xr-x   2 root root  4096 janv. 13 21:03 mods-enabled/
-rw-r--r--   1 root root   320 janv.  7  2014 ports.conf
drwxr-xr-x   2 root root  4096 janv. 13 21:03 sites-available/
drwxr-xr-x   2 root root  4096 janv. 13 21:03 sites-enabled/

J'ai pourtant bien le paquet php5 d'installer (peut-être faut-il installer un autre paquet ?)

Hors ligne

#8 Le 14/01/2016, à 10:32

pires57

Re : RESOLU: accès phpmyadmin et moodle impossible

Si un simple phpinfo ne s'affiche pas c'est que tu as un problème avec apache.
Que renvoie

tail -n 20 /var/log/apache2/error.log

J5012 te parle du fichier

/etc/apache2/apache2.conf

Dernière modification par pires57 (Le 14/01/2016, à 10:34)


Utilisateur d'Archlinux, Ubuntu et Kali Linux
Administrateur système et réseau spécialisé Linux.
LinkedIn

Hors ligne

#9 Le 14/01/2016, à 15:27

tomstbe

Re : RESOLU: accès phpmyadmin et moodle impossible

Ok,

voici le contenu de mon fichier /etc/apache2/apache2.conf:

  
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#	/etc/apache2/
#	|-- apache2.conf
#	|	`--  ports.conf
#	|-- mods-enabled
#	|	|-- *.load
#	|	`-- *.conf
#	|-- conf-enabled
#	|	`-- *.conf
# 	`-- sites-enabled
#	 	`-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.


# Global configuration
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all denied
</Directory>

<Directory /usr/share>
	AllowOverride None
	Require all granted
</Directory>

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>

#<Directory /srv/>
#	Options Indexes FollowSymLinks
#	AllowOverride None
#	Require all granted
#</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
	Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

et voilà ce que me renvoie la commande tail -n 20 /var/log/apache2/error.log

ribet@ubuntu:~$ tail -n 20 /var/log/apache2/error.log
[Wed Jan 13 22:43:58.104655 2016] [mpm_event:notice] [pid 2038:tid 140152100206464] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Wed Jan 13 22:43:58.108265 2016] [mpm_event:notice] [pid 2038:tid 140152100206464] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Wed Jan 13 22:43:58.108274 2016] [core:notice] [pid 2038:tid 140152100206464] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jan 13 22:43:58.232154 2016] [mpm_event:notice] [pid 2038:tid 140152100206464] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Wed Jan 13 22:43:58.235549 2016] [mpm_event:notice] [pid 2038:tid 140152100206464] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Wed Jan 13 22:43:58.235557 2016] [core:notice] [pid 2038:tid 140152100206464] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jan 13 23:36:48.870418 2016] [mpm_event:notice] [pid 2038:tid 140152100206464] AH00491: caught SIGTERM, shutting down
[Wed Jan 13 23:38:37.502291 2016] [mpm_event:notice] [pid 1741:tid 139876478470016] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Wed Jan 13 23:38:37.530697 2016] [core:notice] [pid 1741:tid 139876478470016] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jan 13 23:41:19.141180 2016] [mpm_event:notice] [pid 1741:tid 139876478470016] AH00491: caught SIGTERM, shutting down
[Thu Jan 14 00:12:47.083150 2016] [mpm_event:notice] [pid 3754:tid 140609597216640] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Thu Jan 14 00:12:47.083234 2016] [core:notice] [pid 3754:tid 140609597216640] AH00094: Command line: '/usr/sbin/apache2'
[Thu Jan 14 01:40:16.429109 2016] [mpm_event:notice] [pid 3754:tid 140609597216640] AH00491: caught SIGTERM, shutting down
[Thu Jan 14 09:12:40.059318 2016] [mpm_event:notice] [pid 1759:tid 139807100757888] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Thu Jan 14 09:12:40.117178 2016] [core:notice] [pid 1759:tid 139807100757888] AH00094: Command line: '/usr/sbin/apache2'
[Thu Jan 14 09:22:54.057477 2016] [mpm_event:notice] [pid 1759:tid 139807100757888] AH00491: caught SIGTERM, shutting down
[Thu Jan 14 14:11:44.343084 2016] [mpm_event:notice] [pid 1847:tid 139930259462016] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Thu Jan 14 14:11:44.367949 2016] [core:notice] [pid 1847:tid 139930259462016] AH00094: Command line: '/usr/sbin/apache2'

Hors ligne

#10 Le 14/01/2016, à 16:21

pires57

Re : RESOLU: accès phpmyadmin et moodle impossible

Tu as suivi un tuto pour l'installation de ton serveur?
Si oui il serait bien de mettre le lien.


Utilisateur d'Archlinux, Ubuntu et Kali Linux
Administrateur système et réseau spécialisé Linux.
LinkedIn

Hors ligne

#11 Le 14/01/2016, à 17:49

tomstbe

Re : RESOLU: accès phpmyadmin et moodle impossible

J'avais suivi le tuto d'installation de moodle (cf mon premier message pour le liens).
En effet en regardant de nouveau le tuto je me suis demandé si il ne manquait pas un paquet à installer, je suis donc aller voir pour l'installation de lamp, qui précise d'installer le paquet "libapache2-mod-php5". Hors ce dernier ne l'était pas (tous les autres oui) !!

Son installation résous mon problème.

Merci à vous 2 pour votre support et votre aide ! smile

Cordialement
Tomstbe

Hors ligne

#12 Le 14/01/2016, à 17:56

pires57

Re : RESOLU: accès phpmyadmin et moodle impossible

Parfait, je me disait bien que le problème n'était ni lié à Moodle ni a PMA.

PS: Édites ton premier post et rajoute [RESOLU] dans le titre

Dernière modification par pires57 (Le 14/01/2016, à 17:57)


Utilisateur d'Archlinux, Ubuntu et Kali Linux
Administrateur système et réseau spécialisé Linux.
LinkedIn

Hors ligne

#13 Le 14/01/2016, à 20:20

J5012

Re : RESOLU: accès phpmyadmin et moodle impossible

non il s'agissait bien de httpd.conf qui est cree lors de l'install du paquet libapache2-mod-php5 , et qui ajoute un include httpd.conf dans apache2.conf au lieu d'y mettre directement un filematch... pourquoi ?
tout simplement que le paquet libapache2-mod-php5 n'est pas fait uniquement pour fonctionner avec apache2 mais aussi avec d'autres serveurs http fast-cgi ...

Hors ligne

#14 Le 15/01/2016, à 12:44

pires57

Re : RESOLU: accès phpmyadmin et moodle impossible

Non J5012.
Le fichier httpd.conf n'est plus utilisé, il était (il y a quelques temps) encore présent pour des raisons historique.

Extrait du fichier apache2.conf :

#Include generic snippets of statements
Include conf.d/

#Include the virtual host configurations:
Include sites-enabled/

Le fichier libapache2-mod-php5 est bien installé :

root@web:/etc/apache2# dpkg-query -l |grep libapache
ii  libapache2-mod-php5                5.4.45-0+deb7u2                amd64        server-side, HTML-embedded scripting language (Apache 2 module)
root@web:/# find -name httpd.conf
root@web:/# 

Dernière modification par pires57 (Le 15/01/2016, à 12:52)


Utilisateur d'Archlinux, Ubuntu et Kali Linux
Administrateur système et réseau spécialisé Linux.
LinkedIn

Hors ligne

#15 Le 16/01/2016, à 01:51

J5012

Re : RESOLU: accès phpmyadmin et moodle impossible

je viens de regarder mon

/etc/apache2/mods-available/php5.conf

et l'instruction filematch y est en effet

mais si je regarde la date de creation de httpd.conf, elle a la meme date que celle de l'install du module apache php5 en version 5.3.10-ubuntu3.4

mon paquet de module apache php5 actuel est 5.3.10-ubuntu3.21

donc entre temps ca a changé ... et je ne m'etais rendu compte de rien ... j'ai donc deux instructions filematch avec des variations dans les options

/etc/apache2/mods-available/php5.conf
...
    <FilesMatch "\.ph(p3?|tml)$">
	SetHandler application/x-httpd-php
    </FilesMatch>
...

et httpd.conf

/etc/apache2/httpd.conf
...
<FilesMatch "\.ph(p[2-6]?|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>

le premier filematch donc actuel reconnait php et php3
le deuxieme inclut php, 2,3,4,5,6

il est vrai que dans la pratique on trouve des scripts php php3 plutot que des php6 ou meme 7 wink

etant donné que mon include httpd.conf arrive apres l'include mods-enabled, je considere que je peux laisser l'instruction filematch surchargée ...

Hors ligne