Bonjour à tous,
J’ai loué un nouveau VPS et je souhaite migrer différentes choses depuis un ancien VPS. (Et garder l’ancien pour faire des tests, mais ce n’est pas le sujet.)
Je n’arrive pas à faire fonctionner ce qui utilise PHP ( exemple, Shaarli mais j’ai aussi essayé Owncloud et d’autres trucs), je me retrouve avec une page blanche et des erreurs dans mes logs apache.
Pourtant, j’ai l’impression d’avoir installé ce qu’il faut :
# dpkg -l | egrep "apache|php"
ii apache2 2.4.10-10+deb8u4 amd64 Apache HTTP Server
ii apache2-bin 2.4.10-10+deb8u4 amd64 Apache HTTP Server (modules and other binary files)
ii apache2-data 2.4.10-10+deb8u4 all Apache HTTP Server (common files)
ii apache2-utils 2.4.10-10+deb8u4 amd64 Apache HTTP Server (utility programs for web servers)
ii libapache2-mod-php5 5.6.17+dfsg-0+deb8u1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii php5 5.6.17+dfsg-0+deb8u1 all server-side, HTML-embedded scripting language (metapackage)
ii php5-cli 5.6.17+dfsg-0+deb8u1 amd64 command-line interpreter for the php5 scripting language
ii php5-common 5.6.17+dfsg-0+deb8u1 amd64 Common files for packages built from the php5 source
ii php5-curl 5.6.17+dfsg-0+deb8u1 amd64 CURL module for php5
ii php5-gd 5.6.17+dfsg-0+deb8u1 amd64 GD module for php5
ii php5-json 1.3.6-1 amd64 JSON module for php5
ii php5-mysql 5.6.17+dfsg-0+deb8u1 amd64 MySQL module for php5
ii php5-readline 5.6.17+dfsg-0+deb8u1 amd64 Readline module for php5
ii php5-sqlite 5.6.17+dfsg-0+deb8u1 amd64 SQLite module for php5
# dpkg -l | grep mysql
ii libdbd-mysql-perl 4.028-2+b1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient18:amd64 5.5.47-0+deb8u1 amd64 MySQL database client library
ii mysql-client-5.5 5.5.47-0+deb8u1 amd64 MySQL database client binaries
ii mysql-common 5.5.47-0+deb8u1 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii mysql-server 5.5.47-0+deb8u1 all MySQL database server (metapackage depending on the latest version)
ii mysql-server-5.5 5.5.47-0+deb8u1 amd64 MySQL database server binaries and system database setup
ii mysql-server-core-5.5 5.5.47-0+deb8u1 amd64 MySQL database server binaries
ii php5-mysql 5.6.17+dfsg-0+deb8u1 amd64 MySQL module for php5
Mon serveur apache fonctionne, j’ai bien accès à mon virtualhost (dans /var/www/monvirtualhost/ ). J’ai créé un fichier “test.php”
# cat test.php
<?php phpinfo(); ?>
Ce fichier test.php fonctionne correctement, il affiche tout un tas de choses liées à PHP. Voici par contre un exemple d’erreur quand j’essaye d’accéder au dossier “links” où est mon Shaarli :
# cat /var/log/apache2/error.log
[Wed Mar 23 11:36:43.617940 2016] [:error] [pid 15796] [client 85.234.xxx.yyy:20492] PHP Fatal error: require_once(): Failed opening required 'data/config.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/monvirtualhost/links/index.php on line 150
[Wed Mar 23 11:39:43.568290 2016] [:error] [pid 16158] [client 85.234.xxx.yyy:50365] PHP Fatal error: Uncaught exception 'RainTpl_NotFoundException' with message 'Template linklist not found!' in /var/www/monvirtualhost/links/inc/rain.tpl.class.php:268\nStack trace:\n#0 /var/www/monvirtualhost/links/inc/rain.tpl.class.php(164): RainTPL->check_template('linklist')\n#1 /var/www/monvirtualhost/links/index.php(645): RainTPL->draw('linklist')\n#2 /var/www/monvirtualhost/links/index.php(1085): pageBuilder->renderPage('linklist')\n#3 /var/www/monvirtualhost/links/index.php(1381): showLinkList(Object(pageBuilder), Object(LinkDB))\n#4 /var/www/monvirtualhost/links/index.php(2591): renderPage()\n#5 {main}\n thrown in /var/www/monvirtualhost/links/inc/rain.tpl.class.php on line 268
Je précise que Shaarli (la même installation!), fonctionne bien sur mon autre serveur. Donc -pour moi-, le problème vient de la configuration d’Apache. Voici la configuration de mon virtualhost :
# cat sites-enabled/monsite.be.conf
<VirtualHost *:80>
ServerName www.monsite.be
#ServerAdmin webmaster@localhost
DocumentRoot /var/www/monvirtualhost/
<Directory /var/www/monvirtualhost/>
Options Indexes MultiViews
AllowOverride all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#Désactive l'affichage de la version d'apache
ServerSignature Off
</VirtualHost>
Y aurait-il quelque chose à changer dans /etc/apache2/apache2.conf ?
Merci d’avance,