Parse error: syntax error, /.../zp-core/functions-basic.php on line 1886, at the first installation

After transferring all the folders and files of the installation to the server, using FTP, when I try to access the first time this error appears:
Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in /srv/disk5/jolepo/www/joanL/zp-core/functions-basic.php on line 1886
Can you help me?
Thank you very much


  • acrylian Administrator, Developer

    That error suggest that there is a wrong closing bracket. I cannot see that in the code in that line.

    What Zenphoto version? And could you perhaps paste in the content of the line mentioned. Thanks.

  • Zenphoto 1.5.7

    line 1886:

    if (defined('WEBPATH') && !empty(WEBPATH) && strpos($redirectTo, WEBPATH) === false) {
    $redirect .= WEBPATH;

    * Sanitizes a "redirect" post to always be within the site
    * @param string $redirectTo
    * @return string
    function sanitizeRedirect($redirectTo) {
    $redirect = NULL;
    if ($redirectTo && $redir = parse_url($redirectTo)) {
    if (isset($redir['scheme']) && isset($redir['host'])) {
    $redirect = $redir['scheme'] . '://' . sanitize($redir['host']);
    if (defined('SERVER_HTTP_HOST') && $redirect != SERVER_HTTP_HOST) {
    $redirect = SERVER_HTTP_HOST;
    if (defined('WEBPATH') && !empty(WEBPATH) && strpos($redirectTo, WEBPATH) === false) {
    $redirect .= WEBPATH;
    if (isset($redir['path'])) {
    $path = urldecode(sanitize($redir['path']));
    //Prevent double slashes or missing slash with WEBPATH on subfolder installs
    if(substr($path , 0, 1) != '/') {
    $path = '/' . $path;
    $redirect .= $path;
    if (isset($redir['query'])) {
    $redirect .= '?' . sanitize($redir['query']);
    if (isset($redir['fragment'])) {
    $redirect .= '#' . sanitize($redir['fragment']);
    return $redirect;

  • acrylian Administrator, Developer

    The lines are the same in 1.5.8b and I don't see any wrong bracket.

    This is a fresh install, right? Then there is a bug with some redirection link. Please try the 1.5.8b (support build), link on the download page on the right column.

  • I have uninstalled version 1.5.7 and downloaded and installed version 1.5.8b.
    The same error appears, on a different line:

    Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in /srv/disk5/jolepo/www/joanL/zp-core/functions-basic.php on line 1891

  • acrylian Administrator, Developer

    Okay, I see, we had this before. Is it possible that you are still on an outdated PHP version like 5.5 or even older? Then please upgrade to to 7+ or 7.2+ or at least 5.6.

    Note 1.5.8 later on - incl. the beta - will probably not allow installs on anything lower than 5.6 which is the minimum requirement anyway. We still had allowed older verions for some user convenience but since we don't even test anything below 7.4 specifically this can happen.

  • I have activated PHP 7.0 and it has worked!
    Thank you very much for your attention and quick response.

Sign In or Register to comment.