1.2 unpack(): Type H: problem

Updated to 1.2 a couple of weeks ago and all seemed to go well. I then noticed that the comments was throwing up an error. No big problem, I disabled the comments for now. I then stumbled across another problem... Normally I leave myself logged in to Admin. I logged out to check that a hidden album was 'hidden'. Now I can't log back in!

I get the following error:-
------------------------------
Warning: unpack(): Type H: outside of string in /websitename/zp-core/auth_zp.php on line 52

Warning: Cannot modify header information - headers already sent by (output started at /websitename/zp-core/auth_zp.php:52) in /websitename/zp-core/admin-functions.php on line 185
------------------------------

Pretty sure that this is the same as I was getting with the comments section.

Is this down to the version of PHP or something else? What can I do to sort it out? Thanks.

Comments

  • I should mention that the following message appears in the Login box:-

    Warning: unpack(): Type H: outside of string in /websitename/zp-core/functions.php on line 2377
  • This is a problem which has been corrected in the nightly builds.
  • Thanks for that, I'll give the latest nightly a try.
  • If it doesn't work, it might be in tonights nightly build, not sure which one its in :P
  • :) Just tried with the 2008-09-08 build and although it has detected an upgrade I can't get it to do it. Tried admin.php, upgrade.php and setup.php. The error keeps me from logging in and getting any further though. :(
  • What is the error you are getting?
  • There was an error logging in.
    Check your username and password and try again.

    Warning: unpack(): Type H: outside of string in /websitename/zp-core/functions.php on line 2380
  • What is your version of PHP? Research on this error message indicates that it may be caused by a bug in particular versions of PHP.
  • It is 4.3.1.0

    So I take it that the nightly build doesn't fix this then?
  • Unfortunately, no. The bug is in your PHP: http://bugs.php.net/bug.php?id=31465

    You need to upgrade your PHP, but not to 5.0.3! The bug is in 4.3.10 and 5.0.3.
  • :( Poopoo. Unlikely that my web host is going to be updating PHP any time soon. Is there any way I can get around this login problem? Everything was fine until I logged out but now everytime I load up the website it redirects to the upgrade page!!
  • I am not really sure why that error is making the login fail. But you can disable the captcha on the login (and thus bypass the error) by changing line 357 in admin-functions.php. It currently reads `if (count(getAdminEmail()) > 0) {`. Change it to `if (false) {` The down side of this is that it also disables the password reset e-mail.

    EDIT: Just noticed that you said when you log off you are redirected to the upgrade page. Did you run setup after you loaded the nightly build? If not you need to. Zenphoto detects when the files have been upgraded and redirects you to the setup page so that you will run it to make any database changes that might be needed.
  • Thats the problem. I can't run the upgrade because I need to log in. Can't log in so no upgrade. :( I'll try editing the admin-functions.php
  • Hmm...ok. One step further. I now get the following error at the top of the upgrade page when I try to log in:-

    Warning: unpack(): Type H: outside of string in /websitename/zp-core/auth_zp.php on line 52
  • Is there a way for me to bypass the login to upgrade. I can then re-enable the login and at least the site will be live again...
  • Not really any way to bypass the login. just comment out that line in auth_zp.php.
  • I have found a way to replace the `unpack()` calls in zenphoto. This change will be in tonight's nightly build. It will get rid of the warning and so far as I know will work on all versions of PHP.
  • Excellent work! You guys have my utmost respect for the time and effort you put into Zenphoto. I will give it a try.
Sign In or Register to comment.