Pages : 1
#1 Le 30/09/2012, à 10:44
- Jagang
Installation de PHP 5.4.0 avec Plesk
Bonjour
J'ai développé une interface web pour un serveur mais depuis que l'administrateur a fait une mise-à jour de PHP, l'ouverture de la page provoque une erreur 500.
Après investigation, je remarque que l'erreur se produit à la ligne de connexion à la BDD :
try
{
$bdd = new PDO("mysql:dbname=$d_db;host=127.0.0.1;port=3306;charset=UTF-8", $d_db_user, $d_db_password);
}
catch (Exception $e)
{
die('Erreur : ' . $e->getMessage());
}
Déjà, je ne comprends pas pourquoi j'ai une erreur 500 alors que j'ai entouré ma connexion avec un try/catch, mais bon...
L'administrateur utilise Plesk pour la gestion du serveur :
Version de Parallels Plesk Panel 9.5.4
Système d'exploitation Linux 2.6.38.2-xxxx-std-ipv6-64
CPU GenuineIntel, Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz
Je crée donc une page qui m'affiche le phpinfo() : http://serveur.architectika.ch/ArchiControl/phpinfo.php
Je constate donc que nous sommes en version 5.3.3 de PHP.
Mais ce qui me choque le plus, c'est l'option '--disable-pdo' (de même que beaucoup d'autre disable comme JSON ...)
Mon interface se sert de la PDO pour la connexion et de JSON pour l’échange de données en AJAX, ce n'est donc pas étonnant que rien n'aille correctement.
Sachant que l'admin à directement utilisé Plesk pour faire la MAJ, il ne sait pas comment changer les options de PHP.
Donc, après quelques recherches, je tombe sur http://forum.parallels.com/showthread.php?t=259084 pour installer une nouvelle version de PHP avec les options que l'on souhaite.
Je me connecte donc avec Putty sur le serveur et je suis la première étape :
cd /usr/local/src
mkdir php540
cd php540
wget http://www.php.net/get/php-5.4.0.tar.gz/from/at2.php.net/mirror
tar xzvf php-5.4.0.tar.gz
cd php-5.4.0
Jusque là, aucun problème.
Les problèmes surviennent lorsque je lance ceci :
./configure '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/php540-cgi' '--with-config-file-path=/usr/local/php540-cgi/etc' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr/local/php540-cgi' '--with-png-dir=/usr/local/php540-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/php540-cgi' '--with-openssl' '--with-pspell' '--with-pcre-regex' '--with-zlib' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--with-unixODBC=/usr' '--enable-shmop' '--enable-calendar' '--without-sqlite3' '--with-libxml-dir=/usr/local/php540-cgi' '--enable-pcntl' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' '--enable-bcmath' '--with-xmlrpc' '--with-mysql=/usr/bin/mysql' '--with-mysqli' '--with-snmp' '--enable-soap' '--with-xsl' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pear=/usr/local/php540-cgi/pear' '--enable-intl' '--without-pdo-sqlite'
Déjà, pouvez vous me confirmer que les options sont bonnes ?
Ensuite, j'ai eut plusieurs erreur me disant d'installer des chose pour que tout fonctionne. J'ai donc installé, entre autre : openssl-devel, curl-devel, libxml2-devel, gd-devel, gmp-devel, libicu-devel, libmcrypt-devel.
J'ai utilisé la commande yum install openssl-devel pour chacun.
Mais j'ai désormais ce problème lors de la configuration :
...
...
checking for working memcmp... yes
checking for stdarg.h... (cached) yes
checking for mcrypt support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
Je décide donc de faire une recherche Google sur l'erreur et je trouve qu'il faut installer mysql-devel. Pas de souci, je tape yum install mysql-devel
Et là, c'est le drame ! :
[root@serveur php-5.4.0]# yum install mysql-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* atomic: www7.atomicorp.com
* base: mirror.fr.wickedway.nl
* extras: mirror.ovh.net
* rpmforge: archive.cs.uu.nl
* updates: mirror.ovh.net
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package mysql-devel.i386 0:5.5.27-11.el5.art set to be updated
--> Processing Dependency: libmysqlclient.so.18 for package: mysql-devel
---> Package mysql-devel.x86_64 0:5.5.27-11.el5.art set to be updated
--> Running transaction check
---> Package mysql-libs.i386 0:5.5.27-11.el5.art set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
mysql-devel i386 5.5.27-11.el5.art atomic 174 k
mysql-devel x86_64 5.5.27-11.el5.art atomic 174 k
Installing for dependencies:
mysql-libs i386 5.5.27-11.el5.art atomic 1.1 M
Transaction Summary
=====================================================================================================================================================================================================
Install 3 Package(s)
Upgrade 0 Package(s)
Total size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Check Error:
file /etc/my.cnf from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/charsets/cp1251.xml from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.5.27-11.el5.art.i386 conflicts with file from package mysql-5.0.95-1.el5_7.1.x86_64
Error Summary
-------------
Ça ne veux pas l'installer ! J'ai également fait une recherche sur mon ami mais je ne trouve pas des choses très intéressantes.
Pouvez-vous me dire si ma démarche et la bonne, si je devrais faire autre chose et finalement, comment faire pour que mon site fonctionne ?
Un moyen aurait-été de recoder les sites (3 au totales) sans PDO mais je trouve personnellement que ce n'est pas une solution...
Merci d'avance
Cordialement
Jagang
PS: Je ne pense pas que mon serveur soit sous Ubuntu mais je ne sais pas sous quelle distrib il est alors je vous demande quand même.
Hors ligne
Pages : 1