I have "bit the bullet" and hauled down and installed the tarball for zenphoto-zenphoto-1.4.8.tar.gz. Got a little way into setup, and crashed.
When attempting to restart, a login prompt panel is presented, and after provide user name and passwd, the following crash complaint:
Fatal error: Call to undefined function hash() in /usr/local/www/zenphoto/zp-core/lib-auth.php on line 1250This source-code line reference is to the following block of code:
1249 static function pbkdf2($p, $s, $c = 1000, $kl = 32, $a = 'sha256') {
1250 $hl = strlen(hash($a, null, true)); # Hash length
1251 $kb = ceil($kl / $hl); # Key blocks to compute
1252 $dk = ''; # Derived key
1253 # Create key
1254 for ($block = 1; $block <= $kb; $block++) {
1255 # Initial hash for this block
1256 $ib = $b = hash_hmac($a, $s . pack('N', $block), $p, true);
1257 # Perform block iterations
1258 for ($i = 1; $i < $c; $i++)
1259 # XOR each iterate
1260 $ib ^= ($b = hash_hmac($a, $b, $p, true));
1261 $dk .= $ib; # Append iterated block
1262 }
1263 # Return derived key of correct length
1264 return substr($dk, 0, $kl);
1265 }
So, what about this "undefined" hash() function, embedded in a
string length call? Is this
yet another missing piece of the PHP PIG, i.e.,
php56-5.6.10? So far, I've had to manually install additional modules, extensions, etc:
php56-gd
php56-session-5.6.10
...resulted in the installation of the following
libXpm: 3.5.11_3
xproto: 7.0.27
libXext: 1.3.3_1,1
xextproto: 7.3.0
libXau: 1.0.8_3
libX11: 1.6.2_3,1
libxcb: 1.11_1
libXdmcp: 1.1.2
libxml2: 2.9.2_2
libpthread-stubs: 0.3_6
kbproto: 1.0.6
libXt: 1.1.4_3,1
libSM: 1.2.2_3,1
libICE: 1.0.9_1,1
freetype2: 2.5.5
gdbm: 1.11_2
gmp: 5.1.3_2
libexecinfo: 1.1_3
png: 1.6.17
jpeg: 8_6
t1lib: 5.1.2_4,1
libXaw: 1.0.12_3,2
printproto: 1.0.5
libXp: 1.0.3,1
libXmu: 1.1.2_3,1
...and of course regarding other aplications,
had to install the following, too.
php56-pdo-5.6.10
php56-mysql-5.6.10
php56-pdo_mysql-5.6.10
php56-bz2-5.6.10
I'm really tired of this %
@#$!
I'm an old programmer. I'll be sixty-six years old next week. I write a lot of languages, but PHP has to be the surliest piece of work to install.
Comments
`hash()` actually belongs to a standard PHP extension that should generally be available:
https://secure.php.net/manual/de/book.hash.php
Evne the PDO and MySQL are such standard extension that are simply needed to be there. If I am not mistaken a graphics libary like GDlibary or Imagick is also missing from your list.
Regardless, I did search the FreeBSD forum and found this post:
https://forums.freebsd.org/threads/opencart-php-call-to-undefined-function-hash.50583/#post-292396
I followed the original FreeBSD Forum's poster's lead and installed the additional php56-extensions package. This enabled the plethora of additional extensions support including hash support that solved the undefined function crash. I had overlooked (or didn't know to look for it) in the phpinfo() output . . .just assumed that it should be part of the base.
I have successfully installed the v1.4.8 from your tarball and with a little tweaking, appears to be working well. That nuance regarding the prefix to the MySQL table names resolved the path problem that I suspected. Now all of my album data are found and rendered as advertized. You might be interested to know that I did upgrade directly from v1.4.0.4 to v1.4.8. and apparently the table elements were successfully mapped where matches were found. If I had understood the path nuances, and didn't have to contend with a partial PHP5.6 installation, then I think it would have gone very quickly and I would not have cluttered your forum with so many posts.
Finally, I do appreciate that probably many of your users are not programmers, and are probably using third-party hosting sites (where they don't have to install and configure PHPig), etc., and are looking for something cleaner, more versatile, and less cluttered than say, for example, PhotoBucket.
Oh, and yeah, I had to install the GD graphics suite, too. I guess that what is "standard" for some, is not so "standard" for others.
OTTF,
Ron W.
Direct upgrades from older versions often work well and I even did it from much older ones successfully. But since we don't specifially test it, it may also fail in some parts. In any case the biggest problem are mostly old themes or plugins especially if third party or custom ones that need updating. Even if they are they not necessarily setup or know how to servers on their own. Yes, would be great if all servers all over the world would be setup the same way.