Jump to content
Sign in to follow this  
imgrooot

Using this famous password library gives me an error on live server. Why's that?

Recommended Posts

I am using this https://github.com/ircmaxell/password_compat

 

I have no problem using it on a local server. But as soon as I test it on a live server, it gives me an error like this. 

Parse error: syntax error, unexpected '{' in /home/public_html/sub/snippets/password.php on line 19

The error is on the same line as the beginning of the code in that library. 

 

Why is this happening?

Share this post


Link to post
Share on other sites

So what is line 19 in your password.php script? There's no opening brace on line 19 in any of the official versions.

 

Is it “namespace {”? Then you're appearently running an ancient, long-abandoned PHP version (something prior to 5.3).

Share this post


Link to post
Share on other sites

So what is line 19 in your password.php script? There's no opening brace on line 19 in any of the official versions.

 

Is it “namespace {”? Then you're appearently running an ancient, long-abandoned PHP version (something prior to 5.3).

 

Yes it's the “namespace {”.

 

And yes you're correct. The server was running older PHP version.  I switched it to PHP 5.4 and i no longer get that error.

 

Thanks for clearing it up.

Share this post


Link to post
Share on other sites

 

 

 I switched it to PHP 5.4

 

You are still well over a hundred releases behind. You need to be running 5.6x minimum.

Share this post


Link to post
Share on other sites

You are still well over a hundred releases behind. You need to be running 5.6x minimum.

 

I do see the option for 5.6x but it says it's currently in BETA stage.  Is it wise to use it?  Btw, I am using bluehost web hosting.

Share this post


Link to post
Share on other sites

What a weird hoster.

 

PHP 5.6 is indeed the current PHP version (together with the new PHP 7 branch). But before you upgrade, you should definitely ask Bluehost what on earth they mean by “beta”.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.