Gallery 2 on free.fr! Yes, it works!!
August 16th, 2006
colorfulGallery is no doubt the most popular free web-based photos management system. With powerful features, it’s naturally a good choice for amateurs (like me) who want to publish online galleries. The only thing that prevent me from using Gallery at the first time is that it does not support PHP hosts with safe-mode ON, and free.fr is one of them. A quick search on Google prouves that I’m not the only one who is concerned about the problem, there has been several serious discussions on the official forum of Gallery and globally the solutions are:
- Contact your host to turn off safe-mode
- Change your host
Personnally, I find those answers ignorant. Guys, it’s not that simple!! Like I’ve said, there are amateurs who want to use Gallery, and for them, finding a host which is suitable for their home page is challenging! Moreover, do you think they will migrate everything (files, blogs, forum) to a new host just to use Gallery, especially if their current host proposes a 10 GB space and totally free (free.fr does propose it)? Ask your host to turn off safe-mode is even more desperate!!
Here, I will explain what I’ve done to install and use Gallery 2 on free.fr. But before everything, please note that I’m a fresh beginner to PHP, I’m not sure what I’ve done is correct and whether it will work on other host than free.fr but it really works, you can visit my gallery here.
Step 1 : Download Gallery 2 from its official website http://gallery.menalto.com/. The version I’m using is the 2.1.1. Extract it.
Step2 : First of all, you have to make it installable. Normaly, the installation process will stop when it finds that safe-mode is ON at the System Checking Step. To pass this step, edit file gallery2/install/steps/SystemChecksStep.class and change the lines 108-120 from
/* Make sure that safe mode is not enabled */
if (GalleryUtilities::getPhpIniBool('safe_mode')) {
$templateData['check'][] =
array('title' => _('Safe mode disabled'),
'error' => true,
'notice' =>
_('Error: Your version of PHP is configured with safe mode enabled. ' .
'You must disable safe mode before Gallery will run.'));
$failCount++;
} else {
$templateData['check'][] =
array('title' => _('Safe Mode'), 'success' => true);
}
to
/* Make sure that safe mode is not enabled */
$templateData['check'][] = array('title' => _('Safe Mode'), 'success' => true);
freshStep 3 : With safe-mode ON, calls to PHP fucntion set_time_limit always generate errors. Usually, you can ignore those warnings (although they’ll ruin your pages with ugly messages), but in some scripts, those errors can stop the execution so we need to avoid those situations. If you have time, replace all calls to set_time_limit with @set_time_limit (use an editing tool or unix/linux scripts). If you don’t have time, at least replace set_time_limit with @set_time_limit in file gallery2/modules/core/classes/Gallery.class (I didn’t have time :p).
Step 4 : Create a directory for applications to store sessions on host, Gallery needs it. Use phpinfo() to know where to create it (session.save_path). On free.fr, the directory’s called sessions and it’s in your root directory. Create it if it’s not already there.
Step 5 : Up load our modified Gallery 2 and run the installation process as described in the documentation, on the System Checking Step, you’ll see a warnings about files’ intergrity. It’s normal as we’ve modified some files! Ignore warnings concerning set_time_limit.
Step 6 : Normally, you can easilly finish the installation process. There’re some modules which are not activated as they can not auto-configured (ImageMagick, Archive Upload …), but it’s another problem. Your gallery is now ready to be used.
Warning : The documentation says that Gallery could run without set_timeout_limit function, but data’s intergrity is no more warantied!! There are some errors when I try to delete an Album, but the album is effectively deleted.
Conclusion
I’m now using Gallery normally, but I need more time to test all of its features. This is just a work-around for those who desperately want to use gallery 2 on their current host and it’s not a serious solution. I really hope that there will be a version, or a patch that lets Gallery runs with safe-mode ON.
Note : Pictures used in this post aren’t mine, they were taken from Flickr, their originals can be found here and here and are subjected to licences.
92 Responses to “Gallery 2 on free.fr! Yes, it works!!”
Leave a Reply
Name (required)
Mail (will not be published) (required)
Website
August 18th, 2006 at 1:21 am
Je confirme ça fonctionne très bien en suivant votre mode d’emploi.
Je vais utiliser Gallery2 pour améliorer B&W PhotoChallenge, dans les six mois.
Il faut que l’apprivoise et arrange un templete à ma sauce.
Puis je dois trouver, si il est possible de soumettre une photo dans un album, sans être membre inscrit sur mon site. Ainsi, je garderais l’esprit libre de l’actuel.
En tout cas, un grand merci à vous, c’est un grand pas de franchi.
J’avais pourtant fait une croix sur ce soft, suite à un échange plus ou moins houleux avec un des développeurs qui restait sur ces positions.
Et ne savait que dire « changez d’hébergeur »
Si jamais vous faites des photos en noir et blanc, je serais heureux de vous accueillir sur B&W PhotoChallenge.
http://namastebysc.free.fr/challenge/
Cordialement
Namaste
August 19th, 2006 at 9:29 am
J’ai réussi à installer gallery2 chez Free avec les modifications proposées.
Cependant je n’arrive pas à faire fonctionner l’applet d’upload ou gallery remote. Je ne sais pas si c’est à cause du safe mode, ou bien une erreur de paramétrage de ma part.
Avez-vous réussi à faire marcher le module uploadapplet ou Gallery Remote ?
Merci !
August 19th, 2006 at 1:47 pm
Bonjour,
Hélas non, j’ai essayé plusieurs clients pour gallery, mais il n’y a aucun qui marche. En fait, je peux me connecter, récupérer les albums & photos, gérer mes albums, mais j’arrive pas à uploader mes photos en utilisant ces clients. Je croix bien que c’est à cause du paramétrage chez free (dont le safe mode). Pour l’instant, j’utilise FTP pour uploader mes photos et ca me suffit. Mais c’est vrai que Gallery Remote est idéal pour ces opérations. Je vais réessayer et vous informer si je trouve qqc.
August 21st, 2006 at 4:39 pm
Bonjour,
Je n’ai pas essayé gallery remote.
Mais, pour ma part, l’applet de téléchargement (upload en masse ou un dossier entier) et l’applet “depuis le navigateur web” (upload une photo après l’autre) marchent très bien sur free. Dans les 2 cas, je peux sélectionner les images sur mon disque dur et les envoyer dans l’album voulu sur Gallery2.
C’est surprenant! Il est vrai que j’ai commencé par effectuer des réglages soit comme dans:
-L’album (taille, quotas…)
-Droits utilisateur.
-Options d’administrations.
-Les modules qui font parfois interférences entre eux sur Free.
C’est un outil assez complexe.
Je vous laisse accès à l’Admin. Si vous souhaitez examiner les réglages. Je l’ai installé pour le tester et le supprimerait vers le 15 Septembre 2006.
http://namastebysc.free.fr/challenge/
Nom utilisateur: Admin .
Pass:stephane
August 21st, 2006 at 4:40 pm
La bonne adresse est:
http://namastebysc.free.fr/challenge/gallery2/
August 21st, 2006 at 10:16 pm
Bonjour,
C’est une bonne nouvelle si l’applet d’upload fonctionne. Merci pour le lien de test, je l’ai visité et y appris plein de modules intéressantes. Félicitation.
August 29th, 2006 at 3:44 pm
J’ai pas pu résister à la séduction de laisser un commentaire ici . c’est magnifique! Je reviendrai bientot.
August 29th, 2006 at 10:30 pm
Grâce à vos instructions, j’ai enfin pu utiliser gallery sur free. Encore quelques soucis divers et variés et notamment pour télécharger massivement des photos en remote: les photos arrivent bien mais ne sont pas référencées dans l’album donc celui-ci est vide. J’utilise alors l’import en référençant une URL sur l’hôte. Pas très efficace mais bon c’est super. Un grand MERCI !!!
August 31st, 2006 at 1:28 pm
Salut,
je viens d installer ma gallery2.1.2 sur free.fr comme tu l as dit et ca a marché nikel jusqu’à ce que j essaie de me connecter dedans. Je rentre mon pseudo et mon mot de passe et voilà l erruer qui en resulte:
Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /mnt/136/sdb/4/1/…/gallery2/modules/core/classes/Gallery.class on line 629
Warning: Cannot modify header information - headers already sent by (output started at /mnt/136/sdb/4/1/…/gallery2/modules/core/classes/Gallery.class:629) in /mnt/136/sdb/4/1/…/gallery2/modules/core/classes/GalleryPhpVm.class on line 124
Si tu as une idée de ce qui cloche… merci d’avance
September 1st, 2006 at 12:44 am
Hello,
Peut-être faut-il refaire l’étape 3.
Pour ma part, les photos sont correctement uploadées mais les vignettes ne peuvent pas être construites: il manque ImageMagik.
Est-il possible de les créer à la main et les télécharger ensuite ?
Merci
September 1st, 2006 at 1:42 am
@Roulie :
Matthieu a raison, il faut refaire l’étape 3, t’as du manquer un set_time_limit (ligne 629 du fichier gallery2/modules/core/classes/Gallery.class)
@Matthieu:
Je n’ai jamais réussi à uploader les images avec l’interface web. J’importe les images déjà uploadés par FTP et ça fontionne bien, les vignettes (thumbnail??) sont bien construites sans ImageMagik
September 2nd, 2006 at 1:16 am
Finalement, j’ai réussi construire les “thumbnails” (=vignettes ;) ): Il faut activer au moins un module de type “Boîtes à outils graphiques”; GD, par exemple.
Aucun souvenir d’opération particulière à effectuer pour faire fonctionner l’uploadage par l’interface web.
September 3rd, 2006 at 8:17 pm
Salut, j’ai suivi le tuto, j’ai bien rajouté les @ devant les set_time_limit du fichier SystemChecksSteps ce qui evite bien l’affichage de l’erreur produite par ces fonctions.
Mais leproblème se semble pas être résolu pour autant puisque la barre de progression de l’étape 2 reste tout de même bloquée à la moitié environs…
Je ne comprend pas ce qui cloche vous n’avez réellement fait que rajouter des @ ?!
September 4th, 2006 at 12:18 am
En effet, c’est tous ceux que nous avons fait :). Le script est bloqué à quel test? J’aurais tendance de dire que c’était à cause du serveur free à cette instance là (mémoire …). Re-essaie encore une fois.
September 4th, 2006 at 11:06 pm
well i dont know if your server have proper safe mode, because in case of safemode script CAN’t create subdirs in data directory, so how you fix this issue? i cant figure it out, because owner of the directories is ftpuser, but script have webserver or nobody privileges
September 4th, 2006 at 11:08 pm
by the way i tried your manual, works fine (with some modifications, but in step 4 have to be created dir structure (if i skip it im ending at step 8)
September 5th, 2006 at 12:54 am
@kriznik
I didn’t test but it seems to me that the configuration of our host (free.fr) let our scripts be executed under our own priviledges, the same thing happens to our ftp accounts. So the only limit of SAFE_MODE on free.fr is the set_time_limit.
As I’ve noticed in my manual, the workaround may not work on other hosts :(. I fault Gallery 2 for not providing a version that supports SAFE_MODE on, or at least a version in which images are stored in the database, so we can get rid of priviledge problems.
September 5th, 2006 at 11:36 pm
hi there!
J’ai essayer sur le site proposé par namase mais l’upload massif via Gallery Remote ne fonctionne pas, j’obtiens une erreur: Erreur pendant l’envoi : Upload failed: ‘. j’aurais aimé savoir si quelqu’un à la meme erreur…et surtout quel est le remede ;) BTW, à par gallery et coppermine, y aurait-il une galerie qui permet l’upload massif des photos autres que par un ftp?
Merci
++++
CU
September 5th, 2006 at 11:53 pm
@tanhnhi
agree… you are lucky that your host allowing create/delete files/dirs via script, normal safe mode disallowing this
i hope that they will do some patch to this issue soon, because there’s no host with safe mode off instead of private server or server housing
September 9th, 2006 at 11:27 am
Bonjour,
Y’a t’il quelqu’un qui pourrais expliquer plus en detail le step 4?
desolé si cette question peut paraitre bete, mais je voudrais etre sur de realiser tous comme il faut bien.
Merci
September 9th, 2006 at 4:31 pm
@babas
Vérifie avec FTP si tu as déjà le répertoire “sessions” à la racine de FTP. S’il n’y est pas, crée le.
September 10th, 2006 at 4:49 pm
Bonjour, a tous
Déja un grand merci pour les differentes infos avec lequelle j’ai réussi a installer gallery.
Par contre je n’arrive pas a publier mes images.
A premiere vue le transfert se passe bien, mais je n’ai jamais de
vignettes.
idem par ftp.
Quelqu’un a t il reussi a mettre en ligne des photos
merci de me repondre
September 10th, 2006 at 4:53 pm
Salut Geoffrey,
Matthieu a rencontré le même problème. En fait, il faut activer le module GD de Gallery pour qu’il génère les vignettes.
September 11th, 2006 at 10:42 am
Bonjour a tous,
Comment faire pour activer les Modules :
DCRaw, FFMPEG, ImageMagick et NetPBM
je ne trouve pas les binaires pour install sur serveur free.fr
quelqu’un qui les aurait deja installer pourrais m’aider ?
merci
Coolman
September 12th, 2006 at 12:39 am
Merci tanhnhi
Mais module GD est deja configuré
enfaite il s’est configuré tout seule lors de l’installation.
Si qq a une autre idée MErci d’avance
September 12th, 2006 at 7:11 am
@Geoffrey
J’ai le meme probleme sur Infomaniaks, mais je crois que je sais pourquoi. Il me semblerait que le caching des thumbnails soit la vrai cause du soucis. Une fois mes photos envoyer, je peux voir les thumbnails une fois (une seul) et apres, plus rien.
Si quelqu’un a une solution, ce serait tres aprecie.
September 14th, 2006 at 12:05 pm
Chez moi rien ne s’uploade ni avec Applet, Ni avec Xp, ni avec Remote
Si un topic est ouvert qq part à ce sujet j’veux bien
Bises
September 25th, 2006 at 6:56 pm
C’est la deuxieme fois que mon site plante avec ce message (10 jour de fonctionnement):
“Fatal error: file_exists() [function.file-exists]: Unable to access / in /mnt/103/sdd/3/a/m.ly/spip191/gallery2/modules/core/classes/GalleryPlatform.class on line 156″
Lorsque j’ai eu ce pb la premiere fois j’ai tous simplement reinstaller le site avec la proc decrite ci dessus.
Une idee pour retrouver mon site!!!!
:)
September 26th, 2006 at 12:29 pm
@mamly : Je ne crois pas que l’erreur vient de l’installation. Essaie FTP pour uploader tes images?
N’oublie pas que la taille des fichiers uploadés via HTTP est limité à 2MB avec free.fr, il est donc préferable qu’on utilise FTP pour uploader les gros fichiers puis les importer avec gallery 2 (ca marche toujours pour moi).
September 26th, 2006 at 1:19 pm
Merci de tes lumieres. C’est vrai je faisais le upload via http, mais il se trouve que mes fichiers ne sont gros, le gros fait 1557ko. Je ne sais pas d’ou cela pourrait venir.
September 26th, 2006 at 7:47 pm
Merci tanhnhi mais comment a tu fais pour les importer apres l’upload en FTP.
Et comment fais tu pour recrée les vignettes.
September 30th, 2006 at 5:54 pm
Tu peux voir ici http://codex.gallery2.org/index.php/Gallery2:How_to_Add_Items#How_to_Add_Items_from_the_Local_Server pour upload via FTP.
Pour regénérer les vignettes :
- Vérifier que le module GD est activé
- Choisir l’album que tu veut recreér les vignettes (en tant que admin)
- Cliquer Edit Album -> l’onglet Album -> crocher recreate thumbnails dans la partie “Recreate thumbnails and resizes” -> Save
October 1st, 2006 at 3:19 pm
salut à tous
Un grand merci tout d’abord pour ce thread excellent, Gallery marche à merveille sur mes comptes free.
Seul problème : les thumbnails. Quand je définis la taille maxi des thumbnails (à 100) j’ai cette erreur
Fatal error: Call to undefined function: getmimetype() in /mnt/101/free.fr/3/3/porq/wp-content/plugins/gallery2/modules/core/ItemEditItem.inc on line 161
J’ai essayé de réuploader quelques rep au cas où il manqueraut un tpl ou un .php mais ça ne change rien.
Pour info j’ai installé tousles modules requis pour les thumbnails.
Merci d’avance
Y
October 7th, 2006 at 4:45 am
Where did the picture of the orange come from? I’d love to get that full sized.
October 7th, 2006 at 11:12 am
Bonjour a tous,
Comment faire pour activer les Modules :
DCRaw, FFMPEG, ImageMagick et NetPBM
je ne trouve pas les binaires pour install sur serveur free.fr
quelqu’un qui les aurait deja installer pourrais m’aider ?
merci
October 7th, 2006 at 2:05 pm
@Harwick
The picture was taken from Flickr. Search for tags like “fresh” or “splash” and you’ll see plenty of them. BTW, here’s the picture on Flickr. I should have mentionned this in my post.
@babas
Je ne crois pas qu’on puisse activer ces modules sur free.fr, car il faut installer les binaires en dehors d’Apache/PHP, ce qui est normalement impossible.
October 7th, 2006 at 8:30 pm
Pour répondre à ma question : ça a marché en résintallant les différents plugins photo plusieurs fois…
A+
October 15th, 2006 at 3:32 pm
Re…
En fait j’ai toujours le problème suivant (sous free):
Quand je régénère des vignettes elles ne s’affichent pas toujours dans les albums.
Quand je resize les photos, elles ne s’affichent jamais, par conter la photo en taille originale est uploadée et reste accessible.
Quelqu’un sait quel est le module qui gère le resize et comment le réinstaller ?
Merci bcp
October 16th, 2006 at 10:46 pm
Salut
J’aimerai savoir comment Leo a réglé son problème.
J’ai exactement la même chose.
J’ai bien rajouté les @ devant les set_time_limit du fichier SystemChecksSteps ce qui evite bien l’affichage de l’erreur produite par ces fonctions.
Mais la barre de progression de l’étape 2 reste tout de même bloquée aux 2/3.
Comment savoir à quel vérification il s’arrête ?
Merci
October 26th, 2006 at 11:19 pm
Demat,
lors de l’utilisation de gallery sur free.fr, j’obtiens plein de messages d’erreurs du type : “Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 14999 bytes) in /mnt/134/sdc/0/0/…/gallery/lib/smarty/Smarty_Compiler.class.php on line 1249″
comment on peut régler cela ? quels sont les modules minimum à mettre, cela permet il de réduire la consommation ?
y a t il un hébergeur gratuit qui permet d’avoir une memory_limit d’au moins 16 Mo ?
Merci
October 27th, 2006 at 11:04 pm
super pour ces infos :o
Top pour l’astuce….felicitation :lol:
@@++
October 31st, 2006 at 11:33 am
Hi,
I am trying to do it how you tell it, but I get a error with “Set Lang” error. Is it possible to install local, and then upload it to your webserver.
November 3rd, 2006 at 1:17 am
Merci beaucoup pour cette aide précieuse
November 3rd, 2006 at 9:44 pm
Bonjour,
mon probleme c’est que je n’arrive pas a uploader des filigranes ( watermark )…
Error Detail -
Error (ERROR_PLATFORM_FAILURE)
in modules/watermark/classes/WatermarkImage.class at line 287 (gallerycoreapi::error)
in modules/watermark/WatermarkSiteAdmin.inc at line 75 (watermarkimage::create)
in main.php at line 199 (watermarksiteadmincontroller::handlerequest)
in main.php at line 87
in main.php at line 80
November 5th, 2006 at 8:08 pm
pour ceux qui bloquent au bout d’un moment, je pense qu’il faut juste relancer la procédure (plusieurs fois ?).
Je bloquais environs à 75% et en relançant c’est passé.
November 6th, 2006 at 12:26 am
mais le probleme mois je ne voit aucan rapport d’etat de transfer je tombe direct sur ce genre d’erreur
Platform Error
An error has occurred while interacting with the platform.
The exact nature of the platform error is unknown. A common cause are insufficient file system permissions. This can happen if you or your webhost changed something in the file system, e.g. by restoring data from a backup.
Back to the Gallery
Error Detail -
Error (ERROR_PLATFORM_FAILURE)
in modules/watermark/classes/WatermarkImage.class at line 287 (gallerycoreapi::error)
in modules/watermark/WatermarkSiteAdmin.inc at line 75 (watermarkimage::create)
in main.php at line 199 (watermarksiteadmincontroller::handlerequest)
in main.php at line 87
in main.php at line 80
System Information
Gallery version 2.1.2
PHP version 4.4.3-dev cgi-fcgi
Webserver Apache/ProXad [Oct 16 2006 22:55:13]
Database mysql 5.0.25-nightly-20060823
Toolkits Gd
Operating system Linux dyn40-g5.priv.free.fr
Browser Mozilla/5.0 (Macintosh; U; PPC Mac OS X; fr) AppleWebKit/418.9 (KHTML, like Gecko) Safari/419.3
je precise pas de parefeux ni de anti virus … le probleme je ne sais pas du vient ce probleme !!!
November 6th, 2006 at 12:43 am
j’oubliais de dire que sur local marche tres bien
le probleme vient seulement sur le serveur de free
en plus c’est bizarre vous arrivais et pas moi
en tous cas je vais demander a quelq’un que fasse un petit test sur la platefforme pc on sais jamais
mais cela c’est fort probable car en local pas de probleme mais …
November 18th, 2006 at 7:08 pm
Bonjour
je suivi tout les infos de site (super) et ca marche la gallery2 fonctionne enfin pres que je fais des surf ou rajouts de photos ca plante avec le message suivant
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 58368 bytes) in /html/modules/gallery2/modules/core/ItemEditPhotoThumbnail.inc on line 262
enfaite ca arrive souvant et pas forcment le meme script
je bien vu que dans le README
GD - cannot do image rotation, may hit server memory limits and crash PHP.
est ce que tu as trouve un moyen d’activer l’un des ces logiciel NetPBM, ImageMagick, GraphicsMagick
Merci
November 18th, 2006 at 7:09 pm
je me suis planter dans l’@ de mon site http://gaslive.free.fr
Merci
November 19th, 2006 at 10:54 pm
Are you able to use iphoto to gallery2 export plug in ? I can’t get it to work with Free.fr. Same thing with Gallery 2 Remote application. Upload failure all the time. Remote module is activated. Did I miss something ? Has any one the same problem ?
November 22nd, 2006 at 8:21 pm
pour ce que cherche a installer gallery2 chez free J’ai fais un petit tuterial sur mon site dans reviews
Ca marche tres bien j’ai meme cree le block scrollImage ;-)
November 26th, 2006 at 11:51 am
Thank you very much
December 12th, 2006 at 1:48 am
bonjour
pour codfisch
apres installe standard du module par free je rencontre le meme probleme; aucune reponse sur le web alors je plonge dans le code.
le probleme provient de la fonction $platform->copy qui est testée en erreur et pourtant la copie s’effectue correctement dans le repertoire de la gallerie.Je ne suis pas expert et pour que cela fonctionne voici le workarround. Aux specialistes de faire la correction.
fichier gallery2/modules/watermark/classes/watermarkimage.class
vers la ligne 287
____________________________________________________
$newFileName = $dir . $targetFilename;
/** modif pour free.fr
*/
$platform->copy($inputFileName, $newFileName);
/**
* if (!$platform->copy($inputFileName, $newFileName)) {
* return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__);
* }
*/
$this->setSize($platform->filesize($newFileName));
___________________________________________________
en francais les lignes de copie avec test sont mises en commentaire. Je rajoute la copie idem mais sans tester si cela fonctionne
si ca peux aider
January 4th, 2007 at 6:14 pm
The problem is that free forbids some functions which will give error : http://www1.assistancefree.fr/v1/faq/?forfait=axl&rac=354/348
So in for the version 2.1.2 in /gallery2/modules/core/classes/GalleryPlatform.class
make the chmod and rmdir function always return true :
function rmdir($filename) {
global $gallery;
if ($gallery->getDebug()) {
$gallery->debug(”rmdir($filename)”);
}
/*
return rmdir($filename);
*/
return true;
}
function rmdir($filename) {
global $gallery;
if ($gallery->getDebug()) {
$gallery->debug(”rmdir($filename)”);
}
/*
return rmdir($filename);
*/
return true;
}
And correct the tempnam function as followed because the one provided by free.fr is buggy :
function tempnam($dir, $prefix) {
global $gallery;
if ($gallery->getDebug()) {
$gallery->debug(”tempnam($dir, $prefix)”);
}
//return tempnam($dir, $prefix);
$slash = $this->getDirectorySeparator();
do {
$my_random_id = $dir;
if (substr($my_random_id, -1) != ‘/’) $my_random_id .= ‘/’;
$my_random_id .= uniqid($prefix);
} while (file_exists($my_random_id));
if (!($fd = $this->fopen($my_random_id, ‘wb’))) {
return false;
}
$this->fclose($fd);
return $my_random_id;
}
Gallery Remote will then work, and the “ZIP cart download” hack too (see http://gallery.menalto.com/node/41670)
Guillaume
January 9th, 2007 at 7:28 pm
We speak french or english here ? :P
It seems that it not works with a postgresql database configured on a Free account : G2 crash at step 8 with a log file containing “postgres7 error” (…) “CONNECT(sql.free.fr, ?, ?, myusername)”
I don’t understand why there is twice “?” whereas it should be twice “myusername”, considering “?” is the password (database name & user are same)… if you have an idea to resolve or “force” the db connexion ?!
(A Dotclear2b4 works fine on the same Free account, so the database is ok)
January 13th, 2007 at 2:22 pm
Another modification is needed on free.fr:
Line 255 of /gallery2/modules/cores/GalleryTemplate.class
before:
$templateVersionFile = $dir . ‘/v_’ . TEMPLATE_DATA_VERSION;
if (!$platform->file_exists($dir)) {
list ($success) = GalleryUtilities::guaranteeDirExists($dir);
if (!$success) {
return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__,
“Unable to mkdir($dir)”);
}
after
$templateVersionFile = $dir . ‘/v_’ . TEMPLATE_DATA_VERSION;
// if (!$platform->file_exists($dir)) { // modification for free.fr
if (!$platform->file_exists($templateVersionFile)) {
if (!$platform->file_exists($dir)) { // modification for free.fr
list ($success) = GalleryUtilities::guaranteeDirExists($dir);
if (!$success) {
return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__,
“Unable to mkdir($dir)”);
}
}
Otherwise you’ll get a recursive problem when asking Gallery2 to delete its temporary files.
Guillaume
January 14th, 2007 at 8:47 pm
Same problem as Guillaume Z. in Postgr
January 15th, 2007 at 10:04 am
Sorry, I wanted to say: same problem than Zorg.
For Guillaume Z.:the file is in gallery2\modules\core\classes
I tried to copy and paste your code but I ‘ve got an error on the file when I launch the gallery. Is it the code that must be paste you typed here ?
January 15th, 2007 at 10:39 am
Sorry to flood, mais est-ce que quelqu’un a réussi à faire fonctionner la fonction envoi d’email sous Free ?
January 15th, 2007 at 6:25 pm
@Li-An : il y a un problème en ce moment avec la fonction mail (cf forums ?.proxad.pagesperso.?)
January 19th, 2007 at 5:46 pm
Je me demandais si quelqu’un avait reussi à faire fonctionner le module de telechargement d’une archive ZIP sous free et si oui comment il a fait ? j’ai essayer avec un mod utilisant php ZipLib mais le fichier ne se télécharge pas (bien qu’il soit crée à la racine du compte ftp).
January 23rd, 2007 at 10:37 pm
ArCamiNo, as-tu fait les modifs suggerees par Guillaume Z. Chez moi c’est tombe en marche avec.
January 24th, 2007 at 8:19 pm
This is great, thanks for all tips here. After all the modifications, including Guillaume’s, I still wasn’t able to upload images with galleryadd.pl (which is a great tool if you want to upload and you only have a terminal, and it uses the same protocol as the remote gallery).Thanks to delta94 comments on watermarks and a little bit of additional debugging, I have fixed the problem by disabling a copy copy check (this seems to be a global problem?). So if some of you are still desperately trying, here are my modification (in modules/core/classes/GalleryDataItem.class)
if ($symlink) {
if (!$platform->isSymlinkSupported()) {
return GalleryCoreApi::error(ERROR_UNSUPPORTED_OPERATION, __FILE__, __LINE__);
}
if (!$platform->symlink($inputFileName, $newFileName)) {
return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__);
}
} else {
/* Copy the file to its new location */
$platform->copy($inputFileName, $newFileName); // Just removed the check below
// if (!$platform->copy($inputFileName, $newFileName)) {
// return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__);
// }
}
January 28th, 2007 at 7:34 pm
@Li-An : For my first message, you shouldn’t copy paste the given code in the file but you must replace rmdir (line 529), chmod (line 1141) and tempnam (line 134) with the examples I gave. Be aware that I did a mistake on chmod function (I copy paste twice the rmdir function). chmod should be replaced by:
function chmod($path, $mode=null) {
/*
if (!isset($mode)) {
if (!isset($this->_filePerms) || !isset($this->_dirPerms)) {
$this->_loadPermissionPreferences();
}
$mode = $this->is_dir($path) ? $this->_dirPerms : $this->_filePerms;
}
return chmod($path, $mode);
*/
return true;
}
My second message gives the exact line of the function to replace.
I found a problem too in function _initCompiledTemplateDir line 245 of /gallery2/modules/cores/
GalleryTemplate.class
Replace:
if (!$platform->file_exists($dir)) {
list ($success) = GalleryUtilities::guaranteeDirExists($dir);
if (!$success) {
return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__,
“Unable to mkdir($dir)”);
}
if ($fd = $platform->fopen($templateVersionFile, ‘w’)) {
$platform->fclose($fd);
} else {
return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__,
sprintf(’Unable to write to %s’, $templateVersionFile));
}
} else {
by:
// if (!$platform->file_exists($dir)) { // modification for free.fr
if (!$platform->file_exists($templateVersionFile)) {
if (!$platform->file_exists($dir)) { // modification for free.fr
list ($success) = GalleryUtilities::guaranteeDirExists($dir);
if (!$success) {
return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__, “Unable to mkdir($dir)”);
}
}
if ($fd = $platform->fopen($templateVersionFile, ‘w’)) {
$platform->fclose($fd);
} else {
return GalleryCoreApi::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__,
sprintf(’Unable to write to %s’, $templateVersionFile));
}
} else {
Guillaume
February 3rd, 2007 at 11:49 am
You’re my new god ! thanks so much for this tip, now i have Gallery 2 working very fine (at least for now) on my site ! Thank you so much !
February 8th, 2007 at 12:59 pm
Est-ce que gentiment quelqu’un pourrait mettre à disposition l’ensemble des fichiers modifiés afin que gallery fonctionne sur free.fr (y compris l’applet d’upload). Ce serait super sympa, merci d’avance !
José
February 9th, 2007 at 11:50 am
Ok, I will maintain a ZIP file with all modifications (from Gyuri an me) for the upload applet. It includes the working hacked ZIP cart.
Download it here : http://adelineguillaume.free.fr/gallery2.1.2-free.fr-mod.zip
I didn’t check it, feel free to ask if you see that I forgot something.
Guillaume
February 9th, 2007 at 3:24 pm
Thank you :)
but I suppose where is a problem in the zip file because all files are from the path gallery2\modules\zipcart ???
February 11th, 2007 at 11:51 am
Don’t you find 3 files in gallery2/modules/core/classes ?
Guillaume
February 12th, 2007 at 10:21 am
Hi,
I have follwed steps 1-6 above with Gallery 2.1.2.
When running the instalation I can’t get Step 2 (System Checks) because my session isn’t sticking.
Instead I get bounced back to “Authenticate” again.
The interesting points to note:
I get the following error messages:
Warning: putenv(): Safe Mode warning: Cannot set environment variable ‘LANG’ - it’s not in the allowed list in /home/southrivhockey/www/gallery/modules/core/classes/GalleryTranslator.class on line 299
Warning: putenv(): Safe Mode warning: Cannot set environment variable ‘LANGUAGE’ - it’s not in the allowed list in /home/southrivhockey/www/gallery/modules/core/classes/GalleryTranslator.class on line 300
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/southrivhockey/www/gallery/modules/core/classes/GalleryTranslator.class:299) in /home/southrivhockey/www/gallery/install/index.php on line 404
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/southrivhockey/www/gallery/modules/core/classes/GalleryTranslator.class:299) in /home/southrivhockey/www/gallery/install/index.php on line 404
I can see the session in my session folder:
cat /home/southrivhockey/sessions/sess_4bc30f06e90e61b016085ce8c8be5f4d
install_path|s:50:”/home/southrivhockey/www/gallery/install/index.php”;language|s:5:”en_US”;install_steps|s:1663:”a:12:{i:0;O:11:”welcomestep”:4:{s:11:”_stepNumber”;i:0;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;}i:1;O:16:”authenticatestep”:6:{s:11:”_stepNumber”;i:1;s:11:”_isComplete”;b:1;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;s:10:”_uniqueKey”;s:32:”8232d946d54b730c3eba8e25bdbc235f”;s:10:”_firstTime”;b:0;}i:2;O:16:”systemchecksstep”:4:{s:11:”_stepNumber”;i:2;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;}i:3;O:13:”multisitestep”:6:{s:11:”_stepNumber”;i:3;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;s:12:”_isMultisite”;N;s:11:”_configPath”;N;}i:4;O:16:”storagesetupstep”:4:{s:11:”_stepNumber”;i:4;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;}i:5;O:17:”databasesetupstep”:4:{s:11:”_stepNumber”;i:5;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;}i:6;O:18:”adminusersetupstep”:5:{s:11:”_stepNumber”;i:6;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;s:20:”_hasBeenLoadedBefore”;N;}i:7;O:20:”createconfigfilestep”:5:{s:11:”_stepNumber”;i:7;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;s:10:”_firstTime”;b:1;}i:8;O:21:”installcoremodulestep”:4:{s:11:”_stepNumber”;i:8;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;}i:9;O:23:”installothermodulesstep”:4:{s:11:”_stepNumber”;i:9;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;}i:10;O:10:”securestep”:4:{s:11:”_stepNumber”;i:10;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:0;}i:11;O:12:”finishedstep”:4:{s:11:”_stepNumber”;i:11;s:11:”_isComplete”;b:0;s:10:”_isInError”;b:0;s:11:”_isLastStep”;b:1;}}”;
Any ideas?
February 24th, 2007 at 1:08 pm
Thank you very much to Guillaume Z for his hack! Zip download and Remote Gallery upload work perfectly now ;-)
Carl
February 25th, 2007 at 12:34 am
hay my name fafi
February 25th, 2007 at 6:43 pm
J’ai installé Gallery2 et le Zip de GuillaumeZ. L’install c’est très bien passé, malheureusement l’upload d’image et impossible, j’ai un message d’erreur dont la premiere ligne est:
Error (ERROR_BAD_PASRAMETER) : Missing class: GdToolkit Si qql qu’un a une idée merci bcp d’avance !
Jean-Mi
February 27th, 2007 at 10:08 pm
[…] Manual instructions to patch the official release of G2 yourself to make it work with safe_mode on:http://shawking.free.fr/blog/?p=12 […]
February 28th, 2007 at 6:44 pm
I have the same issue as Jonathan. I get the LANG errors and i am taken back to Authencitate.
I had a patched version 2.0 which was working, now i have uploaded the 2.1.2, followed the instructions here and then run I the installer which gives me the errors.
I hope someone can help, my website is now mutilated :(
March 3rd, 2007 at 1:51 pm
@Jimmy : I think you need the GD2 library working with PHP. It seems to be not installed.
@Jonathon , Jimmy and DylanL : the patch I gave is only intended for the pre-installed version of the Gallery 2.1.2 module provided by free.fr, it may need modifications for standard installation to work flawlessly.
@Jonathon and DylanL : try to comment line 299 and 300 (”putenv”) in modules/core/classes/GalleryTranslator.class, it could help, please let me know the result.
Guillaume
March 3rd, 2007 at 8:42 pm
Kewl :)
March 4th, 2007 at 11:58 am
pb step 8
log :
2007-03-03 10:36:57 [TMP_SESSION_ID_DI_NOISSES_PMT] postgres7 error: [0: Connection error to server ’sql.free.fr’ with user ‘varietes.ligne’] in CONNECT(sql.free.fr, ?, ?, varietes_ligne)
Error (ERROR_STORAGE_FAILURE)
* in modules/core/classes/GalleryStorage.class at line 480 (GalleryCoreApi::error)
* in modules/core/classes/Gallery.class at line 202 (GalleryStorage::search)
* in modules/core/classes/helpers/GalleryPluginHelper_simple.class at line 478 (Gallery::search)
* in modules/core/classes/helpers/GalleryPluginHelper_simple.class at line 355 (GalleryPluginHelper_simple::fetchPluginList)
* in modules/core/classes/GalleryCoreApi.class at line 297 (GalleryPluginHelper_simple::fetchPluginStatus)
* in modules/core/classes/GalleryStorage.class at line 1188 (GalleryCoreApi::fetchPluginStatus)
* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1054 (GalleryStorage::describeMap)
* in modules/core/classes/GalleryStorage.class at line 517 (GalleryStorageExtras::removeMapEntry)
* in modules/core/classes/GalleryCoreApi.class at line 2815 (GalleryStorage::removeMapEntry)
* in modules/core/classes/helpers/GalleryFactoryHelper_medium.class at line 57 (GalleryCoreApi::removeMapEntry)
* in modules/core/classes/GalleryCoreApi.class at line 177 (GalleryFactoryHelper_medium::unregisterImplementationsByModuleId)
* in modules/core/CoreModuleExtras.inc at line 2892 (GalleryCoreApi::unregisterFactoryImplementationsByModuleId)
* in modules/core/module.inc at line 489 (CoreModuleExtras::performFactoryRegistrations)
* in modules/core/classes/GalleryModule.class at line 374 (CoreModule::performFactoryRegistrations)
* in install/steps/InstallCoreModuleStep.class at line 148 (GalleryModule::activate)
* in install/index.php at line 163 (InstallCoreModuleStep::processRequest)
database : postgresql
I don’t find the solution, can you help me ?
March 11th, 2007 at 4:23 pm
[…] Woo! äntligen hittat en liten guide på hur man kan få gallery 2 att fungera med safemode on som min host använder… Ska försöka leka lite med det snart. Här är guiden… These icons link to social bookmarking sites where readers can share and discover new web pages. […]
March 13th, 2007 at 11:04 am
Bonjour,
J’ai installé Gallery2 sur plusieurs de mes sites et je voudrais dire un immense merci à Guillaume pour sa générosité. Ses modifications fonctionnent parfaitement.
Je voudrais savoir si quelqu’un peut nous donner -en français- la marche à suivre pour personnaliser le skin de Gallery2.
March 19th, 2007 at 12:12 pm
Hi there,
After many tries with remote gallery, webdav and upload applet, I finally discovered that these modules where simply not installed by default with the installation of gallery made by free (when selecting galery on php modules in free admin console.
So I’ve downloaded these modules from menalto (webdav and remote) and will try to install them this evening (Can use Ftp for external places at work ;-)).
Anyone else have already experienced this ?
March 28th, 2007 at 11:07 am
hi,
did you find a way to delete multiple folders on free fr? i can delete folders when i connect through ftp, but gallery2 creates so many folders, and i was not able to delete a entire gallery2 installed gallery folder, because i get sometimes error and it stops the operation…
March 30th, 2007 at 9:05 pm
Hi,
Since 3 days it seems that there are issues on gallery2 installed on free.fr. I didn’t modify anything on my website by I get the following error message :
Fatal error: file_exists() [function.file-exists]: Unable to access / in /mnt/152/sdc/0/1/gretuxetpipux/gallery2/modules/core/classes/GalleryPlatform.class on line 156
The install was made using the tricks detailed above (safe mode files modified).
Does anyone have the same issue? Any idea to troubleshoot?
Thanks,
Pepebi
March 31st, 2007 at 11:56 pm
Salut
La fonction mail doit aussi être bidouillée:
Dans modules/core/classes/GalleryPhpVm.class vers la ligne 243, remplacer :
return mail($to, $subject, $message, $additionalHGalleryPhpVm.classeaders, $additionalParameters);
par:
return mail($to, $subject, $message);
Sinon on doit pouvoir faire mieux que commenter le rmdir, avec des ftp_connect et autres ftp_… mais je ne suis pas assez costaud en php. Alors pour le moment j’ai fait un rename en $filename.avirer et il faudra faire le ménage “a la main” en ftp.
Merci pour le bon boulot.
J’ai mis la 2.2.1 ce soir et ça marchotte.
April 3rd, 2007 at 2:05 pm
Fatal error: Call to undefined function: ftp_connect() in ….
it looks like ftp_connect can’t be used on free.fr :/
April 3rd, 2007 at 8:37 pm
Yes, I realized that too: ftp and imap modules are not installed on free. My workaround: edit rmdir function like this:
$tmpDir = $gallery->getConfig(’data.gallery.tmp’);
rename ($filename, $tmpDir);
return true;
And it works .. empty dirs disappear, although I don’t know exactly where they go ;)
Btw: you have to apply the “safe mode check always return true” patch in upgrade/steps just like you did in install/steps otherwise you can’t upgrade.
I’m running gallery 2.2 from svn right now.
May 1st, 2007 at 12:25 pm
[…] Pour la petite histoire l’intégration de Gallery 2 dans Wordpress à l’aide du plugins WPG2 est d’une grande simplicité, à condition d’utiliser l’un des thèmes wordpress spécialement adapté. Et, ça tombe bien, le thème dont dérive ce site en fait partie Le seul problème c’est l’incompatibilité de Gallery 2 avec le paramétrage des serveurs de free… Merci à tanhnhi pour la solution Le plus fastidieux a finalement été d’importer les galeries Photopress dans G2… […]
May 15th, 2007 at 9:37 am
Bonjour, comment faites-vous avec Free pour mettre le repertoire g2data sécurisé et en écriture totale (777).
Merci.
May 18th, 2007 at 12:52 pm
Merci pour ce site qui permet aux “zeros” en informatique d’installer gallery2 chez free.
La fonction mail marche parfaitement après la modif indiquée, par contre les autres modifs des fonctions rmdir et autre me renvoient des message d’erreur ( style invalid T_STRING ).
Personne n’aurait une archive de gallery2 2.2.1 avec les toutes les modifs pour free, comme guillaume l’avait proposé pour gallery 2.1 ?
Sinon je cherche aussi des grands pretres de l’utilisation de google-maps sur gallery :-)
Merci à tous
May 19th, 2007 at 3:03 pm
Guillaume Z, je te soumets une idée, et si tu nous metter un forum sur ton site et en français (car après tout seul des français peuvent avoir un compte free), pour discuter, échanger nos modif et autres, spéciale Gallery sur free.fr ??? ;)
Moi je dis ça serai Top !! :)
May 19th, 2007 at 3:17 pm
Pour effacer un dossier chez free, il faut qu’il soit vide, il faut donc effacer d’abord les fichiers contenu dans le dossier et après effacer le dossier, ce que ne fait pas le script de Gallery, et ceux même en FTP chez free et seulement chez free…
Car Gallery utilise rmdir, et cette fonction PHP est désactivée chez free
May 19th, 2007 at 3:36 pm
“Guillaume Z” ou “tanhnhi” pour le forum ;)